要仅学习 LinuxDoc,请跳到 学习 LinuxDoc。如果您想立即开始写作,您可以尝试一个“填空”模板,它将生成 LinuxDoc 格式的输出。LDP HOWTO 生成器。您可以使用它来开始编写您的 Howto,然后在以后使用 PC 上的文本编辑器完成它。
版权 (c) 2001-7 David S. Lawyer 所有。您可以自由复制和分发(出售或赠送)本文档。您可以创建衍生作品并分发它,前提是您以本许可证的精神授予其许可并给予适当的致谢。作者希望收到您对任何基于本文档的衍生作品的评论、建议和计划。
您是否了解一些关于 Linux 的知识,这些知识目前没有好的免费文档,但对其他人可能有用?即使您对该主题不太了解,如果您渴望、愿意并且有能力学习更多相关知识并有时间这样做,您仍然可以撰写相关内容。您可以使用文字处理器或编辑器清晰地写作吗?您想帮助成千上万的其他人,并让他们免费阅读您写的东西吗?一旦您写完文档,您是否愿意接受读者的电子邮件建议,并有选择地使用这些信息来改进您的 HOWTO?您希望您的作品在全球数百个网站上可用吗?如果您对这些问题的回答都是肯定的,那么我们鼓励您为 Linux 文档项目 (LDP) 撰写一些内容。但请注意,这可能比您预期的花费更多时间。
当已经有“LDP Authoring Guide”(LDP 创作指南)时,我为什么要写这个?好吧,LDP 指南是一项冗长而详细的工作。如果您想快速入门,您需要一些更简单和更短的东西。
感谢 Matt Welsh 提供的 example.sgml 文件,我将其用作示例部分的主要信息来源。
所有 HOWTO 和其他 LDP 文档的版权都归作者所有,因此 LDP 对您的作品没有任何特殊权利。我们只接受具有许可证的文件,该许可证允许任何人复制和分发该文档。我们鼓励作者在其许可证中也允许修改。这样,如果作者停止维护文档,其他人可以接手维护。有关更多详细信息,请参阅我们的宣言。
如果您不确定要写什么,请查看 LDP 的一些文档,包括 Unmaintained HOWTOs(未维护的 HOWTO) 中的文档。选择您感兴趣且需要良好文档的主题。如果您发现已经编写和维护的内容需要改进,请首先尝试联系作者并提出建议。如果您无法联系到作者,请查看许可证,看看您是否被允许修改文档。但即使在您不被允许进行修改和改进的情况下,您也可以从头开始编写一篇关于同一主题的新文档,使用新的大纲和新的信息来源。
我们的 HOWTO 以各种格式向公众发布:纯文本、HTML、PostScript 和 PDF。您只需以一种源格式(DocBook 或 LinuxDoc)编写一个 HOWTO,然后通过计算机将其转换为所有其他格式,而无需以所有这些格式编写相同的 HOWTO。
要了解源格式的外观,请查看网页的源文件(如果您还没有看过)。您会看到各种用 <尖括号> 括起来的单词。这些被称为标签。这些网页(包括标签)都是 html:Hypertext Markup Language(超文本标记语言)。LDP 对其文档使用类似于此的格式。
LDP 使用的标记语言符合 Standard Generalized Markup Language (SGML)(标准通用标记语言) 或 XML 的要求。LDP 现在使用以下两种 SGML 风格:LinuxDoc 和 DocBook,以及 DocBook 风格的 XML。有趣的是,事实证明 html 只是 SGML 的另一种风格(但人们在 html 中使用的一些功能违反了 SGML 规则,因此它不再是纯粹的 SGML 了)。
本迷你 HOWTO 完全是关于使用简单的 LinuxDoc 风格的 SGML。您可以将其称为“LinuxDoc 标记语言”。它可以由计算机转换为 html、纯文本、postscript、pdf 和 DocBook。它比 HTML 或 DocBook 容易得多,您不需要特殊的编辑器,因为它很容易使用您最喜欢的编辑器或文字处理器键入标签(或使用宏来代替)。
在阅读本节之前,最好至少对标记语言中的标签有基本的了解。因此,如果您对此不太了解,您可以先查看 例子 1,了解 LinuxDoc 标记语言。
比较的一种方法是检查 LDP 站点上的真实 HOWTO。单击 DocBook Index(DocBook 索引) 或 LinuxDoc Index(LinuxDoc 索引) 来查找它们。您会注意到 DocBook 文档充斥着标签,而 LinuxDoc 文档的标签要少得多,因此更易于阅读、编写和修改。LDP 上的一些文档的标记比其他文档更清晰,因此您应该至少检查几个文档。
您可能起初认为 DocBook 更高级,因为标签多得多,但这不一定如此。如果您在 LinuxDoc 中创建文档并将其(通过计算机)转换为 DocBook,则 DocBook 版本中将有更多的标签,包括 LinuxDoc 版本中没有的新标签。为什么?因为 LinuxDoc 允许省略标签,而 DocBook 不允许。从这个意义上讲,LinuxDoc 比 DocBook 更灵活和更先进。LinuxDoc 不仅经常允许省略结束标签,如 </title>,而且还允许省略开始和结束标签对。例如,在 LinuxDoc 中,段落通常由空行分隔,而不是段落标签对 <p>(DocBook 中为 <para>),因此很少需要段落标签。另一个例子是在 LinuxDoc 文档的新节开始之后。您只需在 <sect> 标签后键入节的标题,而 DocBook 要求也将标题括在一对 <title> 标签中。
当运行程序将 LinuxDoc 转换为 HTML 等格式时,程序做的第一件事是查找所有省略的标签并将它们添加到文档中。例如,添加一对标签,它们等效于 <sect> 标签后的 <title> 标签对(包括 <sect1> 标签等的情况)。因此,从某种意义上说,LinuxDoc 也有很多标签,但它们对用户是隐藏的,以使文档更易于编写和阅读。在大多数情况下,使用 LinuxDoc 编写文档的作者并不知道大多数缺失标签的存在。作者(在大多数情况下)无需了解它们,因为它们仅在 PC 将 LinuxDoc 转换为其他格式(如 HTML)时才存在于计算机内存(或临时文件)中。好吧,可以保存一个文件来显示添加的标签,但这主要是由程序员调试 LinuxDoc 计算机代码(或像我这样好奇它如何工作的人)完成的。
DocBook 标签通常比等效的 LinuxDoc 标签更长,例如 <em> 而不是 <emphasis>。有关简短比较,请参阅作者的网站 Comparison of DocBook to LinuxDoc(DocBook 与 LinuxDoc 的比较)
然而,在编写 LinuxDoc 时省略许多标签(但软件会找到它们)只是 LinuxDoc 文档标签较少的原因之一。另一个原因是 DocBook 实际上比 LinuxDoc 有更多的标签可以使用。例如,LinuxDoc 只有一个标签用于作者姓名,而 DocBook 有单独的标签用于名字、中间名和姓氏。因此,从这个意义上讲,DocBook 比 LinuxDoc 更强大,但在另一个意义上,它更弱,因为它找不到缺失的标签。解决这个困境的方案是将 LinuxDoc 与 DocBook 合并,以保留各自的优点。DocBook 然后需要放弃其作为“xml”语言的当前状态,因为 xml 禁止省略标签等,而 sgml 允许这样做。
DocBook 中不允许省略标签的一个原因是,它使程序员更容易编写软件来解析它并将其转换为其他格式。无需软件能够查找和添加缺失的标签。但是,使程序员更容易,却使必须使用 DocBook 的数量更大的作者更困难。
有一些特殊的编辑器或文字处理器,如 Lyx 和 Bluefish,使键入 DocBook 文档更容易。例如,Bluefish 会自动添加结束标签。但对于不想学习新编辑器或文字处理器的人来说,LinuxDoc 要容易得多,因为可以手动键入标签或创建一组宏来插入 <emphasis> 标签。我使用 vim 编辑器,如果我键入 ;s,它会插入 <sect1> 标签。;r 执行 <sect>,;i 执行 <item> 等。对于文档前几行的标题标签,我只是从另一个文档中复制它们并更改标签后的单词。当然,我不需要更改作者的姓名或电子邮件。因此,LinuxDoc 的一个主要优点是,可以轻松地将其与他们当前使用和熟悉的编辑器或文字处理器一起使用。
一些不了解情况的人主张通过仅使用 DocBook 标签的子集来使 DocBook 像 LinuxDoc 一样容易。这行不通,因为由于 DocBook 不允许任何省略标签的要求,DocBook 仍然需要几倍的标签才能获得相同的结果。
尽管 LinuxDoc 具有优势,但使用 DocBook 的人数大大超过使用 LinuxDoc 的人数,部分原因是 Linuxdoc 受到了图书出版商的推广。Reuben Thomas 编写了一个程序 (ld2db),可以将 LinuxDoc 文档转换为 DocBook。它并不完美,您可能需要进行一些手动编辑。LDP 也会在您提交后自动将 LinuxDoc HOWTO 转换为 DocBook。如果有一个程序可以自动将 DocBook 文档转换为 LinuxDoc,以便使用更简单的 LinuxDoc 标记语言的人可以修改它们,那就太好了。
LinuxDoc 比 DocBook 容易学习得多。但是,您在 LinuxDoc 中学到的大部分知识对于 DocBook 也很有用。因此,如果您最终决定使用 DocBook,那么在学习 LinuxDoc 上花费的大部分精力都不会浪费。
学习它的一种方法是通过示例。我编写了 3 个示例文件,从简单到中级不等。这些文件的内容已复制到本 Howto 中。要将它们变成单独的文件,您可以剪切它们(从第一个标签开始)并将它们写入文件。然后您可以尝试使用 sgml2txt --pass="-P-cbou" some-example.sgml 将其中一个转换为文本,看看它是什么样子。确保 sgml 文件名以 .sgml 结尾。
如果您想查看一些真实的示例,您可以直接访问 LDP 镜像站点,找到 HOWTO 并选择 LinuxDoc SGML。或者直接访问主站点:Howto Index (linuxdoc)(Howto 索引 (linuxdoc)) 现在是第一个简单示例。
<!doctype linuxdoc system>
<article>
<title>First Example (example1)
<author>David S.Lawyer
<sect> Introduction
<p> This is a very simple example of "source" for the LinuxDoc text
formatting system. This paragraph begins with a paragraph tag (a "p"
enclosed in angle brackets). Notice that there are other tags, also
enclosed in angle brackets. If you don't see any tags, then you are
reading a converted file so find the source file: example1.sgml (which
contains the tags).
This is the next paragraph. Note that it is separated from the above
paragraph by just a blank line. Thus it needs no "p" tag in front of
it. The "p" tag is only needed for the first paragraph of a section
(just after the sect-tag). The file suffix: sgml stands for Standard
Generalized Markup Language. You are now reading the LinuxDoc flavor
of sgml as specified in the very first line of this file.
<sect> Tags
<p> Tags are words inside angle brackets. The "sect" tag above
marks the start of a new section of this example document.
"Introduction" was the first section and you are now reading the
second section titled "Tags". If this were a long document (like a
book), a section would correspond to a chapter.
Note that there are "article", "title" and "author" tags at the start
of this article. At the end of this article is an "/article" tag
marking the end of this article. Thus there is a pair of "article"
tags, the first being the start tag and the second being the end tag.
Thus this entire article is enclosed in a pair of "article" tags. In
later examples you'll see that there are other tags that come in pairs
like this. They affect whatever is between the pairs (start tag and
end tag). Any tag name which has "/" just before it is an "end tag".
When this source code is converted to another format (such as plain
text using the program sgml2txt) the tags are removed. Tags only help
the sgml2txt program make the conversion. There are more tags to
learn. So once you understand this example1, please go on to the next
example: example2. You don't need to actually memorize the tags, as
they will be repeated (but with little or no explanation) in later
examples.
</article>
<!-- This is a comment. It's ignored when this source file gets
converted to other formats. -->
<!-- The tag below says that this file is in LinuxDoc format -->
<!doctype linuxdoc system>
<article>
<title>Second Example (example2)
<author>David S. Lawyer
<date>v1.0, July 2000
<abstract>
This is the abstract. This document is the second example of using
the Linuxdoc-SGML flavor of sgml. It's more complex than the first
example (example1.sgml) but simpler than the third example
(example3.sgml). After you digest this you'll be able to write a
simple HOWTO using LinuxDoc. End of the abstract.
</abstract>
<!-- The "toc" = Table of Contents. It will be created here. -->
<toc>
<!-- Begin the main part of the article (or document) here. The part
above this is sort of a long header. -->
<sect>This Second Example (example2.sgml)
<p>Unless you're familiar with markup languages, you should first
read example1.sgml. You may want to run these example files thru a
translator such as sgml2txt to convert them to text and notice how the
result looks different than this "source" document with all its tags.
<sect>Article Layout
<sect1> Document Body
<p> After the header comes the body of the document, consisting of
nested sections marked by sect-tags. Subsections are
marked by sect1-tags. Since this is the first subsection
within the 2nd main section, it's becomes section 2.1. Within a
subsection marked by sect1 there may be sub-subsections like
sect2. There are even tags like sect3, sect4, etc., but you are
unlikely to need them. Note the the real tags must be enclosed in
angle brackets < and >.
<sect2> This is a sub-sub-section
<p>
It's 2.1.1. Note that a "p" tag may be on a line by itself. This
doesn't change a thing in the resulting documents.
<sect1>Document Header
<p> One way to create a header part is just to copy one from another
.sgml file. Then replace everything except the tags with the correct
info for your document. This is like using a "template".
<sect> More Features in example3
<p> With the tags in this example2 you can write a simple short document
a few pages long. But for longer documents or for other important
features such as putting links into documents, you need to study the
next example: example3. It will also show you how to create lists and
fonts.
</article>
<!doctype linuxdoc system>
<!-- Note the mailto: after my name. This allows the reader of html
format to click on my email address to send me email -->
<article>
<title>Third Example (example3)
<author>David S. Lawyer <url url="mailto:dave@lafn.org">
<date>v1.0, July 2000
<abstract>
This document is the third example of using the LinuxDoc flavor of sgml.
It's more complex than the second example.
</abstract>
<!-- Comment: toc = Table of Contents -->
<toc>
<sect> Fonts
<p>
While they will not show up in a plain text output, they will work
for other conversions.
<bf>boldface font</bf> <em>emphasis font</em> <sf>sans serif</sf>
<sl>slanted font</sl> <tt>typewriter font</tt> <it>italics font</it>
There's another way to get these same fonts by enclosing the text in
slashes like this: <bf/boldface font/ <em/emphasis font/
<sf/sans serif/ <sl/slanted font/ <tt/typewriter font/
<it/italics font/ Note that DocBook doesn't have font tags so it may
be best not to use fonts if you plan to convert to DocBook.
<sect> Links <label id="links_">
<p> You may create links (something that html browsers may click on to
go somewhere else). They might just go to another part of this
document (cross-references) such as to the "label" above, or they
could go to a website on the Internet.
<sect1> Cross-References
<p> If you click on <ref id="links_" name="Links"> you will be taken to
the start of the "Links" section above (which is labeled links_).
The label id may be any word you choose but it's a good idea to avoid
common words so that you can search for unique labels using your
editor. That's why I use links_ (with the underline). The name of
this link will be shown (in html format) as the name to click on.
This name (Links) will also be present in the text rendition.
<sect1> URL Links
<p> If you click on <url url="http://www.tldp.org"> you will get
to the Linux Documentation Project website. The next link adds a name
which people will click on: <url url="http://www.tldp.org"
name="Linux Documentation Project">. Using this second method, you may
not even need to explain where the link leads to since it's obvious by
the name.
<sect> Prohibited Characters
<p> Any word you type between angle brackets will be interpreted as a
tag. But what if you want to display a tag in a document? For this
you use a code word for the angle characters.
You may use < for < and > for >. lt = Less Than, gt =
Greater Than. For example, here's a p-tag: <p>. Of
course it doesn't actually start any paragraph, but it will appear in
the converted document as <p>. These codes all start with an &
character. The ; after the lt is to separate it. It's not needed if
there is a space after it. For example: 3 < 4. Actually, if
you knew that its OK to use an unpaired > then you could have written
<p> as <p>. This will not be mistakenly recognized as a tag
since there is no opening <. Actually 3 < 4 works fine too.
There are other characters that you can't put into the document text
directly. For & in an AT modem command use: AT&. If other
characters cause you trouble (they seldom will) see <ref id="ch_codes"
name="Character Codes (macros)"> or the "guide" that comes with
linuxdoc-tools or sgml-tools.
<sect> Verbatim, Code & Newline
<sect1> Verbatim
<p> If you want to insure that it will look exactly like you typed it
after it's converted to other formats, use verbatim (verb). This is
useful for creating tables, etc. But some things still get recognized
as markup even though they are between verbatim tags. This includes
the macros starting with & and end tags with /.
<tscreen><verb>
% sgml2txt --pass="-P-cbou" example.sgml
</verb></tscreen>
The "tscreen" sets the font to typewriter and indents it nicely.
<sect1> Code
<p> This encloses computer code between two dashed lines.
<tscreen><code>
Put computer source code here
</code></tscreen>
<sect1> Newline
<p> To force a newline use <newline>
This sentence always starts at the left margin.
<sect>Lists
<p>
This puts items into a list with a bullet at the start of each item.
They start with the "itemize" tag.
<itemize>
<item> This is the first item in a list.
<item> This is the second item
<itemize>
<item> Multiple levels (nesting) are supported.
<item> The second item in this sublist
</itemize>
<enum>
<item> Enumerated lists using <tt/enum/ also work.
<item> This is item number 2
</enum>
<item> The final item in the main list
</itemize>
</article>
<!doctype linuxdoc system>
<article>
<title>Quick Reference Sheet
<author>David S. Lawyer
<date>v1.0, July 2000
<abstract> abstract here </abstract>
<toc> <!-- Comment: toc = Table of Contents -->
<sect> Chapter 1 Note: Put a <p> on the first line of
<sect1> Subsection 1.1 each section (or subsection, etc.)
<sect1> Subsection 1.2
<sect> Chapter 2 Choose title names to replace "Chapter"
<sect1> Subsection 2.1 "Subsection", etc.
<sect2> Sub-subsection 2.1.1
<sect2> Sub-subsection 2.1.2
<sect1> Subsection 2.2
</article>
有两种方法可以获取这些
<bf>boldface font</bf> <em>emphasis font</em> <sf>sans serif font</sf> <sl>slanted font</sl> <tt>typewriter font</tt> <it>italics font</it> <bf/boldface/ <em/emphasis/ <sf/sans serif/ <sl/slanted/ <tt/typewriter/ <it/italics/
Ordinary unnumbered list: Numbered list:
<itemize> <enum>
<item> First item <item> First item
<item> Second item <item> Second item
<item> etc. <item> etc.
</itemize> </enum>
Cross-References: An Email Link:
<ref id="links_" name="Links"> <url url="mailto:bob@tldp.org">
To force a newline <newline>
<tscreen><verb>
<url url="http://www.tldp.org">
<url url="http://www.tldp.org" name="Linux Documentation Project">.
</verb></tscreen>
您并不总是需要使用这些。
&
,<
,>
,</
) 使用 &etago;
这些是可选的,我很少使用它们。
``
和 ''
­
(即,指示这是一个断开长单词以插入连字符以进行水平对齐的好位置)。仅当 LinuxDoc 抱怨它或无法在格式化文档中生成它们时才使用这些。我很少需要使用它们。
$
,#
,%
,˜
,&dquot;
。您可以在没有任何 LinuxDoc 软件的情况下编写 LinuxDoc 文档。但是,它很可能包含一些标签(或其用法)错误,因此它将被退回给您进行更正。即使没有错误,结果看起来也可能不太正确。因此,您最好拥有该软件,以便在您的计算机上转换源代码。
Linux 的 Debian 发行版有一个 linuxdoc-tools 软件包。非 Debian 发行版也有一个 rpm 软件包。它以前被称为 sgml-tools。不要使用 sgmltools-2 软件包,它主要用于 DocBook-sgml。
要使用 linuxdoc-tools,您需要在 *.sgml 文件上运行转换器程序。例如,对于 0.9.21-0.8 之后的版本,要获得文本输出,请键入:“sgml2txt -f --blanks=1 my-HOWTO.sgml”。对于早期版本,由于一个错误,您必须用 --pass="-P-cbou" 替换 -f。(如果有兴趣,请参阅 文本输出中转义序列的旧问题 以获取有关此错误的更多信息。)要获得 html 输出,请键入:“sgml2html my-HOWTO.sgml”。如果它显示错误,它将显示错误在源文件中的行号和列号。键入“man -k sgml”应该会显示许多其他程序以及每个程序的一行描述,但并非所有程序都用于 linuxdoc-sgml。
一个主要错误是在节标题后忘记放置 <p> 标签。然后节标题就没有结尾,所有后续段落都成为节标题的一部分并进入目录。应该改进 Linuxdoc 以发现此错误。要手动发现它,请查看 html 或文本格式的目录。修复它只需要添加缺少的 p 标签。
当您运行 linuxdoc 程序(例如 sgml2html 或 sgml2txt)时,您可能会看到一些错误消息。您需要编辑您的文档并修复错误。
省略结束引号是一个常见错误。如果您收到的错误消息没有任何意义,并且注意到错误位置附近有一些引号 (" ") 是正常的,那么很可能是您之前键入了一个开始引号但没有结束引号。例如:<.... id="my home page >,因此 linuxdoc 认为下一个引号(可能在缺少引号的位置之后很多段)是结束引号。然后在错误的结束引号之后,它期望找到一个 > 来完成标签,但没有找到。要查找和修复缺失的引号,只需向后搜索“”。
一个错误可能会导致大量错误消息。在上面的例子中,许多标签可能在不应该在任何引号内的错误引号内。因此,linuxdoc 将找不到这些标签。因此,它将不知道某个标签是打开的,如果它找到一个结束标签,它会告诉您该标签未打开。例如,如果 <itemize> 标签被遗漏,那么 <item> 标签对于 linuxdoc 来说可能没有任何意义,并且它会为在错误的结束引号之后找到的每个此类标签报告一个错误。
您应该知道的一件事是标签名称不区分大小写,因此错误消息将以大写字母(大写字母)显示标签名称,即使您以小写字母键入它们。
要更好地理解错误消息,需要了解 sgml 上的术语,除非您遇到似乎无法修复的错误并且不理解错误消息,否则您实际上不需要学习这些术语。以下部分是关于此类术语的。
除非您遇到问题或者您对 sgml 和 linuxdoc 的工作原理感到好奇,否则您真的不需要阅读本节。错误消息可能包含诸如“元素”、“实体”、“属性”、“字面量”和“分隔符”之类的词。LinuxDoc 的“数据类型定义”(或 dtd)中为 linuxdoc 定义了各种元素、实体和属性。dtd 没有用句子定义它们,而是使用相当神秘的格式来定义它们的语法(但不是它们的语义)。
“元素”类似于标签。但它是一个更广泛的概念。元素不仅存在于 linuxdoc 中,而且存在于所有 sgml 语言(如 html)中。您的整个文档被划分为元素。但元素是嵌套的,也就是说,某些元素可能出现在其他元素中。如果您对文档使用 <article> 标签,那么除了第一个标签(说明接下来的是 linuxdoc)之外,整个文档都是 <article> 元素。在这个 article 元素中嵌套了许多其他元素。
例如,每个段落都是一个元素,即使段落之间通过空行而不是标签分隔。但是,每个段落周围都有一个隐式标签,并且解析 linuxdoc 写作的软件实际上会插入这些缺失的标签。它还会插入结束标签(闭合标签),您不需要编写任何结束标签。通过这种方式,linuxdoc 为您节省了大量时间。因此,一个元素将由一个开始标签和结束标签(对于这个开始标签)以及它们之间的所有内容(通常包括其他元素及其标签)组成。请注意,标签被省略了,但它们仍然隐式存在。在某些情况下,标签不包含任何内容,例如指向 Internet 的链接的 url 标签。此类标签本身就是元素。在 article 元素中,可以找到以 <sect> 开头的 sect 元素(节)。然后在 sect 元素中,通常可以找到 sect1 元素(小节)等。
在极少数情况下,元素会发生,但开始和结束标签的使用都是可选的。因此,即使您的文档中没有此类标签,它们应该包含的文档部分仍然是缺失标签的元素。
实体就像宏定义。例如,可以定义名称“list”来表示各种类型的列表。然后,此名称列表仅在 dtd 中使用,例如,指定列表可能出现在段落中。它只是 dtd 编写者的简写。这种类型的实体永远不会在 linuxdoc 文档中使用。但是还有另一种类型的实体可以在文档内部使用,它定义了一个特殊字符,例如 amp;etago 代表 </(结束标签打开)。当您想例如将 </article> 放在句子中间以解释其含义时,您可以使用它,以便转换 LinuxDoc 的软件不会认为它真的在文章的末尾。
“字面量”是事物的名称,例如在 html 链接中单击的名称。它可能是一个或多个单词长。分隔符是将事物与另一事物分隔开来的东西。对于“引号”,“"”是最后一个结束分隔符。因此,对于 name="my website",字面量是“my website”,而此字面量的分隔符是两个“标记,第一个“是开始分隔符,第二个“是结束分隔符。因此,如果“字面量缺少结束分隔符,则意味着您忽略在名称后放置结束“。
首先访问 www.en.tldp.org 加入讨论列表,并将您的提案提交到此列表。如果您要接管一个未维护的 HOWTO,请联系前作者。这可能是版权许可要求的,但即使没有要求,您也应该出于礼貌这样做。
这些主要来自 Tim Bynum(前 HOWTO 协调员)。
在您编写完 HOWTO 后,将 SGML 源代码通过电子邮件发送至 submit@tldp.org。然后您需要做的就是通过将定期更新提交到您用于第一个版本的同一电子邮件来保持 HOWTO 的最新状态。
有一个 HOWTO:Linuxdoc-Reference,它比这个迷你 HOWTO 更详细地介绍了它。
在 0.9.21-0.8 版本之前,文本输出的情况下存在一个错误。对于 sgml2txt,需要 --pass="-P-cbou" 选项才能获得纯文本输出,因为否则如果您使用 -f 选项,您会得到文本输出,该输出通过使用转义序列和重叠打印来强调单词和字母。重叠打印制作的项目符号的一个例子是 +^Ho,它在打印机上会键入 +,然后退格 (^H),然后在现有的 + 上键入 o。这似乎不适用于显示终端(它们无法重叠打印)。请注意,即使您拥有最新版本,如果您未能使用 -f 选项,您仍然会获得这种不需要的输出。
如果您感兴趣,`--pass` 参数会将 `-P-cbou` 选项传递给 `groff` 程序(该程序被 `sgml2txt` 使用),并且 `groff` 程序的 `-P` 选项会将 `-cbou` 选项传递给 `grotty`(`groff` 的后处理器),从而迫使 `grotty` 生成纯文本输出。请参阅 `grotty` 的 man page。简而言之:`-c` 选项避免转义序列,但允许叠印;而 `-bou` 选项在 `-c` 选项被使用时禁止叠印。结果是输出中没有叠印,也没有转义序列。`-b` 选项禁止叠印以使字符显示为粗体;`-u` 选项禁止叠印以实现下划线;而 `-o` 选项禁止其他类型的叠印,例如上面的项目符号示例。消除叠印的另一种方法是与 `sgml2txt` 一起使用 `-f` 选项,但是您仍然需要将 `-c` 选项传递给 `grotty` 以消除转义序列,除非您使用的是较新版本。
这真是太麻烦了!默认设置应该最好是纯文本,这样就不需要所有这些选项传递操作了。我最终促成了他们修复这个问题,因此大约在 2007 年年中之后,您只需使用 `-f` 选项,而无需 `--pass="-P-cbou"` 了。如果您在输出文件中遇到这些转义序列和叠印,但在使用 Linux "cat" 命令显示文本时,显示效果很好。但是,如果在文本输出文件中使用分页器或编辑器,通常会导致转义字符被错误地解析,因此您会在文本中看到许多不必要的字符,而这些字符本应是转义序列的一部分。在某些情况下,分页器可以正确显示某些叠印效果,但编辑器(例如 vim)则不行。因此,消除所有叠印使您可以使用任何编辑器或分页器来读取文本。