Closed WhyNotHugo closed 4 years ago
I think you have the wrong project. sphinx-click doesn't do anything special for man pages. You're looking for either click-man or Sphinx itself.
Sphinx itself generates man pages based on rst, and I'm using the directive in sphinx-click
:
.. click:: todoman.cli:cli
:prog: todo
:show-nested:
Gotcha. What I'm saying is that sphinx-click doesn't do anything special for that builder. It generates the same rST output regardless of builder and Sphinx converts this to the required output format. We could special case the man builder to generate a different heading, but we don't do this currently and, given click-man exists, I don't think we need to.
click-man
is a no-go for me since our docs are already written in sphinx, an I want to re-use between the html and man versions as much as possible.
I'll try and figure out how to work around using sphinx-click :)
Okay. The best option I can think of aside from checking the builder configured at runtime is to allow the output to be templated, ideally using jinja2. Currently that's all generated by hand, so the conversion should be possible, albeit potentially laborious. I'd be happy to accept either approach given sufficient tests, but it's not high enough priority to work on myself, unfortunately.
The name of my program is misaligned by being further indented than it should be. E.g.:
Note than
todo [OPTIONS
is further right than it should be. For comparison,man(1)
:Also, rather than
TODO
, this should saySYNOPSIS
.