Skip to content
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

Merged
merged 5 commits into from
Oct 2, 2024

Conversation

alexdewar
Copy link
Collaborator

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 the Tutorials folder).

To see the result:

  1. Check out this branch
  2. Install new dependencies with poetry install
  3. Run 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 that mkdocs can process them correctly. (When you build the documentation, you'll get a bunch of warnings from the underlying griffe 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 in pyproject.toml was too old for the latest version of mkdocs.

Let me know if you have any questions!

Closes #30.

Copy link
Collaborator

@Thomas-Rowlands Thomas-Rowlands left a 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

@Thomas-Rowlands
Copy link
Collaborator

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.

@alexdewar
Copy link
Collaborator Author

Done. Thanks for review!

@alexdewar
Copy link
Collaborator Author

Looks like I can't merge this myself, but it's ready to go now.

Copy link
Collaborator

@AdrianDAlessandro AdrianDAlessandro left a 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

@alexdewar
Copy link
Collaborator Author

Done: #49

@Thomas-Rowlands Thomas-Rowlands merged commit d9eddbe into omicsNLP:main Oct 2, 2024
@alexdewar alexdewar deleted the mkdocs branch October 31, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation tooling + skeleton
3 participants