Search code examples
pythondocumentation-generationmanpagepydoc

Can pydoc be used to generate manpages?


I have a set of python scripts that I would like to create manpages for. They are documented with docstrings, so I can get at the documentation that way, but I would also like to have manpages.

Is there a way to use pydoc to generate *roff sources for manpages?

edit: Something like perl's pod2man for python.


Solution

  • pydoc is not generating manpages, just showing docs in a form of man page:

    ...in a style similar to the manual pages shown by the Unix man command...

    You can save it by:

    pydoc sys >sys-docs.txt
    

    or with terminal "colours" (use less to render them):

    PAGER="cat>sys-docs.txt" pydoc sys