gpt4 book ai didi

python - 如何生成多个手册页?

转载 作者:太空宇宙 更新时间:2023-11-03 12:09:28 25 4
gpt4 key购买 nike

我有一个用 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 中可以做的事情

关于python - 如何生成多个手册页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11360797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com