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

Update docs build process #461

Merged
merged 18 commits into from
Aug 15, 2024
Merged

Conversation

frazane
Copy link
Contributor

@frazane frazane commented Jul 15, 2024

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Description

This PR brings changes to the doc build process, specifically to how the example notebooks are handled. In short, we stop using some mkdocs plugins and instead use jupytext and nbcovert directly, which is more robust and only adds an extra command to the building process. Here's a summary of the changes:

  • all the examples are moved from docs/examples to examples under the top level of the directory, which gives them more visibility and separates them for the doc building process (i.e. from the corresponding markdown files)
  • a new script to convert .py notebooks to markdown files is added (docs/scripts/gen_examples.py), which stores the generated markdown files under docs/_examples. Includes CLI parameters to optionally execute notebooks, to specify the number of notebooks to be processed in parallel and whether to only process notebooks that have been updated.

With these changes, the documentation can now be generated with:

poetry run python docs/scripts/gen_examples.py && poetry run mkdocs serve

@frazane frazane added the documentation Improvements or additions to documentation label Jul 15, 2024
Copy link
Collaborator

@thomaspinder thomaspinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once linters pass, I am happy to merge this.

@Thomas-Christie
Copy link
Contributor

FYI I realised Ruff has been pinned to an old version for a while - I upgraded it and fixed the raised issues (some of which are present in this PR) in #461

@thomaspinder
Copy link
Collaborator

FYI I realised Ruff has been pinned to an old version for a while - I upgraded it and fixed the raised issues (some of which are present in this PR) in #461

Thanks @Thomas-Christie. I merged that PR, so you can probably just rebase from that @frazane

@thomaspinder thomaspinder merged commit 0d21a31 into flax-backend-normalclasses Aug 15, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants