Skip to content

Move the current Sphinx docs for the python API to mkdocs#36

Merged
Tim-Evans-Seequent merged 7 commits intomainfrom
docs
Mar 19, 2025
Merged

Move the current Sphinx docs for the python API to mkdocs#36
Tim-Evans-Seequent merged 7 commits intomainfrom
docs

Conversation

@rachelcarpenterseequent
Copy link
Collaborator

@rachelcarpenterseequent rachelcarpenterseequent commented Mar 13, 2025

All of the documentation in this repo uses mkdocs, apart from the python documentation which has it's own build process and toolchain.

To make things easier, move the python documentation toolchain to be mkdocs.
Using the plugin mkdocstrings which builds basic documentation for modules from docstrings. This matches the functionality of the previous Sphinx autogenerated documentation. https://mkdocstrings.github.io/

No new documentation added. Tested by building locally, using the same bash script that the GitHub action uses. The GitHub action will continue to fail unless we enable GitHub pages for this forked repo, but should work in the upstream repo where this is enabled.

Screenshot of docs:
image

image

@Tim-Evans-Seequent
Copy link
Collaborator

Tim-Evans-Seequent commented Mar 18, 2025

@rachelcarpenterseequent I've pushed a few changes:

  • Merged the upgrade rust branch into this one to avoid conflicts.
  • Fixed the doc build scripts, as they didn't work on a clean checkout.
  • Added a top-of-crate doc-comment to the omf_python crate, and include it in the generated stub file.
  • With the top-of-crate doc-comment providing the introduction now, I have merged the two pages of Python docs.

The remaining problem is larger: these extracted Python doc-strings look terrible. The formatting makes them basically impossible to use. My guess is that mkdocstrings-python is expecting certain CSS classes that aren't present in the rest of the docs.

The scrolling of the contents list on the left is also wrong. You can't read the whole thing until you scroll right to the bottom of that rather large page. That could be fixed by breaking things up into multiple pages maybe.

If there's no easy way to fix that then I would prefer Python worked the same was as Rust, and we generate the docs separately and just link to them.

@Tim-Evans-Seequent Tim-Evans-Seequent changed the base branch from main to upgrade-rust March 19, 2025 22:18
Copy link

@robbieaverill robbieaverill left a comment

Choose a reason for hiding this comment

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

LGTM. There will be some conflicts and overlap with #41 though, so it might be worth merging that before this one.

@Tim-Evans-Seequent
Copy link
Collaborator

Will land this now, as it solves some issues. We can address the formatting in another PR

@Tim-Evans-Seequent Tim-Evans-Seequent deleted the branch main March 19, 2025 23:22
@Tim-Evans-Seequent Tim-Evans-Seequent changed the base branch from upgrade-rust to main March 19, 2025 23:25
@Tim-Evans-Seequent Tim-Evans-Seequent merged commit 79bfd74 into main Mar 19, 2025
14 checks passed
@Tim-Evans-Seequent Tim-Evans-Seequent deleted the docs branch March 19, 2025 23:30
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.

3 participants