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

Use MkDocs autodoc to generate documentation #1159

Closed
yifanmai opened this issue Nov 17, 2022 · 7 comments
Closed

Use MkDocs autodoc to generate documentation #1159

yifanmai opened this issue Nov 17, 2022 · 7 comments
Assignees
Labels
p1 Priority 1 (Required for release)
Milestone

Comments

@yifanmai
Copy link
Collaborator

In particular, we want to generate documentation for built-in scenarios, models, adapters, etc. Auto-generating the documentation will make it easier to keep things in sync.

@yifanmai
Copy link
Collaborator Author

Ended up using MkDocs instead of Sphinx because:

  • Native support for Markdown, which we already use (Sphinx prefers ReStructuredText and needs an extension for Markdown)
  • Better developer ergonomics (e.g. hot reloading server)

@yifanmai
Copy link
Collaborator Author

Running into a weird issue where using Google style docstrings with mkdocstrings causes it to spuriously create sections where it shouldn't e.g.

Example:

    This should be code, not a section

The workaround is to delete the trailing colon.

@yifanmai
Copy link
Collaborator Author

Here's what the undesired section rendering looks like:

bad_section

I deleted the colons for now. I'll add them back after figuring out how to disable the section rendering (maybe there's a config flag somewhere).

@yifanmai yifanmai changed the title Use Sphinx autodoc to generate documentation Use MkDocs autodoc to generate documentation Nov 21, 2022
@teetone teetone added the v0.1.1 label Nov 25, 2022
@yifanmai
Copy link
Collaborator Author

The regular expression that creates the undesired sections / admonitions is here. As far as I can tell, there is no way to disable it. The workarounds are to avoid the regex e.g. by adding **bold** markdown or other punctuation to the header.

@yifanmai
Copy link
Collaborator Author

We want dataclass documentation as well, as discussed in #1117

@percyliang percyliang added the p1 Priority 1 (Required for release) label Nov 29, 2022
@yifanmai
Copy link
Collaborator Author

yifanmai commented Dec 1, 2022

As noted in #1209, we need to add more schemas for dataclasses e.g. MetricName, Run, AdapterSpec, ScenarioState, etc.

@yifanmai
Copy link
Collaborator Author

yifanmai commented Dec 15, 2022

MkDocs is used now so I will close this issue. There's more documentation to write, but that should be in different issues.

@yifanmai yifanmai added this to the v0.2.0 milestone Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1 Priority 1 (Required for release)
Projects
None yet
Development

No branches or pull requests

3 participants