Sandro Munda
Sandro Munda

Reputation: 41078

How to generate multiple man pages?

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?

Upvotes: 4

Views: 867

Answers (1)

user1458574
user1458574

Reputation: 161

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

Upvotes: 1

Related Questions