Rule Documentation UX improvement suggestions: navigation + link to source #13367
Labels
documentation
Improvements or additions to documentation
wish
Not on the current roadmap; maybe in the future
Hi there,
As user I frequently wish the docs would have these functionalities:
Navigation between rule pages
Navigate to another rule of the same prefix, e.g. on any rule page https://docs.astral.sh/ruff/rules/suppressible-exception/ it would be great to be able to navigate to the previous/next rule with the same prefix. This would be a nicer experience to explore a set of rules then going back and opening each rule in a new tab from the (huge) all rules page.
One option would be to enable footer navigation: https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-footer/#navigation
Moreover/alternatively, I could imagine:
Markdown example:
Link to source/fixtures
Rule documentation as is does not answer questions such as:
To allow the user to more easily answer these questions before opening an issue, it would be helpful to link the source code and/or the Python fixtures for a rule on that page. Going from the root directory on GitHub, this can save around 7 clicks, e.g. https://github.com/astral-sh/ruff/blob/main/crates/ruff_linter/resources/test/fixtures/flake8_tidy_imports/TID251.py.
Possible implementation: https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions
Code block titles
Minor tweak to make instantly clear which snippet to take (alternatives as "bad" | "bad.py" and "good" | "good.py" could work too):
As done in uv, e.g. https://github.com/astral-sh/uv/blob/main/docs/guides/scripts.md
https://squidfunk.github.io/mkdocs-material/reference/code-blocks/
Happy to contribute a PR, but first opening it up for discussion
The text was updated successfully, but these errors were encountered: