Show HN: Pdoc, a lightweight Python API documentation generator
pdoc.dev
pdoc.dev
Some questions:
- is it possible to include a folder with md files in the output? similar to what mkdoc does. - any plans to suppport `##` or `# #` (for pep8) similar to rust's `///`?
Thanks!
Not yet, but integrating your API documentation into the rest of your website/docs is definitely something that I have on the radar. I'm not sure what this will look like eventually. :-) If you have specific ideas, please do open an issue on GitHub for some brainstorming!
> any plans to suppport `##` or `# #` (for pep8) similar to rust's `///`?
Unlikely. To generate documentation, we introspect the loaded module and also walk the abstract syntax tree. Python's builtin AST does not include comments, so there's no easy way for us to access them. Honestly, I think the """docstrings""" convention is reasonable enough and widely adopted in the Python ecosystem. Is that missing any use cases?
I think that Sphinx and mkdocs are the two most popular docs systems for Python, and Sphinx can build its own API docs, so a closer integration into mkdocs might be worth looking into. Mkdocs has a plugin system now that you can hook in to
[0] https://github.com/timothycrosley/pdocs
[1] https://github.com/timothycrosley/pdocs/#differences-between...
Regarding the comparion to pdocs:
- We only support HTML output at the moment, pdocs does support Markdown.
- Type annotations are now a first class citizen in pdoc, including string forward references.
- 3.8 is a requirement for pdoc, but you can use it to document 3.5 code.
- pdoc now uses tox, mypy, flake8, GitHub Actions... and has 100% test coverage :)
- and we also have a Python API: https://pdoc.dev/docs/pdoc.html#pdoc
Overall, I think we try to be a bit simpler compared to pdocs. For example, we use argparse instead of hug to not introduce additional dependencies, and we really focus on the "generate standalone documentation" use case. That being said, I can recommend pdocs just as well. :)Example API docs from pdocs, rendered in mkdocs: https://cogeotiff.github.io/rio-tiler/api/rio_tiler/io/cogeo...
Though I have to say your HTML output looks quite nice.
Did I just overlook something?
If the tool really does expect connectivity, any plans to inline these resources so pdoc can be fully capable of running on an offline system?
It's so much easier to setup and get going with than Sphinx that it seems a real shame to have to be online.
You were probably using pdoc3, a hostile fork. See my other post. :(