【发布时间】:2020-04-28 23:21:10
【问题描述】:
我有一个 troff 格式的文件,想重铸到手册页
文件.txt:
.. c:function:: bool is_module_percpu_address (unsigned long addr)
test whether address is from module static percpu
**Parameters**
``unsigned long addr``
address to test
**Description**
Test whether **addr** belongs to module static percpu area.
**Return**
``true`` if **addr** is from module static percpu area
.. c:function:: int module_refcount (struct module * mod)
return the refcount or -1 if unloading
**Parameters**
``struct module * mod``
the module we're checking
**Return**
-1 if the module is in the process of unloading
otherwise the number of references in the kernel to the module
当我做groff file.txt | man -l - 时,我不太了解 groff 的输出。
如您所见,我从未做过手册页,只是想使用 troff 格式并使其成为可读的手册页。
怎么做?
PS:输出来自提供的源代码树中的 perl 脚本kernel-doc。我确实知道它是否是 troff 格式,但脚本是这样说的 (Output troff manual page format)
【问题讨论】:
-
仔细阅读您的
man troff。我很确定曾经有一个--man选项(或类似选项)。祝你好运。 -
您显示的输出是某种形式的 markdown 格式,可能是 reStructuredText。您需要寻找更多的脚本来处理这个问题,也许是
sphinx,然后才能将它传递给 groff。
标签: shell document manpage troff