本文介绍了手册页的 SYNOPSIS 部分是否有规范?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一些规范,以便在一个小团队之间共享,并且对我放入一些命令列表的格式有所挑剔.在 SYNOPSIS 中使用的语法是否有任何正式定义手册页的部分?

I'm trying to write some specifications to be shared between a small team and getting picky about the format I put some command listings in. Is there any formal definition of the syntax used in the SYNOPSIS section of man pages?

来自 Wikimedia Commons,这是我正在谈论的 SYNOPSIS 部分的手册页示例,其中列出了命令及其理解的必需和可选参数.

From the Wikimedia Commons, here's an example of a man page with the SYNOPSIS section I'm talking about, where the command is listed with the required and optional arguments it understands.

推荐答案

在任何地方都没有对联机帮助页的正式定义,甚至在 POSIX 标准中也没有.您示例中的 man(1) 手册页非常典型:您写出程序可以使用的各种方式(通常只有一种),其中 [] 表示可选的粗体(或带有 mdoc 宏的打字机字体)表示文字命令行输入,斜体表示变量.

There is no formal definition of a manpage anywhere, not even in the POSIX standard. The man(1) manpage in your example is pretty typical: you write out the various ways a program can be used (often just one) with [] denoting optional, bold (or typewriter font with the mdoc macros) denoting literal command line input and italics denoting variables.

手册页man(7)mdoc(7) 将解释最重要的约定.man(7) 用于旧式 Unix 联机帮助页,并且在 Linux 上仍然很流行(请参阅 man-pages(7));mdoc(7) 来自 4.4BSD 并在其衍生产品中流行.后者保持了更严格的内容和演示分离,并且可以生成(恕我直言)更漂亮的 PDF/HTML 输出

The manpages man(7) and mdoc(7) will explain the most important conventions. man(7) is for old-style Unix manpages and is still popular on Linux (see man-pages(7)); mdoc(7) comes from 4.4BSD and is popular in its derivatives. The latter maintains a stricter separation of content and presentation and can produce (IMHO) prettier PDF/HTML output

这篇关于手册页的 SYNOPSIS 部分是否有规范?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 03:19