编写便携式手册页

问题描述 投票:0回答:1

如果我想编写可在不同类Unix系统之间移植的手册页,我应该使用哪种源语言标准?或者我可以简单地假设GNU troff(groff)随处可用?

man troff
1个回答
0
投票

如果你看一下https://www.troff.org/macros.html,在man下,它列出了两个编写手册页的指南。

一般来说,他们都建议避免使用额外的预处理器,如tblpiceqn,尤其是如果你想要最大化可移植性。

手册页使用an宏包。这是这样做的,当你用-m宏选项调用它时,它显示为troff -man。要查找an宏包定义的宏,您应该查找与tmac.an*(对于UNIX / BSD系统)或an*.tmac(对于Linux系统)匹配的文件。例如,在RHEL / CentOS上它将是:

/usr/share/groff/1.18.1.4/tmac/an.tmac which refers to
/usr/share/groff/1.18.1.4/tmac/andoc.tmac which refers to
/usr/share/groff/1.18.1.4/tmac/an-old.tmac which defines most of the macros

这些文件是groff包的一部分。

© www.soinside.com 2019 - 2024. All rights reserved.