-
Notifications
You must be signed in to change notification settings - Fork 786
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
[Docs] Automate docs generation for BINDINGS et al #1705
Comments
Default css is not a bad idea. Could be very useful in docs. |
Yup. That was more of a rhetoric question so that I wouldn't forget about it. The default css should definitely be documented but the only obvious alternative I know of would make the full string appear inlined with the attribute in the header... Which is not what we want. With the plugin we could inject it into the docstring and surrounded by backticks to style it as Textual CSS. |
For widgets, can we collect all the attributes that are reactive and list them in a separate table? E.g., to include them in the reference pages. |
OK, so I wrote a hack with tree_sitter and can parse out CSS_DEFAULTS from Python, then parse it as a CSS language. Now what? Consider this rule:
gives Outside of DEFAULT_CSS, what else should get parsed? |
Just as an FYI. I'm still playing with this:
If anyone wishes, I can post the code so far (tools/widget_walk.py and tools/test_widget_walk*). |
A widget's
BINDINGS
andCOMPONENT_CLASSES
have tables that are partially generated bytools/widget_documentation.py
but that must be kept updated by hand.Investigate whether we can make a
mkdocs
/mkdocstrings
plugin that inspects attributes likeBINDINGS
andCOMPONENT_CLASSES
to build their tables on the fly.What about
DEFAULT_CSS
? Can we document their values (e.g., by setting the docstring to match the string value itself)?The text was updated successfully, but these errors were encountered: