Generating python CLI man page

前端 未结 3 1196
我寻月下人不归
我寻月下人不归 2020-12-30 07:46

I am developing a python CLI tool (using optparse in python2.6, but hope to switch soon to python2.7) and I am about to write the man page. I have some experience on generat

3条回答
  •  抹茶落季
    2020-12-30 08:15

    The usual way to generate documentation in Python is to use Sphinx. For example, that's what's used in the official Python documentation. Once you have a Sphinx documentation project set up (see this tutorial), you can generate man pages from your Sphinx documentation files via make man. You should also alter the configuration in conf.py to produce appropriate output.

    (It's worth noting that while Sphinx is the usual tool for writing documentation in Python, that doesn't mean it's the usual tool for generating man pages. Use what you want!)

提交回复
热议问题