23

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?

4
  • Sphinx is definitely it, although it uses restructuredText rather than Markdown. For Markdown, there is mkdocs, but that doesn't support docstrings. Although, I did start this experiment (which may be a bad idea): github.com/waylan/mddoc Commented Apr 15, 2015 at 23:40
  • I had the same problem (readme.md) and I do not believe there is a nice answer. I tried mkdocs —just polluted my folder— and pydoc_markdown, the top Google hit, which gave a fraction of the text pydoc gave. In the end I simply got the pydoc output and did a three or four search and replaced a few items. Commented Mar 25, 2016 at 14:35
  • We've noticed that the Github per-repo wikis aren't tied to the main repo commits, meaning that if you want accurate per-commit documentation (so that any commit checked out has the right doc for it), the per-repo wiki is useless. Commented Aug 8, 2016 at 8:39
  • Is it possible to show some minimal example of what you start with and the md you want to finish with? Commented Nov 18, 2020 at 23:52

2 Answers 2

1

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

Like this:

pydoc example_lib > example_lib.md .
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.