Giampaolo Rodolà
Giampaolo Rodolà

Reputation: 13076

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?

Upvotes: 23

Views: 6999

Answers (2)

MatthewMartin
MatthewMartin

Reputation: 33193

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.

Upvotes: 0

Kevin Gray
Kevin Gray

Reputation: 29

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

Like this:

pydoc example_lib > example_lib.md .

Upvotes: 1

Related Questions