-
-
Notifications
You must be signed in to change notification settings - Fork 702
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
wip: MkDocs #4612
base: master
Are you sure you want to change the base?
wip: MkDocs #4612
Conversation
How do I go about viewing these docs? |
@elParaguayo thanks for asking! I updated the PR description 🙂 |
If mkdocs has an equivalent for custom directives, I can look at migrating those two. |
Completely agree. I like the navigation in the current docs: you see all available layouts or widgets in the left sidebar, without noise like methods, etc.
This draft basically renders all documented attributes and methods (inherited as well) of these layout classes, but it's possible to choose exactly which one to render. However, I'm surprised by "ignoring other methods": if they do not show up, it means that they are not documented (they don't have docstrings). Maybe they exist on the base layout class, and are overridden in the child classes? It's possible that Sphinx picks up the parent docstring (that's what
We have multiple options.
( |
I think Markdown Exec could work here. Jina templates should still work too (with some tweaks). I'll clone your branch and have a play. Can you add any further changes you make as new commits so the root commit here is unchanged. |
Just a note that I didn't forget about this, I'm just very busy these days 😄 |
Note to myself. Once the resulting docs look good and are complete/correct (compared to the current ones), rebase commits to ease code review:
|
I have reworked my commits to make them easier to review. The 3rd and 4th are the hardest one (lots of changes, converting RST to MD). Please let me know if you're OK with switching to Google-style docstrings, or if I should stick to Numpydoc-style 🙂 |
I don't think we're following Numpydoc, just using rST in the docstrings as we can. 😅 Anything would work, pick what you prefer. |
Here are the rules I followed to write/update docstrings:
There are other rules I did not check or enforce here, because tools like Ruff can do that automatically in the time it takes me to blink:
And yet again other rules I did not enforce because it's a matter of preference and is not super important:
Further changes can be made in separate PRs. Since we're using mkdocstrings here, which uses Griffe to parse docstrings, refer to Griffe's docs for a description of the Google-style: https://mkdocstrings.github.io/griffe/docstrings/#google-style. |
OK I actually ran Ruff with the following settings: [lint]
# Enable all `pydocstyle` rules, limiting to those that adhere to the
# Google convention via `convention = "google"`, below.
select = ["D"]
# On top of the Google convention, disable `D417`, which requires
# documentation for every function parameter.
ignore = ["D203", "D213", "D407", "D408", "D409", "D410", "D413", "D417"]
[lint.pydocstyle]
convention = "google" ruff check --fix-only libqtile --unsafe-fixes It fixed all the missing dots at the end of summaries as well as blank lines at the start/end of docstrings. |
Now that docstrings are all formatted using the Google-style, the docstring parser from Griffe is able to tell us when some parameters name are wrong or missing type info:
|
@elParaguayo I managed to render the subscribe hooks 🙂 |
I have converted the changelog to Markdown, see the result here: https://pawamoy.github.io/qtile/manual/changelog/. |
4367b83
to
e9a6436
Compare
@ramnes I have reworked the navigation for layouts so that they are all displayed on the left, each in a separate page, see https://pawamoy.github.io/qtile/manual/commands/api/layouts/. I had to manually create the pages and list them in the navigation in mkdocs.yml to retain the contents in the "Layouts" page itself (which is a section). We can generate all these sub-pages automatically (with some scripts and config, see the gen-files and literate-nav plugins in mkdocs.yml), but it won't allow us to have contents in the "Layouts" section itself, unless we automate the whole "Commands API" section (which seems possible too). See oprypin/mkdocs-gen-files#31. I'll rework the Widgets section the same way, because it is currently a single enormous page that has trouble loading even with decent bandwidth / CPU. |
This PR is stale because it has been open 90 days with no activity. Remove the |
Ah, stale bots. |
This PR is stale because it has been open 90 days with no activity. Remove the |
Thank you so much stale bot for the reminder. |
It's a draft, but you can already review if you'd like 🙂
To preview the docs locally:
If you want to speed up the reloading, you can disable mkdocstrings temporarily (which takes up most of the build time) with this:
Preview online, on my fork's pages: https://pawamoy.github.io/qtile/
__all__
variables.If you serve the docs locally, or navigate the online docs, you'll notice some rendering issues and broken links: that's normal, I'll fix everything progressively. Once we're out of draft though, please mention these issues in reviews. I'll only move out of draft once I'm confident the docs are "correct" (no broken links, no rendering issues, no missing contents).
Tasks