2012-07-06 33 views
3

我有一个用Python编写的命令行程序。我想用Sphinx生成手册页。如何生成多个手册页?

我想通过命令有一个页面,如:

man myprog foo - >重定向到foo命令的手册页。

man myprog foo2 - >重定向到foo2命令的手册页。

问题是狮身人面像所有手册页的聚集产生唯一一个手册页。

我如何获得预期的结果?

回答

0

鉴于结构

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

然后,如果你在文档键入

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

可以自动化,通过任一修补生成文件或在bash一个一个衬里

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

(未经测试但应该接近)

提防包括路径,亲属,交叉引用....

这可能会限制你可以在Rst的做

+0

谢谢您的回答。我不明白man/other_man的说法。这是什么 ? – 2012-07-06 12:39:48

+0

只是一种使用每个独立手册来构建目录的方法。该结构将更加人/子主题,其中,子主题处理给定主题的所有相关文件。 – user1458574 2012-09-10 15:05:32