4

I have a command line program written in Python. I would like to generate man pages with Sphinx.

I would like to have one page by commands like:

man myprog foo --> redirect to the man page of the foo command.

man myprog foo2 --> redirect to the man page of the foo2 command.

etc.

The problem is Sphinx generates only one man page with the aggregation of all man pages.

How can I have my expected result?

Chris
  • 44,602
  • 16
  • 137
  • 156
Sandro Munda
  • 39,921
  • 24
  • 98
  • 123

1 Answers1

1

Given the structure

    docs/
    docs/source
    docs/source/conf.py
    docs/source/manable1/includable.rst
    docs/source/index.rst

Then, if you are in docs type

    sphinx-build -b man -c source  source/manable1/ man/other_man

you can automate that by either patching the makefile or a one liner in bash

    for i in source/man*; do
            sphinx-build -b man -c source  $i man/$( basename $i );
    done

(not tested but should be close)

beware the include path, the relatives, the cross reference....

It might limit what you can do in Rst

user1458574
  • 151
  • 1
  • 2
  • Thanks for your answer. I don't understand the man/other_man argument. What it is ? – Sandro Munda Jul 06 '12 at 12:39
  • just a way to structure your directory with each independant manual. the structure would be much more man/sub_topic where sub topic handles all the revelant files for a given topic. – user1458574 Sep 10 '12 at 15:05