简体   繁体   中英

Automatically Generate GitHub Wiki Documentation from Python Docstrings

The title says it all. What I imagine is to have docstrings for all of my modules, classes and functions and somehow nicely navigate the doc via github (wiki?). Also, the doc should be in sync with latest code meaning it should be updated/re-generated on push. Is that possible?

Just pipe the output of the docstring to a .md file.

Like this:

pydoc 'example_lib > example_lib.md .

Pydoc doesn't generate markdown, it generates an ad-hoc text markup that only occasionally by luck matches markdown. You would need to have an ad-hoc text to markdown converter, which will fail a lot, same as using the raw ad-hoc text as if it already were markdown.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM