Skip to content

Commit 6094a4b

Browse files
authored
Merge pull request #102 from haddocking/mkdocs
Make mkdocs documentation for powerfit
2 parents 047844f + bf998b2 commit 6094a4b

File tree

12 files changed

+561
-290
lines changed

12 files changed

+561
-290
lines changed

.github/workflows/pages.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deploy MkDocs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Only have one deployment in progress at a time
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: install system dependencies
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y openmpi-bin libopenmpi3 libopenmpi-dev
31+
32+
- name: install powerfit with extra dependencies
33+
run: pip install '.[docs]'
34+
35+
- name: Build MkDocs site
36+
run: |
37+
mkdocs build
38+
env:
39+
# Force colored output from rich library
40+
TTY_COMPATIBLE: "1"
41+
TTY_INTERACTIVE: "0"
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
45+
with:
46+
path: site
47+
48+
deploy:
49+
# Add a dependency to the build job
50+
needs: build
51+
52+
# Only deploy on pushes to main or manual trigger of main branch
53+
if: github.ref == 'refs/heads/main'
54+
55+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
56+
permissions:
57+
pages: write # to deploy to Pages
58+
id-token: write # to verify the deployment originates from an appropriate source
59+
60+
# Deploy to the github-pages environment
61+
environment:
62+
name: github-pages
63+
url: ${{ steps.deployment.outputs.page_url }}
64+
65+
# Specify runner + deployment step
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Deploy to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4

CONTRIBUTING.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing guidelines
22

3-
We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
3+
We welcome any kind of contribution to our software, from simple comment or question to a full fledged [pull request](https://help.github.com/articles/about-pull-requests/). Please read and follow our [Code of Conduct](https://github.com/haddocking/powerfit/blob/master/CODE_OF_CONDUCT.md).
44

55
A contribution can be one of the following cases:
66

@@ -31,7 +31,7 @@ The sections below outline the steps in each case.
3131
1. (**important**) announce your plan to the rest of the community *before you start working*. This announcement should be in the form of a (new) issue;
3232
1. (**important**) wait until some kind of consensus is reached about your idea being a good idea;
3333
1. if needed, fork the repository to your own Github profile and create your own feature branch off of the latest main commit. While working on your feature branch, make sure to stay up to date with the main branch by pulling in changes, possibly from the 'upstream' repository (follow the instructions [here](https://help.github.com/articles/configuring-a-remote-for-a-fork/) and [here](https://help.github.com/articles/syncing-a-fork/));
34-
1. install dependencies (see the [development documentation](README.md#development));
34+
1. install dependencies (see the [development documentation](#development));
3535
1. make sure the existing tests still work by running ``pytest``;
3636
1. add your own tests (if necessary);
3737
1. update or expand the documentation;
@@ -44,8 +44,8 @@ In case you feel like you've made a valuable contribution, but you don't know ho
4444

4545
To create a release you need write permission on the repository.
4646

47-
1. Check the author list in [`CITATION.cff`](CITATION.cff)
48-
1. Bump the version in [src/powerfit_em/__init__.py](src/powerfit_em/__init__.py)
47+
1. Check the author list in [`CITATION.cff`](https://github.com/haddocking/powerfit/blob/master/CITATION.cff)
48+
1. Bump the version in [src/powerfit_em/__init__.py](https://github.com/haddocking/powerfit/blob/master/src/powerfit_em/__init__.py)
4949
1. In [README.md](README.md) adjust docker command to use new version
5050
1. Go to the [GitHub release page](https://github.com/haddocking/powerfit/releases)
5151
1. Press draft a new release button
@@ -57,6 +57,30 @@ To create a release you need write permission on the repository.
5757
1. Wait until [Create and publish a Docker image](https://github.com/haddocking/powerfit/actions/workflows/docker-publish.yml) has completed.
5858
1. Verify [new Docker images](https://github.com/haddocking/powerfit/pkgs/container/powerfit)
5959

60+
## Contributing to documentation
61+
62+
Whenever you have changed something in the codebase, this also needs to be reflected in the documentation.
63+
To work on the PowerFit documentation you need to install the documentation version of using:
64+
65+
```shell
66+
pip install -e .[docs]
67+
```
68+
69+
Start the live-reloading docs server with:
70+
71+
```shell
72+
mkdocs serve
73+
```
74+
75+
Build the documentation site with:
76+
77+
```shell
78+
mkdocs build
79+
# The site will be built in the 'site/' directory.
80+
# You can preview it with
81+
python3 -m http.server -d site
82+
```
83+
6084
# Development
6185

6286
To develop PowerFit, you need to install the development version of it using.

0 commit comments

Comments
 (0)