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

Improve the structure of the API docs #33

Open
ncoghlan opened this issue Oct 21, 2024 · 1 comment
Open

Improve the structure of the API docs #33

ncoghlan opened this issue Oct 21, 2024 · 1 comment
Assignees
Labels
Category: Documentation Improvements or additions to documentation

Comments

@ncoghlan
Copy link
Collaborator

ncoghlan commented Oct 21, 2024

The current API docs are essentially just a sphinx-autogen dump with a bit of manual cleanup to address misfires like including the entire str, Sequence, Mapping, and dict APIs on types that implement those interfaces.

As parts of the API stabilise, their documentation should move away from relying on autosummary and towards regular toctree directives.

Public functions that are missing docstrings should have them added.

The TypedDict metadata is also incorrect (the mapping fields are listed as attributes, which is technically true of the class definition, but not true of the objects that a typechecker will classify as providing that interface).

Finally, while the one-page-per-entity layout is apparently more search-engine friendly, it makes it hard to see how the various interfaces relate to each other, so it's likely worth pushing at least the module level functions and the basic type definitions up to the relevant module pages.

@ncoghlan ncoghlan added the Category: Documentation Improvements or additions to documentation label Oct 21, 2024
@ncoghlan ncoghlan self-assigned this Oct 29, 2024
ncoghlan added a commit that referenced this issue Oct 29, 2024
Also appropriately marks some symbols that
shouldn't be accessed externally as private.

Initial steps towards to addressing #33
ncoghlan added a commit that referenced this issue Oct 30, 2024
Also appropriately marks some symbols that
shouldn't be accessed externally as private.

Initial steps towards to addressing #33
@ncoghlan
Copy link
Collaborator Author

ncoghlan commented Nov 5, 2024

As part of this, the docstrings should be reformatted to use a fully supported docstring syntax.

The default option is https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html, but that's pretty boilerplate heavy.

So instead, I'm leaning towards enabling the https://sphinxcontrib-napoleon.readthedocs.io/en/latest/index.html and using Google-style docstrings: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html#example-google (that's an aesthetic preference, as I genuinely don't like the way the NumPy syntax looks when reading code)

This will mean turning on the ruff lint settings to expect docstrings to be in Google format (see https://docs.astral.sh/ruff/settings/#lint_select and https://docs.astral.sh/ruff/settings/#lintpydocstyle )

ncoghlan added a commit that referenced this issue Nov 8, 2024
* Enable docstring linting for public API elements
* Linting enforces the use of Google-style docstrings
* Update the names and visibility of various API elements
* Add missing docstrings to public API elements
* Fix some docstring text formatting issues
* Add release notes for these changes and docs process changes

Continues progress on issue #33 (improving the API docs).
ncoghlan added a commit that referenced this issue Nov 11, 2024
* Enable docstring linting for public API elements
* Linting enforces the use of Google-style docstrings
* Update the names and visibility of various API elements
* Add missing docstrings to public API elements
* Fix some docstring text formatting issues
* Add release notes for these changes and docs process changes
* Bump the dev bundle version to ensure test envs are updated

Continues progress on issue #33 (improving the API docs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant