Internal API documentation? #1290
Replies: 7 comments
-
I've been looking into setting up MkDocs or similar to generate documentation, and then moving the docs I wrote in there. Of course I'd also prefer to have the docs within the code, and written in Markdown, so this seems like the best approach. But until then, https://plover.rtfd.io will have to do 😅 |
Beta Was this translation helpful? Give feedback.
-
I might want to look at this soon. Once in a while, when I write a plugin that needs some Plover features, I would have to look it up in the Plover source code. And it would be better if I write this down than to forget about it and have to look it up again. I'm not really experienced in these things (and then, there are too many choices -- Sphinx? MkDocs? pdoc? Do I even know reST?) |
Beta Was this translation helpful? Give feedback.
-
Did some initial work. ( I prefer type annotation, so this will be incompatible with Plover... (instruction:
)
|
Beta Was this translation helpful? Give feedback.
-
The equivalent of mkdocstrings in Sphinx is autodoc. Some documentation convention should be followed for consistent HTML generation. (and perhaps for mypy type checking too) There appears to be some choices...
The latter 2 requires an additional plugin (napoleon?) Neither are compatible with the current Plover's documentation format. |
Beta Was this translation helpful? Give feedback.
-
Looking at the options. @<developers> What exactly can be included in the code?
|
Beta Was this translation helpful? Give feedback.
-
Trying autodoc on (running instruction:
) Is that way (https://github.com/user202729/plover/blob/22a1b7c517ab3a3abcc62cd4df556c9f87bac316/plover/config.py#L372-L381) of writing documentation okay? Or is there other problems of not including type hints in code? The only problem I can see is with try:
import typing
except ImportError:
pass works just as well (for both mypy and Sphinx) Using |
Beta Was this translation helpful? Give feedback.
-
Pushed that branch to (unsurprisingly) https://plover2.readthedocs.io/ . Sometimes there are duplication between the existing docstring and the new documentation, in that case I keep the better version. There are some bugs (for instance, how to make this recognized as a type? Or how to change the order of attributes to be not at the top?), but it's readable enough. |
Beta Was this translation helpful? Give feedback.
-
Recently, I've been developing some plugins and in the process, have to figure out what several variables/properties does in Plover code.
Is there any way I can write some documentation for Plover?
There's #1174 -- however the documentation is in separate files and that is prone to having outdated information.
I think the best way is to generate the documentation from docstrings in the code itself, then edit the code to include documentation.
There are already docstrings for several objects/functions already, but they mostly suffer from:
# type: something
can be used.Beta Was this translation helpful? Give feedback.
All reactions