我有一个用 Python 编写的命令行程序。我想用 Sphinx 生成手册页。
我想通过如下命令获得一页:
man myprog foo
--> 重定向到 foo
命令的手册页。
man myprog foo2
--> 重定向到 foo2
命令的手册页。
等等
问题是 Sphinx 仅生成一个 手册页,其中包含所有手册页的聚合。
我怎样才能得到我预期的结果?
给定结构
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
您可以通过修补 makefile 或 bash 中的一个衬垫来自动执行此操作
for i in source/man*; do
sphinx-build -b man -c source $i man/$( basename $i );
done
(未测试但应该接近)
注意包含路径、亲属、交叉引用....
它可能会限制您在 Rst 中可以做的事情
我是一名优秀的程序员,十分优秀!