-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration for mkdocs
#45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and looks good
Merge conflict due to the previous PR merges for PyTest altering the dependencies, needs the poetry.lock file regenerating and a new .toml file with combined PyTest/mkdocs changes. |
Done. Thanks for review! |
Looks like I can't merge this myself, but it's ready to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me! We should open an issue about the docstrings style inconsistency
Done: #49 |
This PR adds support for building documentation and auto-publishing it to GitHub Pages via a CI workflow. This includes both API documentation generated from the source code as well as technical documentation in
.md
files (at present, it just includes the files that were in theTutorials
folder).To see the result:
poetry install
mkdocs serve -o
to build the documentation and view in a web browser.The API documentation is generated with
mkdocstrings-python
, which supports a number of docstring styles (see here). At present, however the docstrings seem to be in a mixture of Google style and sphinx style, so the parsing is not great (i.e. of arguments etc.). Longer term, it would make sense to reformat the docstrings to use one style so thatmkdocs
can process them correctly. (When you build the documentation, you'll get a bunch of warnings from the underlyinggriffe
library which should give you hints about what needs fixing.)For now, I've set the CI job to run on every push to
main
, but at some point, you may only want to update the documentation on releases at which point you can tweak the config file. To configure your repo to publish to GitHub Actions via a workflow, you need to follow the steps here: https://mkdocstrings.github.io/griffe/reference/docstrings/I had to bump the version of the
regex
package because the version specified inpyproject.toml
was too old for the latest version ofmkdocs
.Let me know if you have any questions!
Closes #30.