diff options
author | Yuan Yijun <bbbush.yuan@gmail.com> | 2005-12-09 15:28:54 +0000 |
---|---|---|
committer | Yuan Yijun <bbbush.yuan@gmail.com> | 2005-12-09 15:28:54 +0000 |
commit | 770e67eac5f36ae100306a21672c8c9ed90b2681 (patch) | |
tree | 3576e110b3374a8bf7fe5c6e1fa8d42c7e1d10d2 | |
parent | f7e5642cf4f7d306a805eb251f01547a4112f362 (diff) | |
download | documentation-guide-770e67eac5f36ae100306a21672c8c9ed90b2681.tar.gz documentation-guide-770e67eac5f36ae100306a21672c8c9ed90b2681.tar.xz documentation-guide-770e67eac5f36ae100306a21672c8c9ed90b2681.zip |
*** empty log message ***
-rw-r--r-- | acknowledgments-zh_CN.xml | 10 | ||||
-rw-r--r-- | docs-converting-zh_CN.xml | 9 | ||||
-rw-r--r-- | docs-emacs-nxml-zh_CN.xml | 123 | ||||
-rw-r--r-- | docs-emacs-zh_CN.xml | 533 | ||||
-rw-r--r-- | docs-getting-files-zh_CN.xml | 46 | ||||
-rw-r--r-- | docs-intro-zh_CN.xml | 24 | ||||
-rw-r--r-- | docs-rh-guidelines-zh_CN.xml | 415 | ||||
-rw-r--r-- | docs-style-zh_CN.xml | 1047 | ||||
-rw-r--r-- | docs-tutorial-zh_CN.xml | 72 | ||||
-rw-r--r-- | docs-vim-zh_CN.xml | 87 | ||||
-rw-r--r-- | docs-xml-tags-zh_CN.xml | 1615 | ||||
-rw-r--r-- | documentation-guide-zh_CN.xml | 46 |
12 files changed, 4027 insertions, 0 deletions
diff --git a/acknowledgments-zh_CN.xml b/acknowledgments-zh_CN.xml new file mode 100644 index 0000000..db0c7bc --- /dev/null +++ b/acknowledgments-zh_CN.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<chapter id="acknowledgments"> + <title>致谢</title> + <para>本文档基于 Tammy Fox (tfox at redhat.com) 起草的一篇文档,并得到了 Sandra Moore (smoore at redhat.com) 和 Johnray Fuller (jrfuller at redhat.com) 的协助。</para> + <para>Roozbeh Pournader (roozbeh at sharif.edu) 的补丁已被合并,修正了一些拼写错误,解释了匿名 CVS 访问时禁止提交的情况。</para> + <para>Gavin Henry (ghenry at suretecsystems.com) 的补丁已被合并,向 <filename>docs-xml-tags.xml</filename> 中的 <command>figure</command> 标记范例添加尾部斜线,以及添加 <xref linkend="ch-emacs-nxml"/>。</para> + <para>Joshua Daniel Franklin (joshuadfranklin at yahoo.com) 的补丁已被合并,添加 <xref linkend="ch-vim"/>。</para> + <para>Karsten Wade (kwade at redhat.com) 的补丁已被合并,添加 <xref linkend="s1-screenshots"/>。它为 Paul W. Frields (stickstr5 at hotmail.com) 编辑。</para> + <para>Paul W. Frields (stickstr5 at hotmail.com) 的补丁已被合并,向 <xref linkend="s1-xml-tags-screen"/> 中的 <command>screen</command> 标记集合添加更多解释。</para> +</chapter> diff --git a/docs-converting-zh_CN.xml b/docs-converting-zh_CN.xml new file mode 100644 index 0000000..dc06576 --- /dev/null +++ b/docs-converting-zh_CN.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: docs-converting-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --><chapter id="ch-converting"> + <title>生成 HTML 及 PDF</title> + <para>每个包含文档的目录都有一个 Makefile。在这个目录下,运行命令 <command>make html</command> 来生成 HTML 版本,运行 <command>make pdf</command> 来生成 PDF 版本。</para> + <warning> + <title>警告</title> + <para>PDF 的生成仍然不完善,可能无法工作。</para> + </warning> +</chapter> diff --git a/docs-emacs-nxml-zh_CN.xml b/docs-emacs-nxml-zh_CN.xml new file mode 100644 index 0000000..071201b --- /dev/null +++ b/docs-emacs-nxml-zh_CN.xml @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<chapter id="ch-emacs-nxml"> + <title>Emacs 与 nXML 模式</title> + <indexterm> + <primary>nXML</primary> + </indexterm> + <indexterm> + <primary>Emacs</primary> + </indexterm> + <indexterm> + <primary>Emacs</primary> + <secondary>nXML 模式</secondary> + </indexterm> + <para>您可以使用 <application>Emacs</application> 的 nXML 模式,使撰写 DocBook XML 格式更加简单。nXML 模式提供了上下文敏感的编辑模式,包括补全、实时的有效性检测、语法高亮和缩进。为此您只要安装一个 RPM 软件包!</para> + <note> + <title>开发早期</title> + <para>需要注意的是,<application>Emacs</application> 的 nXML 模式尚不完善,因此在编辑一些文档时,高级用户可能会注意到一些问题。如果您略微关注一下邮件列表,就可以获得相关信息,也可以问问题。请参考 <xref linkend="s1-emacs-nxml-readme"/>。</para> + </note> + <sect1 id="s1-nxml-rpm"> + <title>下载 nXML RPM</title> + <indexterm> + <primary>nXML</primary> + <secondary>RPM</secondary> + </indexterm> + <indexterm> + <primary>nXML RPM</primary> + </indexterm> + <para>要在 emacs 中使用 nXML 模式,您需要安装 <ulink url="http://people.redhat.com/twaugh/ftp/docbook/nxml-modee/"> Tim Waugh <ulink> 网站上的 nXML RPM,或者下载 <ulink url="http://www.thaiopensource.com/download/">http://www.thaiopensource.com/download/</ulink> 的源代码。源代码需要花工夫来配置,因此这里只考虑 RPM 版本。</ulink></ulink></para> + <para>关于下载源代码请参考 <xref linkend="s1-emacs-additional-resources"/>。</para> + </sect1> + <sect1 id="s1-nxml-examples"> + <title>范例</title> + <para>与 PSGML 模式相比,您只需有数几个命令。这样使用 <application>Emacs</application> 编辑就快捷多了,您可以更多地关注文章的内容。</para> + <sect2 id="s2-nxml-commands"> + <title>命令</title> + <para>要创建一个标记,输入 <userinput><</userinput> 然后输入关键字。要完成这个关键字,按下 <command>Ctrl-Ret</command>,然后添加随后的 <userinput>></userinput>。要关闭一个标记,输入 <userinput></</userinput>。</para> + <important> + <title>注意</title> + <para>当您打开不包含首部 DOCTYPE 声明的文件时,将看到如下信息,标记补全也无法实现,因为 nXML 不知道您在编辑的文件格式。</para> + </important> + <para>要加载 schema,按下 <command>Ctrl-c</command>,然后按 <command>Ctrl-s</command> 然后浏览 <filename>/usr/share/emacs/site-lisp/nxml-mode/schema/</filename> 并加载 <filename>docbook.rnc</filename>。<application>Emacs</application> 将提示您将它保存到工作目录。</para> + <tip> + <title>技巧</title> + <para>已描述过的命令只是 <application>Emacs</application> PSGML 模式与 <application>Emacs</application> nXML 模式的不同之处。您仍然需要使用 <xref linkend="s1-emacs-basic-commands"/> 中描述的命令。</para> + </tip> + </sect2> + </sect1> + <sect1 id="s1-emacs-nxml-additional-resources"> + <title>其他资源</title> + <para>其他的 Emacs 与 nXML 帮助可以在下列位置找到:</para> + <itemizedlist> + <listitem> + <para> + <ulink url="http://www.thaiopensource.com/download/">http://www.thaiopensource.com/download/</ulink> — <citetitle>Author's download area</citetitle></para> + </listitem> + <listitem> + <para> + <ulink url="http://wks.uts.ohio-state.edu/unix_course/intro-135.html">http://wks.uts.ohio-state.edu/unix_course/intro-135.html</ulink> — <citetitle>Emacs Quick Reference Guide</citetitle></para> + </listitem> + <listitem> + <para> + <filename>emacs</filename> 软件包附带了 Emacs 参考卡片。您可以打印一份,作为参考。— <filename>/usr/share/emacs/<replaceable><version></replaceable>/etc/refcard.ps</filename></para> + </listitem> + </itemizedlist> + </sect1> + <sect1 id="s1-emacs-nxml-readme"> + <title>nXML README 文件</title> + <note> + <title>注意</title> + <para>这个文件可以在您解压的源代码中找到,如果安装了 RPM,它的位置是 <filename>/usr/share/doc/nxml-mode-<replaceable><version></replaceable>/</filename>。</para> + </note> + <para>README 文件:</para> + <para>这是 GNU Emacs 的一种新的主模式。它支持格式良好的 XML 文档,也为采用 RELAX NG Compact Syntax 的 XML 文档提供了 schema-sensitive 编辑模式。</para> + <para>要使用它,您需要 GNU Emacs 21.x 版本,推荐 21.3。GNU Emacs 20 版本中无法正常运作,XEmacs 也不行。要开始编辑,输入命令:</para> + <screen> + <command>M-x load-file RET rng-auto.el RET</command> + </screen> + <para>这样定义了必需的 autoloads。然后,打开一个包含 XML 文档的文件,执行命令:</para> + <screen> + <command>M-x nxml-mode</command> + </screen> + <para>然后执行</para> + <screen> + <command>C-h m</command> + </screen> + <para>来查看 nXML 模式的使用帮助。手册的起始页在 nxml-mode.info 中,可以这样阅读它:</para> + <screen> + <command>C-u M-x info RET nxml-mode.info RET</command> + </screen> + <para>它也在顶层 info 目录最后添加了自己的一项,因此您可以和平常一样,用 <command>C-h i</command> 开始阅读。</para> + <para>您可以用 <filename>test.valid.xml</filename> 和 <filename>test.invalid.xml</filename> 作为正确和不正确的 XML 文档范例。</para> + <para>要在 Emacs 启动时自动加载这些,将下列内容加入您的 <filename>.emacs</filename>:</para> + <screen> + <computeroutput> +(load "~/nxml-mode-200YMMDD/rng-auto.el") +</computeroutput> + </screen> + <para>这里 <computeroutput>~/nxml-mode-200YMMDD</computeroutput> 是包含 <filename>.elc</filename> 文件的目录。注意 <filename>rng-auto.el</filename> 不会加载所有 nXML 模式的代码;它仅仅设置环境,使得 nXML 模式的所有特性得以正确地自动加载。您不应尝试自动加载 <filename>rng-auto.el</filename> 本身。</para> + <para>要在加载扩展名是 <filename>xml</filename>, <filename>xsl</filename>, <filename>rng</filename> 或 <filename>xhtml</filename> 的文件时自动切换到 nXML 模式,将下列内容加入您的 <filename>.emacs</filename>:</para> + <screen> + <computeroutput> +(setq auto-mode-alist + (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode) + auto-mode-alist)) +</computeroutput> + </screen> + <para>如果您编辑 iso-8859-N 编码的 XML,而不是 iso-8859-1,并且您运行的是 Emacs 21.3 或更新版本,那么最好打开 unify-8859-on-decoding-mode,将下列内容加入您的 <filename>.emacs</filename>:</para> + <screen> + <computeroutput>(unify-8859-on-decoding-mode)</computeroutput> + </screen> + <para>要使用验证以及 schema-sensitive 编辑模式,您需要文档的 RELAX NG Compact Syntax (RNC) schema 文件。schema 目录包含了常用文档类型的 schema。</para> + <para>关于 RELAX NG 请参考 <ulink url="http://relaxng.org/">http://relaxng.org/</ulink>。</para> + <para>关于 RELAX NG Compact NG 的教程请参考 <ulink url="http://relaxng.org/compact-tutorial.html">http://relaxng.org/compact-tutorial.html</ulink></para> + <para>关于自动创建 RNC schema,推荐使用 Trang 程序:<ulink url="http://www.thaiopensource.com/relaxng/trang.html">http://eee.thaiopensource.com/relaxng/trang.html"</ulink></para> + <para>您可以使用它来 <itemizedlist><listitem><para>从已有文档得出 RNC schema</para></listitem><listitem><para>将 DTD 转换为 RNC schema</para></listitem><listitem><para>将 RELAX NG XML syntax schema 转换为 RNC schema</para></listitem></itemizedlist></para> + <para>要将 RELAX NG XML syntax (.rng) schema 转换为 RNC schema,您也可以使用 <ulink url="http://www.pantor.com/download.html">http://www.pantor.com/download.html"</ulink> 的 XSLT 样式表。</para> + <para>要将 W3C XML Schema 转换为 RNC schema,您需要首先将它转换为 RELAX NG XML syntax,使用 Sun 的 RELAX NG 转换工具 rngconv (基于 MSV)。请参考 <ulink url="https://msv.dev.java.net/">https://www.dev.java.net/</ulink>。</para> + <para>文件 <filename>NEWS</filename> 描述了最近的更改。</para> + <para>请访问邮件列表 <ulink url="http://groups.yahoo.com/group/emacs-nxml-mode/">http://groups.yahoo.com/group/emacs-nxml-mode</ulink> 来提交 bug 和参与讨论。我将在那里发布新版本。</para> + <para>James Clark</para> + <para>jjc@thaiopensource.com</para> + </sect1> +</chapter> diff --git a/docs-emacs-zh_CN.xml b/docs-emacs-zh_CN.xml new file mode 100644 index 0000000..3320e48 --- /dev/null +++ b/docs-emacs-zh_CN.xml @@ -0,0 +1,533 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: docs-emacs-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --><chapter id="ch-emacs"> + <title>Emacs 与 PSGML 模式</title> + <indexterm> + <primary>PSGML</primary> + </indexterm> + <indexterm> + <primary>Emacs</primary> + </indexterm> + <indexterm> + <primary>Emacs</primary> + <secondary>PSGML 模式</secondary> + </indexterm> + <para>您可以利用 Emacs 的 PSGML 模式以使编辑 XML 格式更容易。PSGML 模式提供了语法高亮,标记补全等功能。</para> + <sect1 id="s1-emacs-file"> + <title>设置您的 <filename>.emacs</filename></title> + <indexterm> + <primary>Emacs</primary> + <secondary>配置文件</secondary> + </indexterm> + <indexterm> + <primary> + <filename>.emacs</filename> + </primary> + </indexterm> + <para>为使 Emacs 可以正确解析您的 DocBook 文档,您必须定制一个 <filename>.emacs</filename> 文件。将下列内容复制并粘贴到您已有的 <filename>.emacs</filename> 文件中,或者创建一个包含下列内容的新文件:<screen><computeroutput> +;; turn on auto-fill in `text-mode' and derived modes +;;(mail, news, etc) +(add-hook 'text-mode-hook 'turn-on-auto-fill) + +;; +;;MODES +;; + +(setq auto-mode-alist (cons '("\\.sgml$" . sgml-mode) auto-mode-alist)) +(setq auto-mode-alist (cons '("\\.sgm$" . sgml-mode) auto-mode-alist)) + +;; +;;XML!! +;; +;;############################################################# + +;; +;;PSGML mode stuff +;; + +(autoload 'sgml-mode "psgml" "My Most Major Mode" t) + +(setq sgml-mode-hook '(lambda () "Defaults for XML mode." (turn-on-auto-fill) +(setq fill-column 80))) + +(defun My-XML-keymap () + (local-set-key [(alt i)] + '(lambda () + (interactive) + (sgml-indent-line) + (sgml-insert-element 'item) + (sgml-indent-line))) + (local-set-key [(alt l)] + '(lambda () + (interactive) + (sgml-insert-element 'list) + (sgml-insert-element 'item) + (sgml-indent-line))) + (local-set-key [(alt p)] + '(lambda () + (interactive) + (sgml-indent-line) + (sgml-insert-element 'para) + (sgml-indent-line))) + (local-set-key [(alt -)] + '(lambda () + (interactive) + (insert "—")))) + +(add-hook 'sgml-mode-hook 'My-XML-keymap) + +;; +;; Fix up indentation of data... +;; + +(setq-default sgml-indent-data t) + +;; +;; XML markup faces. +;; + +(setq-default sgml-set-face t) + + +(make-face 'sgml-comment-face) +(make-face 'sgml-doctype-face) +(make-face 'sgml-end-tag-face) +(make-face 'sgml-entity-face) +(make-face 'sgml-ignored-face) +(make-face 'sgml-ms-end-face) +(make-face 'sgml-ms-start-face) +(make-face 'sgml-pi-face) +(make-face 'sgml-sgml-face) +(make-face 'sgml-short-ref-face) +(make-face 'sgml-start-tag-face) + +(set-face-foreground 'sgml-comment-face "maroon") +(set-face-foreground 'sgml-doctype-face "dark green") +(set-face-foreground 'sgml-end-tag-face "blue2") +(set-face-foreground 'sgml-entity-face "red2") +(set-face-foreground 'sgml-ignored-face "maroon") +(set-face-background 'sgml-ignored-face "gray90") +(set-face-foreground 'sgml-ms-end-face "maroon") +(set-face-foreground 'sgml-ms-start-face "maroon") +(set-face-foreground 'sgml-pi-face "maroon") +(set-face-foreground 'sgml-sgml-face "maroon") +(set-face-foreground 'sgml-short-ref-face "goldenrod") +(set-face-foreground 'sgml-start-tag-face "blue2") + +(setq-default sgml-markup-faces + '((comment . sgml-comment-face) + (doctype . sgml-doctype-face) + (end-tag . sgml-end-tag-face) + (entity . sgml-entity-face) + (ignored . sgml-ignored-face) + (ms-end . sgml-ms-end-face) + (ms-start . sgml-ms-start-face) + (pi . sgml-pi-face) + (sgml . sgml-sgml-face) + (short-ref . sgml-short-ref-face) + (start-tag . sgml-start-tag-face))) + + +(defun docbook-mode () + (sgml-mode) + ) + + + +;; +;;END XML STUFF +;; +;;################################################################## + +;PO mode stuff + +(setq auto-mode-alist + (cons '("\\.pox?\\'" . po-mode) auto-mode-alist)) +(autoload 'po-mode "po-mode") + + + (global-set-key [(f1)] (lambda () (interactive) (manual- + entry (current-word)))) + +</computeroutput></screen></para> + <para>您是否有一个滚轮鼠标?如果是,那么可以将下列内容加入您的 <filename>.emacs</filename>,这样您的滚轮将可以用在 <application>Emacs</application> 中 (适于 <application>Emacs</application> 版本 21):</para> + <screen> + <computeroutput> +;; Enable wheelmouse support by default for emacs 21 +(cond (window-system +(mwheel-install) +)) +</computeroutput> + </screen> + <para>如果您使用旧的 20 版本,应添加下列内容:</para> + <screen> + <computeroutput> +;; Enable wheelmouse support by default +(require 'mwheel) +</computeroutput> + </screen> + + +<!-- bug #125757 in NEEDINFO state + <para> + If you have a mouse, you can also add the following. It adds popup menus + when the cursor is either on a start tag or in a region where elements + are allowed. + </para> + +<screen> +<computeroutput> +;; Mouse Bindings: right-click to generate context-aware +;; elements/attributes popup menu. +(define-key sgml-mode-map [mouse-3] 'sgml-tags-menu) +</computeroutput> +</screen> + +--> + + </sect1> + <sect1 id="s1-emacs-colors"> + <title>定制 Emacs</title> + <indexterm> + <primary>Emacs</primary> + <secondary>定制</secondary> + </indexterm> + <indexterm> + <primary> + <filename>.Xresources</filename> + </primary> + </indexterm> + <indexterm> + <primary>Emacs</primary> + <secondary>colors</secondary> + </indexterm> + <indexterm> + <primary>Emacs</primary> + <secondary>font</secondary> + </indexterm> + <indexterm> + <primary>Emacs</primary> + <secondary>geometry</secondary> + </indexterm> + <para>在您的 <filename>~/.Xresources</filename> 中配置 Emacs 的颜色,字体和默认窗口大小。设置的格式是 <computeroutput>emacs.keyword:value</computeroutput></para> + <para>下面是一个 <filename>~/.Xresources</filename> 文件范例。</para> + <note> + <title>注意</title> + <para>如果您的 <filename>~/.Xresources</filename> 中包含其他设置,就将下列内容添加到文件结尾。</para> + </note> + <screen> + <userinput> +emacs.background: light gray +emacs.foreground: black +emacs.pointerColor: blue +emacs.cursorColor: blue +emacs.bitmapIcon: on +emacs.font: fixed +emacs.geometry: 90x25 +</userinput> + </screen> + <para>修改文件后,您必须执行命令</para> + <screen> + <command>xrdb -merge ~/.Xresources</command> + </screen> + <para>并且重新运行 <application>Emacs</application> 以使改变生效。</para> + </sect1> + <sect1 id="s1-emacs-cedfile"> + <title>创建重编译的 DTD 子集</title> + <para>如果给出了正确的文档类型声明 (DTD) 文件,Emacs 可以对 DocBook XML 文件进行正确的语法高亮和缩进。这些特性将使您的 XML 文件易于阅读,帮助您发现错误。</para> + <para>要创建一个可加载的已解析的 DTD 文件:<orderedlist><listitem><para>找到一组 DocBook 文件的主控文件。您可以通过头部是否包含 <filename><!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN"</filename> 来找到它。最简单的办法,是运行命令 <command>grep DocBook *.xml</command>。找到主控文件后,在 Emacs 中打开它,命令是 <command>emacs <replaceable><parentfile></replaceable>.xml</command> (这里 <replaceable><parentfile></replaceable>.xml 是你找到的主控文件)。</para></listitem><listitem><para>在下拉菜单中选择 <command>DTD -> Parse DTD</command>。</para></listitem><listitem><para>当您看到屏幕下方的 <computeroutput>Fontifying...done</computeroutput> 信息时,解析就完成了。将已解析的 DTD 保存为文件,方法是在下拉菜单中选择 <command>DTD -> Save Parsed DTD</command>。</para></listitem><listitem><para>按下 <keycap>Enter</keycap> 来保存为默认文件名,或者修改文件名,但应保留 <filename>.ced</filename> 扩展名。可以将它命名为 <filename>docbook.ced</filename> 这样很通用的名字,这样您在打开所有 DocBook 文件的时候都可以引用它。这个文件也可以复制到要加载的目录中。</para></listitem></orderedlist></para> + <tip> + <title>技巧</title> + <para>您也可以使用 Emacs 命令 <command>Meta-x sgml-parse-prolog</command> 来解析这个文件,然后用命令 <command>Meta-x sgml-save-dtd</command> 来保存已解析的 DTD 到 <filename>.ced</filename> 文件中。</para> + </tip> + </sect1> + <sect1 id="s1-emacs-loadced"> + <title>加载已解析的 DTD</title> + <para>现在您已保存了 DTD 设置,您可以加载这个 <filename>.ced</filename> 文件,看看 <filename>.sgml</filename> 文件语法高亮的效果。</para> + <para>要加载已解析的 DTD 文件:<orderedlist><listitem><para>在 Emacs 中打开 XML 文件</para></listitem><listitem><para>在下拉菜单中选择 <command>DTD -> Load DTD</command> 然后选择您在上一步保存的文件。例如,选择 <filename>docbook.ced</filename>。</para></listitem><listitem><para>当您看到屏幕下方的 <computeroutput>Fontifying...done</computeroutput> 信息时,就加载完毕了。加载已解析的 DTD 可能需要很久。您可以在加载完毕前就开始编辑。</para></listitem></orderedlist></para> + <tip> + <title>技巧</title> + <para>您也可以使用 Emacs 命令 <command>Meta-x sgml-load-dtd</command> 来加载已翻译的 DTD。</para> + </tip> + </sect1> + <sect1 id="s1-emacs-basic-commands"> + <title>基本的 Emacs 命令</title> + <para> + <keycap>Meta</keycap> 键通常指的是 <keycap>Alt</keycap> 键。</para> + <table colsep="1" frame="all" id="tb-emacs-commands" rowsep="1"> + <title>Emacs 命令</title> + <tgroup cols="2" colsep="1" rowsep="1"> + <colspec colname="shortcut" colnum="1" colwidth="170"/> + <colspec colname="description" colnum="2" colwidth="300"/> + <thead> + <row> + <entry colsep="1" rowsep="1">快捷方式</entry> + <entry colsep="1" rowsep="1">描述</entry> + </row> + </thead> + <tbody> + <row> + <entry colsep="1" rowsep="1"> + <keycombo> + <keycap>Meta</keycap> + <keycap>x</keycap> + </keycombo> sgml-parse-prolog, <keycap>Enter</keycap></entry> + <entry>解析 DTD</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Meta</keycap> + <keycap>x</keycap> + </keycombo>sgml-save-dtd, <keycap>Enter</keycap></entry> + <entry>保存已解析的 DTD</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Meta</keycap> + <keycap>x</keycap> + </keycombo>sgml-load-dtd, <keycap>Enter</keycap></entry> + <entry>加载 DTD</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>c</keycap> + </keycombo>, <keycombo><keycap>Shift</keycap><keycap/></keycombo>, <keycap>Tab</keycap></entry> + <entry>显示有效标记的列表</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>c</keycap> + </keycombo>, <keycombo><keycap>Shift</keycap><keycap/></keycombo>, type beginning of tag, <keycap>Tab</keycap></entry> + <entry>补全标记</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> <keycap>g</keycap></keycombo> + </entry> + <entry>取消 minibuffer 中的命令</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>c</keycap> + </keycombo>, <keycap>/</keycap></entry> + <entry>关闭标记</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> <keycap>a</keycap></keycombo> + </entry> + <entry>将光标移动到行首</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>e</keycap> + </keycombo> + </entry> + <entry>将光标移动到行尾</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>Home</keycap> + </keycombo> + </entry> + <entry>将光标移动到文件开始</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>End</keycap> + </keycombo> + </entry> + <entry>将光标移动到文件结束</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>k</keycap> + </keycombo> + </entry> + <entry>剪切一行</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> <keycap>y</keycap></keycombo> + </entry> + <entry>粘贴一行</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> <keycap>s</keycap></keycombo> + </entry> + <entry>在文件中向前搜索</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>r</keycap> + </keycombo> + </entry> + <entry>在文件中向后搜索</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Meta</keycap> + <keycap>$</keycap> + </keycombo> + </entry> + <entry>检查当前单词的拼写</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Meta</keycap> + <keycap>x</keycap> + </keycombo> ispell-word, <keycap>Enter</keycap></entry> + <entry>检查当前单词的拼写</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Meta</keycap> + <keycap>x</keycap> + </keycombo> ispell-buffer, <keycap>Enter</keycap></entry> + <entry>检测当前 buffer 的拼写</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>x</keycap> + </keycombo>, <keycombo><keycap>Ctrl</keycap><keycap>f</keycap></keycombo></entry> + <entry>打开文件</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>x</keycap> + </keycombo>, <keycombo><keycap>Ctrl</keycap><keycap>s</keycap></keycombo></entry> + <entry>保存文件</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>x</keycap> + </keycombo>, <keycombo><keycap>Ctrl</keycap><keycap>c</keycap></keycombo></entry> + <entry>退出 <application>Emacs</application>,在需要时提示保存文件</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Meta</keycap> <keycap>q</keycap></keycombo> + </entry> + <entry>段落重排</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>c</keycap> + </keycombo>, <keycombo><keycap>Ctrl</keycap><keycap>a</keycap></keycombo></entry> + <entry>编辑标记的属性 (例如,您可以编辑 <computeroutput>ulink</computeroutput> 标记的 <computeroutput>url</computeroutput> 属性)</entry> + </row> + <row> + <entry> + <keycombo> + <keycap>Ctrl</keycap> + <keycap>c</keycap> + </keycombo>, <keycombo><keycap>Ctrl</keycap><keycap>c</keycap></keycombo></entry> + <entry>结束编辑属性</entry> + </row> + </tbody> + </tgroup> + </table> + </sect1> + <sect1 id="s1-emacs-examples"> + <title>范例</title> + <para>Emacs 和 PSGML 的命令表 (参考卡片) 对于新手来说有些难。本节有一些例子,讲解如何使用它们。</para> + <sect2 id="s2-emacs-tag-completion"> + <title>标记补全</title> + <note> + <title>注意</title> + <para>本节假设您已经加载了 DTD 文件 (<filename>.ced</filename>)。</para> + </note> + <para>需要插入标记时,不要输入它。按下组合键 <keycap>Ctrl</keycap>-<keycap>c</keycap>, 然后按下 <keycap><</keycap>。在 <application>Emacs</application> 窗口的下方,您将看到:</para> + <screen> + <computeroutput>Tag: <</computeroutput> + </screen> + <para>要查看所有标记的列表,按下 <keycap>Tab</keycap> 或 <keycap>?</keycap>。如果您知道标记的首字母,可以按下它们,然后按 <keycap>Tab</keycap>,就可以看到有同样首字母的所有标记的列表。</para> + <para>尝试这样:按下 <keycap>Ctrl</keycap>-<keycap>c</keycap> 然后按 <keycap><</keycap>,然后按下字母 <keycap>k</keycap>,然后按 <keycap>Tab</keycap>。为了得到完整的列表,您可能需要多次按下 <keycap>Tab</keycap>。</para> + <para>输出应当与下面类似:</para> + <screen> + <computeroutput> +Click mouse-2 on a completion to select it. +In this buffer, type RET to select the completion near point. + +Possible completions are: +<keycap> <keycode> +<keycombo> <keysym> +</computeroutput> + </screen> + </sect2> + <sect2 id="s2-emacs-tag-closing"> + <title>标记关闭</title> + <para>当您开始了一个标记后,您必须关闭它。按下组合键 <keycap>Ctrl</keycap>-<keycap>c</keycap>,然后按 <keycap>/</keycap>。这样将关闭最近一个开放的标记。</para> + </sect2> + <sect2 id="s2-emacs-other"> + <title>其他 Emacs 任务</title> + <para> + <guilabel>恢复单个窗口</guilabel>: 有时 <application>Emacs</application> 窗口被划分 (下方的窗口有标记补全等内容)。要恢复到只有您的 XML 文本全屏显示的状态,最简单的办法是按下 <keycap>Ctrl</keycap>-<keycap>x</keycap>,然后按 <keycap>1</keycap>。</para> + <para> + <guilabel>保存作品</guilabel>: 要保存编辑结果,按下 <keycap>Ctrl</keycap>-<keycap>x</keycap> 然后按 <keycap>Ctrl</keycap>-<keycap>s</keycap>。</para> + <para> + <guilabel>"清除/返回"命令</guilabel>:有时,在标记补全中玩得太多,需要直接返回编辑时,按下 <keycap>Ctrl</keycap>-<keycap>g</keycap>。这个命令将放弃当前动作,而不会关闭文件本身。</para> + <para> + <guilabel>打开文件</guilabel>: 要打开一个新文件,按下 <keycap>Ctrl</keycap>-<keycap>x</keycap> 然后按 <keycap>Ctrl</keycap>-<keycap>f</keycap>。在窗口下方,可以输入要打开文件名 (这里也可以使用 <keycap>Tab</keycap> 补全)。</para> + <para> + <guilabel>关闭 emacs</guilabel>: 要关闭 <application>emacs</application>,按下 <keycap>Ctrl</keycap>-<keycap>x</keycap> 然后按 <keycap>Ctrl</keycap>-<keycap>c</keycap>。如果您尚未保存,它将提示,否则它会简单地退出。</para> + </sect2> + </sect1> + <sect1 id="s1-emacs-additional-resources"> + <title>其他资源</title> + <para>其他 Emacs 和 PSGML 参考可以在这里找到:</para> + <itemizedlist> + <listitem> + <para> + <ulink url="http://wks.uts.ohio-state.edu/unix_course/intro-135.html">http://wks.uts.ohio-state.edu/unix_course/intro-135.html</ulink> — <citetitle>Emacs Quick Reference Guide</citetitle></para> + </listitem> + <listitem> <para><filename>emacs</filename> 软件包附带了 Emacs 参考卡片。您可以打印一份,作为参考。— <filename>/usr/share/emacs/<replaceable><version></replaceable>/etc/refcard.ps</filename></para></listitem> + <listitem> + <para> + <filename>/usr/share/doc/psgml-<replaceable><version></replaceable>/psgml.ps</filename> 中的 <citetitle>Editing XML with Emacs and PSGML</citetitle>。</para> + </listitem> + <listitem> + <para> + <ulink url="http://www.snee.com/bob/sgmlfree/psgmqref.html">http://www.snee.com/bob/sgmlfree/psgmqref.html</ulink> — <citetitle>Emacs/PSGML Quick Reference</citetitle> 是一个 Emacs PSGML 模式的索引表。</para> + </listitem> + <listitem> + <para> + <ulink url="http://www.snee.com/bob/sgmlfree/emcspsgm.html">http://www.snee.com/bob/sgmlfree/emcspsgm.html</ulink> — <citetitle>PSGML Tricks</citetitle></para> + </listitem> + </itemizedlist> + </sect1> +</chapter> diff --git a/docs-getting-files-zh_CN.xml b/docs-getting-files-zh_CN.xml new file mode 100644 index 0000000..8f2823e --- /dev/null +++ b/docs-getting-files-zh_CN.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: --><!-- +<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ + + <!ENTITY BOILERPLATE "This header makes editing XML easier" > + +]> +--><chapter id="ch-getting-files"> + <title>下载文件</title> + <para>要开始为 Docs Project 贡献力量,您需要适当的 DocBook XML 文件,样式表以及一些脚本。需要安装下列软件包:</para> + <itemizedlist> + <listitem> + <para> + <filename>xmlto</filename> — 生成 HTML 和 PDF 版本的输出</para> + </listitem> + <listitem> + <para> + <filename>docbook-style-xsl</filename> — 我们默认使用的 XSLT 样式表</para> + </listitem> + <listitem> + <para> + <filename>docbook-dtds</filename> — DocBook DTD 针对 XML 的版本</para> + </listitem> + </itemizedlist> + <para>常用的脚本和样式表都存放在 <computeroutput>cvs.fedora.redhat.com</computeroutput> CVS 服务器的仓库中。您需要将它们以及已有文档的 DocBook XML 文件检出。</para> + <para>您应当只在第一次从 docs CVS 检出时,做这些动作。当您看到密码提示时,按下 <keycap>Enter</keycap>。</para> + <screen> + <userinput>mkdir my-fedora-docs +cd my-fedora-docs +export CVSROOT=:pserver:anonymous@cvs.fedora.redhat.com:/cvs/docs +cvs login +cvs co docs-common +cvs co example-tutorial</userinput> + </screen> + <para>当您进行匿名 CVS 检出时,您可以检视文件并获取更新的版本。您不可以添加或提交更新到服务器中。要提交修改,必须有 <abbrev>CVS</abbrev> 写权限。关于获取 <abbrev>CVS</abbrev> 写权限请参考 <ulink url="http://fedoraproject.org/wiki/DocsProject/NewWriters"/>。</para> + <para>要查看已有文档的列表:</para> + <screen> + <userinput>cvs co -c</userinput> + </screen> + <para>选择您感兴趣的文档,然后下载到工作目录:</para> + <screen> + <userinput>cvs co example-tutorial</userinput> + </screen> + <para>除了 <citetitle>&IG;</citetitle> 之外,CVS 中所有文档必须是 DocBook XML article 格式,使用 <filename>example-tutorial</filename> 目录中的模板。每个文档 <emphasis>必须</emphasis> 有自己的目录。根目录中不允许有 XML 文件。</para> +</chapter> diff --git a/docs-intro-zh_CN.xml b/docs-intro-zh_CN.xml new file mode 100644 index 0000000..792f8a5 --- /dev/null +++ b/docs-intro-zh_CN.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: docs-intro-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --><preface id="ch-intro"> + <title>介绍</title> + <para>Docs Project 的目标是为 &FC; 用户和开发者创建易于维护,基于任务的文档。除了 <citetitle>&IG;</citetitle> 之外,所有文档必须是 DocBook XML article 格式,每个主题一篇文章。这样,作者就可以专注于撰写一个主题,不必考虑它如何排版为一个手册,或如何与其他主题协调。</para> + <para>要用到的工具:</para> + <itemizedlist> + <listitem> + <para>DocBook XML v4.1</para> + </listitem> + <listitem> + <para>自定义的打印版本和 HTML 版本的 XSLT 样式表</para> + </listitem> + <listitem> + <para>自定义的脚本,以生成 PDF 版本和 HTML 版本的输出 (使用 <command>xmlto</command>)</para> + </listitem> + <listitem> + <para>Emacs PSGML 模式 (可选,推荐使用)</para> + </listitem> + <listitem> + <para>Emacs nXML 模式 (可选,同样推荐使用)</para> + </listitem> + </itemizedlist> + <para>本文档的目的是解释 Docs Project 使用的工具,同时提供写作约定和标记约定,使文档一致且易于维护。</para> +</preface> diff --git a/docs-rh-guidelines-zh_CN.xml b/docs-rh-guidelines-zh_CN.xml new file mode 100644 index 0000000..0ead30c --- /dev/null +++ b/docs-rh-guidelines-zh_CN.xml @@ -0,0 +1,415 @@ +<?xml version="1.0" encoding="utf-8"?> +<chapter id="ch-rh-guidelines"> + <title>&RH; 文档撰写约定</title> + <indexterm> + <primary>recursion</primary> + <see>recursion</see> + </indexterm> + <indexterm> + <primary>RTFM</primary> + <secondary>read the f*'ing manual</secondary> + <seealso>humor</seealso> + </indexterm> + <indexterm> + <primary>humor</primary> + <secondary>RTFM</secondary> + </indexterm> + <para>请仔细阅读本章。本章描述了必须遵循的约定,例如命名约定。</para> + <sect1 id="s1-xml-guidelines-naming"> + <title>ID 命名约定</title> + <indexterm> + <primary>XML 标记</primary> + <secondary>命名约定</secondary> + </indexterm> + <indexterm> + <primary>命名约定</primary> + </indexterm> + <para>后面您将看到这样的 ID 命名。它们有助于理解这些命名的含义。例如:</para> + <screen> + <computeroutput> +<chapter id="ch-uniquename"> + +<sect3="s3-install-make-disks"> + +<figure id="fig-redhat-config-kickstart-basic"> +</computeroutput> + </screen> + <para>ID 是独一无二的标识符,使得 DocBook XML 得知如何交叉参考章、节等等。</para> + <para>定义 ID 的一般规则如下:</para> + <indexterm> + <primary>XML 标记</primary> + <secondary>定义 ID 的规则</secondary> + </indexterm> + <indexterm> + <primary>命名约定</primary> + <secondary>定义 ID 的规则</secondary> + </indexterm> + <itemizedlist> + <listitem> + <para>至多使用 32 个字母 (这里指的是引号中所有内容)</para> + </listitem> + <listitem> + <para>尽量短小而简单</para> + </listitem> + <listitem> + <para>确保命名与内容相关 (使它可辨识)</para> + </listitem> + </itemizedlist> + <para>例如,<command>"ch-uniquename"</command> (有 13 个字母) 以及 <command>"s3-install-make-disks"</command> (有 21 个字母)。</para> + <para>特定一章中的小节应当在 ID 中包含这一章的名称 (这一章的 ID 去掉 <command>"ch-"</command>)。例如,您在撰写 <command>"ch-intro"</command> 一章,需要将有关磁盘分区的内容作为第一节时,小节 ID 将类似于 <command>"s1-intro-partition"</command>,它包含了小节编号,这一章的 ID 以及这一节的独一无二的 ID。</para> + <table id="tb-xml-namingconventions"> + <title>命名约定</title> + <tgroup cols="2"> + <colspec colname="tag" colnum="1" colwidth="100"/> + <colspec colname="prefix" colnum="2" colwidth="100"/> + <thead> + <row> + <entry>标记</entry> + <entry>前缀</entry> + </row> + </thead> + <tbody> + <row> + <entry> + <command>前言</command> + </entry> + <entry> + <computeroutput>pr-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>chapter</command> + </entry> + <entry> + <computeroutput>ch-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>节</command> + </entry> + <entry> + <computeroutput>sn-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>第一节</command> + </entry> + <entry> + <computeroutput>s1-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>第二节</command> + </entry> + <entry> + <computeroutput>s2-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>第三节</command> + </entry> + <entry> + <computeroutput>s3-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>第四节</command> + </entry> + <entry> + <computeroutput>s4-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>figure</command> + </entry> + <entry> + <computeroutput>fig-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>table</command> + </entry> + <entry> + <computeroutput>tb-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>附录</command> + </entry> + <entry> + <computeroutput>ap-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>part</command> + </entry> + <entry> + <computeroutput>pt-</computeroutput> + </entry> + </row> + <row> + <entry> + <command>example</command> + </entry> + <entry> + <computeroutput>ex-</computeroutput> + </entry> + </row> + </tbody> + </tgroup> + </table> + </sect1> + <sect1 id="s1-xml-guidelines-header"> + <title>文件头</title> + <para>所有文件必须包含 CVS Id 头部。</para> + <para>如果您创建了一个新文件,第一行必须是:</para> + <screen> + <computeroutput> +<!-- $Id: --> +</computeroutput> + </screen> + <para>它被提交到 CVS 中时 (在每次提交时),这一行都会自动更新,以包含关于文件的信息。例如:</para> + <screen> + <computeroutput> +<!-- $Id: docs-rh-guidelines-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --> +</computeroutput> + </screen> + </sect1> + <sect1 id="s1-xml-admon"> + <title>创建提示</title> + <indexterm> + <primary>提示</primary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>警告</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>技巧</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>注意</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>小心</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>重要</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>提示</secondary> + <tertiary>警告</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>提示</secondary> + <tertiary>技巧</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>提示</secondary> + <tertiary>注意</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>提示</secondary> + <tertiary>小心</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>提示</secondary> + <tertiary>重要</tertiary> + </indexterm> + <para>DocBook 中有五种提示类型:小心,重要,注意,技巧和警告。</para> + <para>所有提示都有类似的结构:可选的标题,随后是段落级的元素。DocBook DTD 没有定义每种提示的特殊语义。例如,DocBook 并未规定警告必须用于可能造成重大损失的情况。</para> + <sect2 id="s2-xml-notesetc"> + <title>创建技巧,注意,小心,重要和警告提示</title> + <indexterm> + <primary>XML 标记</primary> + <secondary>注意</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>技巧</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>小心</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>重要</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>警告</secondary> + </indexterm> + <para>有很多方法来使文档中的文本引人注意。<emphasis>Note</emphasis> 用于显示附加信息。<emphasis>Tip</emphasis> 用于显示完成任务的其他方法。<emphasis>Caution</emphasis> 用于告诫用户在尝试某一步时必须小心。<emphasis>Important</emphasis> 用于提醒用户不可忽视的信息,尽管用户动作不受影响,但是必须提醒用户信息的重要性。<emphasis>Warning</emphasis> 用于提醒读者,他们的设置将被修改或变动,例如文件将被删除,如果他们在意这一后果,就不应继续动作。</para> + <para>下列代码将展示上面每种情况的写法,同时也展示了 HTML 显示效果。</para> + <screen> + <computeroutput> +<note> +<title>注意</title> +<para>文本内容</para> +</note> +</computeroutput> + </screen> + <note> + <title>注意</title> <para>文本内容</para></note> + <screen> + <computeroutput> +<tip> +<title>技巧</title> +<para>文本内容</para> +</tip> +</computeroutput> + </screen> + <tip> + <title>技巧</title> + <para>文本内容</para> + </tip> + <screen> + <computeroutput> +<caution> +<title>小心</title> +<para>文本内容</para> +</caution> +</computeroutput> + </screen> + <caution> + <title>小心</title> <para>文本内容</para></caution> + <screen> + <computeroutput> +<important> +<title>重要</title> +<para>文本内容</para> +</important> +</computeroutput> + </screen> + <important> + <title>注意</title> + <para>文本内容</para> + </important> + <screen> + <computeroutput> +<warning> +<title>警告</title> +<para>文本内容</para> +</warning> +</computeroutput> + </screen> + <warning> + <title>警告</title> <para>文本内容</para></warning> + </sect2> + </sect1> + <sect1 id="s1-screenshots"> + <title>屏幕截图</title> + <indexterm> + <primary>屏幕截图</primary> + <secondary>如何截取</secondary> + </indexterm> + <indexterm> + <primary>屏幕快照</primary> + <see>屏幕截图</see> + </indexterm> + <indexterm> + <primary>屏幕抓图</primary> + <see>屏幕截图</see> + </indexterm> + <para>有两种类型的屏幕截图:图象和文本。选择它们的原则是 <firstterm>尽量使用文本截图</firstterm>。这意味着,如果您可以用文本而不是图象来表达,那么就用文本。GUI 的图象截图可以首先引入一些对象,然后用文字加以描述,但是您不会总是为每一步都创建一副截图。</para> + <para>这样选择的主要目的是文本块通常比占据相同空间的图象包含更多信息。这和具体图象有关,某个场景的准确的截图也许抵得上一千字的效果。GUI 的截图通常有很大空白,只包含很少元素,这样便于描述或列举。</para> + <para>截取图象的步骤本身表明了,使用文字来描述一个过程比起一系列的屏幕截图要精确许多。</para> + <variablelist> + <varlistentry> + <term>图象截图</term> + <listitem> + <procedure> + <step> + <para>设置主题为默认主题。这样读者会熟悉这一外观,也使得 &FDP; 文档显得一致。从菜单中,选择 <guimenu>Preferences</guimenu>, <guimenuitem>Theme</guimenuitem> 然后选 <guimenuitem>Bluecurve</guimenuitem> (&FC; 4 不再使用 Bluecurve)。</para> + </step> + <step> + <para>设置字体为默认值。从菜单中,选择 <guimenu>Preferences</guimenu>, <guimenuitem>Fonts</guimenuitem>. 然后设置 <guilabel>Application font</guilabel> 和 <guilabel>Desktop font</guilabel> 为 Sans Regular 10。设置 <guilabel>Window Title font</guilabel> 为 Sans Bold 10。设置 <guilabel>Terminal font</guilabel> 为 Monospace Regular 10。</para> + </step> + <step> + <para>在截图之前,试着将目标 GUI 元素调整到尽可能小。您的目标应当是 500 像素或更小。如果您需要截取超过一个 GUI 元素,可以按照下面的步骤来缩放图象。</para> + </step> + <step> + <para>要截取图象,使用鼠标选择 GUI 元素,将它放到最前,或者调整元素排列。按下 <keycombo><keycap>Alt</keycap><keycap>Print Screen</keycap></keycombo> 来截取单个 GUI 窗口。要抓去整个桌面,按下 <keycap>Print Screen</keycap>。如果您要截取包含很多元素的图象,并已将它们靠近,那么还可以在 <application>The GIMP</application> 中裁减结果图象到适当大小。截取的图象将是 PNG 格式。</para> + </step> + <step> + <para>如果需要,您可以使用 <application>The GIMP</application> 缩放图象。打开图象,在图象上点击右键,选择 <guimenu>Image</guimenu> -> <guimenuitem>Scale Image...</guimenuitem>。保持长宽比不变,设置 <guilabel>New Width</guilabel> 为 <guilabel>500 px</guilabel>,然后点击 <guibutton>OK</guibutton>。记住在转换为 EPS 之前按下 <keycombo><keycap>Ctrl</keycap><keycap>s</keycap></keycombo> 保存图象。</para> + </step> + <step> + <para>仍使用 <application>The GIMP</application> 编辑图象,在图象上点击右键,选择 <guimenu>File</guimenu> -> <guimenuitem>Save As...</guimenuitem>。在 <guimenu>Determine File Type:</guimenu> 列表中,选择 <guimenuitem>PostScript</guimenuitem>,然后点击 <guibutton>OK</guibutton>。点击 <guibutton>Export</guibutton>,允许平整图象。</para> + <para>在 <guilabel>Save as PostScript</guilabel> 窗口,选择 <guilabel>Encapsulated PostScript</guilabel>,然后点击 <guibutton>OK</guibutton>。</para> + </step> + </procedure> + <para>关于如何在 XML 中调用图象,请参考 <xref linkend="s1-xml-tags-figure"/>。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>文本截图</term> + <listitem> + <para>文本的屏幕信息对读者也很有用。如果您可以同时用图象和文本截图描述某个功能,就不要同时包含它们,除非忽略任何一个都将使描述不清楚。您应当使得信息更加通用。忽略用户名和主机名信息,区分用户的输入与示例的输出。在 <command>screen</command> 标记中,用户输入应当包含在 <command>userinput</command> 标记内,而用户看到的输出应当包含在 <command>computeroutput</command> 标记内。例如,<xref linkend="ex-text-screenshot-bad"/> 的用法应该改为这样 <xref linkend="ex-text-screenshot-good"/></para> + <example id="ex-text-screenshot-bad"> + <title>不正确的文本截图</title> + <screen> + <userinput>ps ax | grep ssh</userinput> + <computeroutput> + 2564 ? S 0:23 /usr/sbin/sshd + 3092 ? S 0:00 /usr/bin/ssh-agent /etc/X11/xinit/Xclients + 8235 ? S 0:00 ssh -Nf rocky@philadelphia.net -L 6667:localhost +17223 pts/0 S 0:00 ssh rbalboa@core-router7 +17227 pts/2 S 0:10 ssh rbalboa@smbshare2 +21113 pts/7 S 1:19 ssh rocky@xxx.private +</computeroutput> + </screen> + </example> + <example id="ex-text-screenshot-good"> + <title>正确的文本截图</title> + <para>要显示所有当前活动的 ssh 会话,执行下列命令:</para> + <screen> + <command>ps ax | grep ssh</command> + </screen> + <para>输出将类似于:</para> + <screen> + <computeroutput> + 2564 ? S 0:23 /usr/sbin/sshd + 3092 ? S 0:00 /usr/bin/ssh-agent /etc/X11/xinit/Xclients + 8032 pts/0 S 0:00 ssh user@host.example.com + 8032 pts/1 S 0:00 ssh root@backup.example.com +</computeroutput> + </screen> + </example> + <para>关于 screen 标记,请参考 <xref linkend="s1-xml-tags-screen"/>。</para> + </listitem> + </varlistentry> + </variablelist> + </sect1> + <sect1 id="s1-diagrams-images"> + <title>图表和图象</title> + <indexterm> + <primary>images</primary> + </indexterm> + <indexterm> + <primary>图表</primary> + <secondary>创建</secondary> + </indexterm> + <para>待编辑</para> + </sect1> +</chapter> diff --git a/docs-style-zh_CN.xml b/docs-style-zh_CN.xml new file mode 100644 index 0000000..14e7228 --- /dev/null +++ b/docs-style-zh_CN.xml @@ -0,0 +1,1047 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: --><chapter id="ch-style"> + <title>写作风格</title> + <para>撰写完善的技术文档不仅仅指展示命令行和指令集。好文档应当容易阅读、理解、翻译,表达准确的概念间的逻辑关系。好文档也可以用 <emphasis>不应当做的</emphasis> 事情来定义。您的文档应当避免:</para> + <itemizedlist> + <listitem> + <para>冗长</para> + </listitem> + <listitem> + <para>多余的,不加解释的行话</para> + </listitem> + <listitem> + <para>语法或拼写错误</para> + </listitem> + <listitem> + <para>对个人经历的引证</para> + </listitem> + <listitem> + <para>可能触犯或迷惑用户的评论</para> + </listitem> + </itemizedlist> + <para>这一章包含了 &FED; 文档写作风格的规则和准则。准则与规则不同,即使违反了准则,如果您的文章更加易于理解,那么没有关系。尽量遵循准则,总是遵循规则。如果没有明确表明,一个建议就是一个准则。</para> + <section id="sn-intro-to-style"> + <title>为何写作风格很重要</title> + <para>优秀的写作不是天生的。它是一种技术,即使专业的作者,甚至有名的作家,也必须时常练习。 <firstterm>写作风格</firstterm><indexterm><primary>style</primary></indexterm> 是将优秀的作品与平直的描述区分开的特性。</para> + <para>优秀的作品有多种形式。对于诗歌和散文,优秀的作品不会遵循一定的语法、句法或拼写规则。一个著名的例子是 James Joyce 的小说 <citetitle>Ulysses</citetitle> 中的 Episode 18, "Penelope," <footnote id="fn-ulysses"><para><ulink url="http://www.online-literature.com/james_joyce/ulysses/18/">http://www.online-literature.com/james_joyce/ulysses/18/</ulink>。请注意这个例子包含一些成人内容,因此不适于所有用户。</para></footnote>。那里,Joyce 使用长串的词汇,不加标点,来摹拟角色的内心意识。虽然违反了语法和句法的基本规则,Joyce 描绘了叙述者无组织却又松散联系的思考方式。</para> + <para>技术文档却必须遵循这些规则。文档与标准语法偏差越大,读者就会觉得越难理解。例如,读者也许并不以文档语言为母语,或者正在阅读译本。这时,如果作者使用方言、习语或者行话,读者和译者会很容易被迷惑。下面的例子比较了表达同样含义的不同做法:</para> + <example> + <title>不正确的风格</title> + <!-- I prefer "incorrect," because I think terms such as + "problematic" are mealy-mouthed. They remind me of the late + 1980's English textbook trend toward the politically correct yet + wholly unhelpful "standard/nonstandard." But then, I tend to be + dogmatic; it's probably my Catholic upbringing. [PWF] --> + <para>So you made the changes I showed you in the last section. What's the next thing you should do? Just pop your thumb drive onto your system and read the <filename>messages</filename> log. When you see "USB device found," then Bob's your uncle.</para> + </example> + <example> + <title>正确的风格</title> + <!-- I prefer "correct." See above. [PWF] --> + <para>After you complete the configuration changes above, attach the USB removable media to your system. Use the <command>dmesg</command> command to examine the kernel message log. The message <computeroutput>USB device + found</computeroutput> indicates that your device was installed successfully.</para> + </example> + <para>第一个例子是更口语化的英语,它不适于正式的文档。第二个例子更加正式,但是无论是对英语用户还是译者,它都更容易理解。</para> + <para>遵守写作风格规则和准则,可以使读者阅读大量文档时更轻松。一致的风格有助于增强文档的专业性和价值认同。另一方面,忽略标点或语法错误将使读者对文档产生抵触。读者会认为基本正确的一篇文档不够权威,因为它写得很差。读者不必为理解作者的语言而头疼时才会放松下来。</para> + <para>这一章不可能包含足够的内容,使每个读过的人变成一个好作者。一些专门讲述写作风格的手册可能会有几百页。这一章为中级作者理解技术文档的写作风格提供了足够的准则。</para> + <para>如果您不是有经验的作者,无论技术文档还是其他,您还可以从其他资源中学到很多。下面的列表仍不够完善,但是提供了一个起点:</para> + <itemizedlist> + <listitem> + <para> + <citetitle>The Elements of Style</citetitle>, 作者 William Strunk. 在线阅读: <ulink url="http://bartleby.com/141/">http://bartleby.com/141/</ulink></para> + </listitem> + <!-- placeholder for when it's ready + <para> + <citetitle>The Elements of Style</citetitle>, by William + Strunk. Fedora Docs Project version: <ulink + url="http://fedora.redhat.com/docs/eos-guide-en/">http://fedora.redhat.com/docs/eos-guide-en/</ulink> + </para> +--> + <listitem> + <para> + <citetitle>The Chicago Manual of Style</citetitle>, 作者 the University of Chicago Press. 在线阅读: <ulink url="http://www.chicagomanualofstyle.org/">http://www.chicagomanualofstyle.org/</ulink></para> + </listitem> + <listitem> + <para> + <citetitle>Paradigm Online Writing Assistant</citetitle>, 维护者 Chuck Guilford, Ph.D. 在线阅读: <ulink url="http://www.powa.org/">http://www.powa.org/</ulink></para> + </listitem> + </itemizedlist> + <para>很多自由软件的文档计划有自己的文档风格准则。实际上,这一章很多内容来自 <citetitle>GNOME Documentation Style Guidelines</citetitle> (<firstterm>GDSG</firstterm>)。您可以看到本来的 <citetitle>GDSG</citetitle>,位置是 <ulink url="http://developer.gnome.org/documents/style-guide/">http://developer.gnome.org/documents/style-guide/</ulink>。</para> + </section> + <section id="sn-tech-docs-fundamentals"> + <title>技术文档的基本概念</title> + <note> + <title>参考书目信息</title> + <para>这一节来自 <citetitle>GDSG</citetitle>。</para> + </note> + <!-- This section will reproduce mostly what is in Chapter 1 of + the GDSG. There may be minor changes. FIXME: Make sure the + appropriate front matter of the Documentation Guide includes + attribution as required by the GNU FDL. --> + <para>这一章提供了写作技术文档的简要介绍。</para> + <section id="sn-fundamentals-1"> + <title>写作风格一般要求</title> + <para>&FP; 技术文档写作在一般要求的基础上,有特殊的约束。好的 &FED; 技术文档应当有下列特点:</para> + <variablelist> + <varlistentry> + <term>完备</term> + <listitem> + <para>描述一个产品的全部功能。不可忽略个人认为对用户没有用处的功能。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>一致</term> + <!-- I'm having issues with the + sketchy definition of this non-dictionary word and the + associated text. Not wrong, per se, just wishing for + something better. This note shall remind us! - kwade --> + <!-- Hopefully this change helps. Makes sense according to the + gdict tool in Core, at least. - PWF --> + <listitem> + <para>描述看到的内容。不要描述想要看到的内容。将信息以用户切身经历的顺序表达出来。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>清楚</term> + <listitem> + <para>阅读 <citetitle>The Elements of Style</citetitle> (<ulink url="http://www.bartleby.com/141/">http://www.bartleby.com/141/</ulink>) 来撰写清楚的文档。</para> + +<!-- placeholder for when this is published: + <para> + Read <citetitle>The Elements of Style</citetitle> + &FED;-version (<ulink + url="http://fedora.redhat.com/docs/eos-guide-en/">http://fedora.redhat.com/docs/eos-guide-en/</ulink>) + to help make your writing clear. + </para> +--> + </listitem> + </varlistentry> + <varlistentry> + <term>连贯</term> + <listitem> + <para>在文档中使用约定俗成的词汇。如果其他作者在撰写相关的文档,那么使用相同的词汇。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>简明</term> + <listitem> + <para>写作时多检视作品,问问自己哪些可以删减。请参考 <xref linkend="sn-fundamentals-2"/>。</para> + </listitem> + </varlistentry> + </variablelist> + </section> + <section id="sn-fundamentals-2"> + <title>原则</title> + <para>这一节包含了一些基本的风格准则。本章的后续小节将展开详述这些准则。</para> + <variablelist> + <varlistentry> + <term>原则一:简短</term> + <listitem> + <itemizedlist> + <listitem> + <para>将每句话限制到 25 个词以下。</para> + </listitem> + <listitem> + <para>将每步过程限制到 23 个词以下。</para> + </listitem> + </itemizedlist> + <example id="ex-golden-rule-1-wrong"> + <title>不正确:过长</title> + <para>Under normal operating conditions, the kernel does not always immediately write file data to the disks, storing it in a memory buffer and then periodically writing to the disks to speed up operations.</para> + </example> + <example id="ex-golden-rule-1-right"> + <title>正确:短句</title> + <para>Normally, the kernel stores the data in memory prior to periodically writing the data to the disk.</para> + </example> + </listitem> + </varlistentry> + <varlistentry> + <term>原则二:有条理</term> + <listitem> + <itemizedlist> + <listitem> + <para>每段讲述一个主题。</para> + </listitem> + <listitem> + <para>每句话表达一个意思。</para> + </listitem> + <listitem> + <para>每步操作只包含一个动作。</para> + </listitem> + </itemizedlist> + <example id="ex-golden-rule-2-wrong"> + <title>不正确:没有条理</title> + <para>The <application>Workspace Switcher</application> applet helps you navigate all of the virtual desktops available on your system. The X Window system, working in hand with a piece of software called a <emphasis>window manager</emphasis>, allows you to create more than one virtual desktop, known as <emphasis>workspaces</emphasis>, to organize your work, with different applications running in each workspace. The <application>Workspace Switcher</application> applet is a navigational tool to get around the various workspaces, providing a miniature road map in the GNOME panel showing all your workspaces and allowing you to switch easily between them.</para> + </example> + <example id="ex-golden-rule-2-right"> + <title>正确:有条理</title> + <para>Use the <application>Workspace Switcher</application> to add new <emphasis>workspaces</emphasis> to the GNOME Desktop. You can run different applications in each workspace. The <application>Workspace Switcher</application> applet provides a miniature map that shows all of your workspaces. You can use the <application>Workspace Switcher</application> applet to switch between workspaces.</para> + </example> + <tip> + <para>在撰写前规划段落的顺序。决定在每段应当涵盖的主题。</para> + </tip> + </listitem> + </varlistentry> + <varlistentry> + <term>原则三:使用指示</term> + <listitem> + <para>使用例子来演示如何操作。提供指示,而不是描述。</para> + <example id="ex-golden-rule-3-wrong"> + <title>不正确:描述而不指示</title> + <para>There is a text box that you can use to find out the definition of a word.</para> + </example> + <example id="ex-golden-rule-3-right"> + <title>正确:指示用法</title> + <para>To request a definition of a word, type the word in the text box, then select <guilabel>Lookup</guilabel>.</para> + </example> + <tip> + <para>不要过于教条。有时您需要解释,以说明那些范例。</para> + </tip> + </listitem> + </varlistentry> + <varlistentry id="vle-golden-rule-4"> + <term>原则四:客观</term> + <listitem> + <para>以中立的语气写作。</para> + <example id="ex-golden-rule-4-wrong"> + <title>不正确:偏倚一方</title> + <para>The applet is a handy little screen grabber.</para> + </example> + <example id="ex-golden-rule-4-right"> + <title>正确:客观陈述</title> + <para>Use the applet to take screenshots.</para> + </example> + </listitem> + </varlistentry> + </variablelist> + </section> + <section id="sn-fundamentals-3"> + <title>语气</title> + <para>不合适的语气会妨碍读者获取信息。中立的,不带个人好恶选择的语气可以促进读者的理解。中立的语气使较大的文档项目中的作者可以并行写作。另外,新的作者可以随时加入。中立的语气可以在系列文档之间实现一致,便于用户获得信息。要达到共同的中立的语气,最好的办法是采用下列原则:</para> + <variablelist> + <varlistentry> + <term>避免幽默</term> + <listitem> + <para>幽默使注意力从您的信息中移开。幽默也使文档难以翻译。保持直白。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>避免个人好恶选择</term> + <listitem> + <para>无论您认为某个功能是否好坏都不重要。将功能展示给用户,包含如何使用这些功能的指示。保持准确。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>避免口语</term> + <listitem> + <para>口语难以翻译,通常是与文化相关的。保持中立。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>避免一时的论断</term> + <listitem> + <para>一个论断在今天被认同,在明天就可能被推翻。保持技术化。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>避免展望将来</term> + <listitem> + <para>关于某个产品的将来,这不属于技术文档。只撰写您现在看到的东西。要实际。</para> + </listitem> + </varlistentry> + </variablelist> + </section> + <section id="sn-fundamentals-4"> + <title>面向正确的用户</title> + <para>您对文档的结构和内容的定夺应当基于对读者的理解。考虑读者如何获取文档,需要哪些信息,曾经的经验等等。通常,您需要创建适合不同群体的文档。下面几节包含了您需要考虑的与读者相关的主题。</para> + </section> + <section id="sn-fundamentals-6"> + <title>用户的动机</title> + <para>不要浪费想在文档中获取信息的读者的时间。用户阅读技术文档不是为了取乐。用户通常带有特定的问题。您需要对这些问题作出明确的回答。</para> + </section> + <section id="sn-fundamentals-7"> + <title>新用户</title> + <para>&FC; 的新用户遇到不熟悉的应用程序或功能时,通常会查阅在线教程。每个教程应当包含足够的介绍信息,告诉新用户如何使用相关的功能。每个教程还应当包含足够的使用说明,告诉用户他们可以用这个命令或功能作出的种种动作。使这些说明面向任务。在教程中不要描述 GUI 屏幕、对话框和对话框元素,除非某个特性影响了您的说明。</para> + </section> + <section id="sn-fundamentals-8"> + <title>有经验的用户</title> + <para>有经验的用户通常将文档作为参考。文档需要完备,组织合理,如果是打印的方式,还需要索引。</para> + </section> + <section id="sn-fundamentals-9"> + <title>不要触犯读者</title> + <para>为避免触犯读者,文档应遵循下列准则:</para> + <variablelist> + <varlistentry> + <term>避免内部用语</term> + <listitem> + <para>内部用语包括行话和计算机社群中常见的缩写风气。例如,使用<literal>docs</literal> 而不是 <literal>documentation</literal>。一个词如果满足下面的条件,就是一句行话:</para> + <itemizedlist> + <listitem> + <para>这个词没有包含在 <citetitle>&FED; Jargon Buster</citetitle> (<ulink url="http://fedora.redhat.com/docs/jargon-buster/">http://fedora.redhat.com/docs/jargon-buster/</ulink>) 中。</para> + </listitem> + <listitem> + <para>这个词没有包含在 <citetitle>American Heritage Dictionary</citetitle> (<ulink url="http://www.bartleby.com/61/">http://www.bartleby.com/61/ </ulink>) 中。</para> + </listitem> + <listitem> + <para>这个词没有出现在您撰写的文档的词汇表中。</para> + </listitem> + <listitem> + <para>这个词也没有在您撰写的文档中定义。</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>避免性别相关的语言</term> + <listitem> + <para>不要出现代词 <literal>他的/她的</literal> 或 <literal>他/她</literal>。在指令中不必区分性别。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>避免特定文化的语言</term> + <listitem> + <para>如果您的范例只能让您周围方圆百里的人看懂,那么它没有意义。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>不要用高人一等的口气</term> + <listitem> + <para>如果文档中说,一个动作很容易或很快,而实际上用户无法完成,那没有比这更能让读者郁闷的了。不要评价和判断动作。</para> + </listitem> + </varlistentry> + </variablelist> + <para>准则的其他部分是对可能造成触犯的语气和语言用法的详细说明。</para> + </section> + </section> + <section id="sn-grammar-and-usage"> + <title>语法和用法准则</title> + <note> + <title>参考书目信息</title> + <para>这一节部分来自 <citetitle>GDSG</citetitle>,部分来自 <citetitle>The Elements of Style</citetitle>,为二十一世纪的技术文档作者进行了更新。</para> + </note> + <!-- FIXME: Again, check attribution viz. GNU FDL. This will be more work + than the previous section. --> + <para>这一节包含了字母序排列的语法和用法准则,用于 &FED; 文档。很多准则只适用于英语,请参考 <citetitle>American Heritage Dictionary</citetitle> (<ulink url="http://www.bartleby.com/61/">http://www.bartleby.com/61/</ulink>) 和 <citetitle>Chicago Manual of Style</citetitle> (<ulink url="http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/cmosfaq.html">http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/cmosfaq.html</ulink>)。</para> + <variablelist> + <varlistentry> + <term>缩写</term> + <listitem> + <para>词或短语的简写形式,可以代替原来的词使用,例如 <literal>Dr.</literal>, <literal>a.m.</literal>, <literal>p.m.</literal> 等等。在使用缩写时,遵循下列规则:</para> + <itemizedlist> + <listitem> + <para>避免创造新的缩写。不熟悉的缩写造成混淆,无法表明一个概念。</para> + </listitem> + <listitem> + <para>不要解释或展开众所周知的缩写。</para> + </listitem> + <listitem> + <para>不要在文档的词汇表中包含众所周知的缩写。</para> + </listitem> + </itemizedlist> + <para>对于短语的缩写,例如 <literal>i.e.</literal> ("in other words", 换句话说) 和 <literal>e.g.</literal> ("for example", 例如),不要使用缩写。拼写出整个短语。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>形容词</term> + <listitem> + <para>小心使用形容词。在必须使用形容词来区分对象时再用。无论合适,检查是否可以把形容词去掉。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>首字母组合词</term> + <listitem> + <para>用来表达一个由多个词组成的概念。通常,首字母组合词是这样构造的:</para> + <itemizedlist> + <listitem> + <para>From the first letters of each word in a compound term, for example Table of Contents (TOC).</para> + </listitem> + <listitem> + <para>From recognizable parts of a compound term, such as GNU Object Model Environment (GNOME).</para> + </listitem> + </itemizedlist> + <para>在使用首字母组合词的时候,遵循下列规则:</para> + <itemizedlist> + <listitem> + <para>在第一次使用时,拼写完整的名称,在括号中包含组合词。</para> + </listitem> + <listitem> + <para>不要拼写出众所周知的首字母组合,除非您认为这对读者有用。</para> + </listitem> + <listitem> + <para>不要创建新的首字母组合。不熟悉的组合将造成混淆,无法表达清楚。</para> + </listitem> + <listitem> + <para>用大写表示,除非必须用小写。</para> + </listitem> + <listitem> + <para>在文档的词汇表中包含首字母组合和全称。</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>副词</term> + <listitem> + <para>小心使用副词。在必须用副词修饰组件的功能时再用。无论合适,检测是否可以去掉副词。经典的冗余副词包括 <literal>容易地</literal>,<literal>简单地</literal> 和 <literal>迅速地</literal>。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>拟人</term> + <listitem> + <itemizedlist> + <listitem> + <para>不要让应用程序软件充满情绪、欲望或意见。</para> + </listitem> + <listitem> + <para>不要让应用程序软件产生位置、维度的感觉。用户不会 "处在" 一个文本编辑器里。</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>冠词</term> + <listitem> + <para>不要在下列对象前面使用定冠词 <literal>the</literal>:</para> + <itemizedlist> + <listitem> + <para>文章标题</para> + </listitem> + <listitem> + <para>段的标题</para> + </listitem> + <listitem> + <para>标题</para> + </listitem> + <listitem> + <para>图象说明</para> + </listitem> + <listitem> + <para>表格说明</para> + </listitem> + <listitem> + <para>列表</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>撇号</term> + <listitem> + <para>尽可能不要使用撇号</para> + <itemizedlist> + <listitem> + <para>不要用撇号来表达从属和拥有的关系</para> + </listitem> + <listitem> + <para>不要用撇号来表达缩写</para> + </listitem> + <listitem> + <para>不要用撇号来表达复数</para> + </listitem> + </itemizedlist> + <example id="ex-apostrophe-wrong"> + <title>不正确的撇号</title> + <itemizedlist> + <listitem> + <para>the <guimenu>Main Menu's</guimenu><guimenuitem>Help</guimenuitem> option</para> + </listitem> + <listitem> + <para>don't use the default option</para> + </listitem> + <listitem> + <para>several SCSI disk's</para> + </listitem> + </itemizedlist> + </example> + <example id="ex-apostrophe-right"> + <title>正确:不使用撇号</title> + <itemizedlist> + <listitem> + <para>the <guimenuitem>Help</guimenuitem> option on the <guimenu>Main Menu</guimenu></para> + </listitem> + <listitem> + <para>do not use the default option</para> + </listitem> + <listitem> + <para>several SCSI disks</para> + </listitem> + </itemizedlist> + </example> + </listitem> + </varlistentry> + <varlistentry> + <term>方括号</term> + <listitem> + <itemizedlist> + <listitem> + <para>不要使用方括号 [就像这样] 替换圆括号 (就像这样)</para> + </listitem> + <listitem> + <para>使用方括号表达可选的命令行参数</para> + </listitem> + <listitem> + <para>不要使用尖括号表达文本中的变量,应使用 <sgmltag class="starttag">replaceable</sgmltag> 标记。标记用法请参考 <xref linkend="s1-xml-tags-replaceable"/>。</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>大写</term> + <listitem> + <para>下列情况下大写:</para> + <itemizedlist> + <listitem> + <para>首字母缩写中的所有字母,除非是众所周知的特例</para> + </listitem> + <listitem> + <para>列表中第一个词的第一个字母</para> + </listitem> + <listitem> + <para>顺序列表中第一个词的第一个字母</para> + </listitem> + <listitem> + <para>按键名称的第一个字母,例如 <keycap>Shift</keycap></para> + </listitem> + <listitem> + <para>句子的第一个字母</para> + <note> + <title>命令名</title> + <para>避免在句首使用命令名或应用程序名称,如果它们的首字母是小写的话。</para> + </note> + </listitem> + <listitem> + <para>冒号后面完整句子的首字母</para> + </listitem> + </itemizedlist> + <para>下列情况下不要大写:</para> + <itemizedlist> + <listitem> + <para>组合的名词,后面是缩写或首字母组合</para> + </listitem> + <listitem> + <para>如果要强调一些内容</para> + </listitem> + <listitem> + <para>变量名</para> + </listitem> + <listitem> + <para>冒号后面,不完整句子的首字母</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>标题</term> + <listitem> + <para>对于标题,以及图象和表格的说明,使用相同的规则。不要在标题最后加上句号。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>冒号</term> + <listitem> + <para>在下列情况下,使用冒号:</para> + <itemizedlist> + <listitem> + <para>引入列表</para> + </listitem> + <listitem> + <para>在解释的前面</para> + </listitem> + <listitem> + <para>在介绍之后</para> + </listitem> + </itemizedlist> + <para>下列情况下,不要使用冒号:</para> + <itemizedlist> + <listitem> + <para>要引入图象或表格</para> + </listitem> + <listitem> + <para>介绍标题</para> + </listitem> + <listitem> + <para>介绍一个过程之后</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>表栏标题</term> + <listitem> + <para>使用与标题相同的规则</para> + </listitem> + </varlistentry> + <varlistentry> + <term>逗号</term> + <listitem> + <para>下列情况下,使用逗号:</para> + <itemizedlist> + <listitem> + <para>区分系列中的对象</para> + </listitem> + <listitem> + <para>区分句子的部分</para> + </listitem> + <listitem> + <para>区分非限制性的短语</para> + </listitem> + <listitem> + <para>与破折号类似,表达同位语</para> + </listitem> + <listitem> + <para>在 <emphasis>例如,</emphasis> 和类似的表达中</para> + </listitem> + </itemizedlist> + <para>下列情况下,不要使用逗号:</para> + <itemizedlist> + <listitem> + <para>一系列形容词修饰一个对象时</para> + </listitem> + <listitem> + <para>两个短的独立子句间</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>命令</term> + <listitem> + <para>不要将命令作为动词。</para> + </listitem> + </varlistentry> + <varlistentry id="vle-contractions"> + <term>缩写</term> + <listitem> + <para>不要使用缩写,类似 <emphasis>can't</emphasis>, <emphasis>don't</emphasis>, 或 <emphasis>isn't</emphasis>。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>破折号</term> + <listitem> + <para>不要使用破折号或连接号。使用分段或冒号,如果是介绍性文字的话。如果有很多内容要介绍,那么使用一个列表。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>省略号</term> + <listitem> + <para>下列情况下,使用省略号:</para> + <itemizedlist> + <listitem> + <para>要表示忽略了句子的一部分</para> + </listitem> + <listitem> + <para>要表示引用文本的间断</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>分数</term> + <listitem> + <para>使用分数时,遵循这些规则:</para> + <itemizedlist> + <listitem> + <para>在表格中,以及度量单位中,使用分数的数字形式,在正文中使用文本形式。</para> + </listitem> + <listitem> + <para>数字和相连的分数间添加空格,以防混淆。例如:1 1/2 而不是 11/2。</para> + </listitem> + <listitem> + <para>如果分数用作复合的修饰,在分数和度量单位间添加连字符。</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>性别</term> + <listitem> + <para>请参考 <xref linkend="sn-fundamentals-9"/>。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>语法</term> + <listitem> + <para>标准的英语语法规则,请参考 <citetitle>Chicago Manual of Style</citetitle> (<ulink url="http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/cmosfaq.html"> http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/cmosfaq.html</ulink>)。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>标题</term> + <listitem> + <para>在标题中使用下面的大写规则:</para> + <itemizedlist> + <listitem> + <para>第一个词的首字母大写</para> + </listitem> + <listitem> + <para>名词,形容词和动词的首字母大写</para> + </listitem> + <listitem> + <para>连词,冠词和少于四个字母的介词都应小写</para> + </listitem> + <listitem> + <para>四个字母的介词或更多时首字母大写</para> + </listitem> + <listitem> + <para>四个字母的连词或更多时大写</para> + </listitem> + </itemizedlist> + + <!-- <para> See <xref linkend="infodesign-2"/> for more + information about headings. </para> --> + </listitem> + </varlistentry> + <varlistentry> + <term>连字符</term> + <listitem> + <para>下列情况下,使用连字符:</para> + <itemizedlist> + <listitem> + <para>组合修饰中的数字</para> + </listitem> + <listitem> + <para>避免混淆</para> + </listitem> + <listitem> + <para>在标准的前缀和后缀中。请参考 <citetitle>American Heritage Dictionary</citetitle> (<ulink url="http://www.bartleby.com/61/">http://www.bartleby.com/61/</ulink>)。</para> + </listitem> + <listitem> + <para>在拼写的分数中</para> + </listitem> + <listitem> + <para>在由两个或多个单词构成的变量名中,类似 <replaceable>directory-name</replaceable>。注意: <replaceable>filename</replaceable> 是特例。</para> + </listitem> + </itemizedlist> + <para>下列情况下,不要使用连字符:</para> + <itemizedlist> + <listitem> + <para>对于行话</para> + </listitem> + <listitem> + <para>对于动词</para> + </listitem> + <listitem> + <para>以 <emphasis>ly</emphasis> 结尾的副词</para> + </listitem> + <listitem> + <para>数字作为单一修饰时</para> + </listitem> + <listitem> + <para> + <citetitle>American Heritage Dictionary</citetitle> (<ulink url="http://www.bartleby.com/61/">http://www.bartleby.com/61/</ulink>) 列为不需连字符的单词,以及有共同前缀的词</para> + </listitem> + <listitem> + <para>商标</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>拉丁文名称</term> + <listitem> + <para>不要使用拉丁文名称。使用相应的英文名称。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>像</term> + <listitem> + <para>不要使用 <emphasis>像</emphasis> 来表达等价或相似。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>列表</term> + <listitem> + <para>使用以冒号结尾的完整的句子引入列表。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>数字</term> + <listitem> + <para>下列情况下,拼写出数字:</para> + <itemizedlist> + <listitem> + <para>从 0 到 9 的数字,除非数字是测度的一部分</para> + </listitem> + <listitem> + <para>估计</para> + </listitem> + <listitem> + <para>极端情况,类似 <emphasis>百万</emphasis>,但要在前面加上一个数字。</para> + </listitem> + <listitem> + <para>出现在句子开头的数字</para> + </listitem> + <listitem> + <para>后面紧接一个数的数字。例如:<literal>两个 10 MB 的文件</literal></para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>数字形式</term> + <listitem> + <para>下列情况下,使用数字:</para> + <itemizedlist> + <listitem> + <para>数字 10 或更大</para> + </listitem> + <listitem> + <para>负数</para> + </listitem> + <listitem> + <para>大多数分数</para> + </listitem> + <listitem> + <para>百分数</para> + </listitem> + <listitem> + <para>小数</para> + </listitem> + <listitem> + <para>测度</para> + </listitem> + <listitem> + <para>小于一秒的时间单位</para> + </listitem> + <listitem> + <para>对位和字节的引用</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>圆括号</term> + <listitem> + <para>下列情况下,使用圆括号:</para> + <itemizedlist> + <listitem> + <para>要包含第一次出现的名称的缩写</para> + </listitem> + <listitem> + <para>在手册页的引用中,指明章节号</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>句点</term> + <listitem> + <para>下列情况下,使用句号:</para> + <itemizedlist> + <listitem> + <para>结束句子</para> + </listitem> + <listitem> + <para>文件和目录名中</para> + </listitem> + <listitem> + <para>可能被误认为单词的缩写中,类似 a.m. 和 U.S.</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>标点</term> + <listitem> + <para>使用标准的英语标点规则。请参考 <citetitle>Chicago Manual of Style</citetitle> (<ulink url="http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/cmosfaq.html">http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/cmosfaq.html</ulink>)。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>数字中的标点</term> + <listitem> + <para>不要在四位的数字中使用逗号。如果超过四位,那么使用逗号。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>引号</term> + <listitem> + <para>使用引号来表示内容是不变地从其他来源复制的。不要使用引号来区分不合适的用词。如果用词不合适,换一个别的。如果必须用这个词,就在词汇表中解释它,使这种用法变得合理。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>See v. Refer to</term> + <listitem> + <para>向用户提供参考资源时,使用 "refer to" 而不是 "see",使用 "refer also to" 而不是 "see also"。这样可以与索引用到的 <sgmltag class="starttag">see</sgmltag> 和 <sgmltag class="starttag">seealso</sgmltag> 标记区分开。 这些标记用于在索引中创建特殊的链接。为了在文档中保持一致,我们保留关键字 "see" 和 "see also" 用作超链接的索引引用,使用 "refer to" 和 "refer also to" 表达非超链接的,非索引的引用。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>分号</term> + <listitem> + <para>不要使用分号。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>斜线</term> + <listitem> + <para>除了用作文件名的一部分之外,不要使用斜线 "/"。不能包含 <literal>and/or</literal> 这样的内容,应该换成其中任何一个。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>拼写</term> + <listitem> + <para>使用标准的英语拼写规则,请参考 <citetitle>American Heritage Dictionary</citetitle> (<ulink url="http://www.bartleby.com/61/">http://www.bartleby.com/61/</ulink>)。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>书名</term> + <listitem> + <para>对于文档的名称,使用与标题相同的规则。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>单位</term> + <listitem> + <para>使用单位时,遵循下列规则:</para> + <itemizedlist> + <listitem> + <para>使用标准的单位缩写,不要自行创造缩写。</para> + </listitem> + <listitem> + <para>请参考 <citetitle>IEEE Standard Dictionary of Electrical and Electronics Terms</citetitle>。</para> + </listitem> + <listitem> + <para>在缩写的可能被误解为单词的单位中使用句点。</para> + </listitem> + <listitem> + <para>大多数标准的缩写单位都同时适于单数和复数。</para> + </listitem> + <listitem> + <para>在数字和单位之间加上空格。</para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + </variablelist> + </section> + <section id="sn-composition-tips"> + <title>行文技巧</title> + <!-- + + This section will collect miscellanea and advice for specific + situations that the FDP editors encounter. I hope they will feel + free to e-mail me sticky situations or particularly interesting + examples of work they've beautified. Hopefully not too much will be + drawn from my own work! - PWF. + +--> + <para>本节包含了一些技巧提示,来自 &FDP; 作者们曾遇到的情况。您应理解运用它们,来改善自己的文档。&FDP; 作者乐于接受新的范例。</para> + <section id="sn-misc-active-voice"> + <title>主动语态</title> + <para>总是使用主动语态,除非这样很别扭。文档告诉用户如何完成一项任务,应当给出清楚简明的指令。避免使用"必须", "需要"之类的词。这些词在文档中是多余的,因为读者期望看到您给出必要的步骤来完成任务。同样,避免使用"可能," "也许"等等,表示您对问题不很确定的词。您的文档应当权威地描述一个主题。读者不应担心按照文档做会有莫名奇妙的效果。</para> + <example id="ex-misc-passive-voice"> + <title>不正确:被动语态</title> + <para>命令 <command>yum update</command> 必须被运行。</para> + <para>您也许想运行 <command>yum update</command> 命令。</para> + </example> + <example id="ex-misc-active-voice"> + <title>正确:主动语态</title> + <para>运行 <command>yum update</command> 命令。</para> + </example> + </section> + <section id="sn-present-tense"> + <title>一般现在时态</title> + <para>以一般现在时态写作。最好的经验,是不需用 "将要" 来描述用户将要做或看到的内容。它们没有意义,并可能混淆翻译者。它们也通常与被动语态有关,请参考 <xref linkend="sn-misc-active-voice"/>。</para> + <example id="ex-misc-future-tense"> + <title>不正确:将来时态</title> + <para>应用程序将要显示目标文件的列表。</para> + <para>目标文件的列表将要被应用程序显示出来。</para> + </example> + <example id="ex-misc-present-tense"> + <title>正确:一般现在时态</title> + <para>应用程序显示目标文件的列表。</para> + </example> + </section> + <section id="sn-narrative-voice"> + <title>叙述的语气</title> + <para>不要用第一人称"我" "我们" 来引用作者自己 (无论是否包含读者),&FDP;,&FED; 社群或任何群体。不要用第三人称指代用户 ("他" "她" 或 "他或她") 或者 "某人"。使用第二人称 "您" 来指代读者是可以的。</para> + <example id="ex-misc-wrong-person"> + <title>不正确:第一或第三人称</title> + <para>正如上文所述,我通常在配置 Samba 服务器之前运行 <command>up2date</command>。</para> + <para>如果用户需要备份他的或她的文件,他或她应当使用 <command>tar</command> 或 <command>cpio</command> 命令。</para> + </example> + <example id="ex-misc-correct-person"> + <title>正确:第二人称,或不使用代词</title> + <para>配置 Samba 服务器之前,请参考关于 <command>up2date</command> 的小节。</para> + <para>如果需要,用户可以使用 <command>tar</command> 或 <command>cpio</command> 命令来备份文件。</para> + </example> + </section> + <section id="sn-misc-negative"> + <title>否定的用词</title> + <para>避免说不,因为它使教程显得武断。可以使用"避免"来代替。注意否定的词通常使用缩写,例如 <emphasis>don't</emphasis> 或 <emphasis>can't</emphasis>。请参考 <xref linkend="vle-contractions"/>。</para> + </section> + <section id="sn-misc-uncertainty"> + <title>不确定</title> + <para>避免过度使用 "典型的","通常地","大多数时候","许多"等诸如此类的词。</para> + </section> + <section id="sn-misc-offtopic"> + <title>多余的内容</title> + <para>避免涉及多余的内容,例如如何更新 &FC; 系统。这些关键的主题在其他教程中已有讲述。作者们经常违反这个准则,因为觉得自己的教程不够长。但是,不要偏离您的主题。如果其他教程可以完整的覆盖那些主题,那么指引读者阅读那些文档。</para> + </section> + <section id="sn-misc-importance"> + <title>自行评估价值</title> + <para>避免类似 "最重要的是应该做 <replaceable>XYZ</replaceable>" 的表述。如果这个过程很重要,读者一定希望在您的文档中看到。反过来说,如果您的文档中出现了某个过程,作者一定会觉得那很重要,尤其是当这个过程占用了整整一节的时候。其实只要说 "做 <replaceable>XYZ</replaceable>",然后详细说明就可以了。如果整整一节都是对如何做 <replaceable>XYZ</replaceable> 的说明,就干脆不要说这句话。请参考 <xref linkend="vle-golden-rule-4"/>。</para> + </section> + <section id="sn-misc-precision"> + <title>明确的语言</title> + <para>对于用户应当做出的动作,使用明确的词汇。不要让读者 "去" 选择,或者让读者在菜单里 "找"。</para> + <example id="ex-precision-wrong"> + <title>不正确:不明确的用词</title> + <itemizedlist> + <listitem> + <para>转到 <guimenu>Main Menu</guimenu> -> <guimenuitem>Foobar</guimenuitem></para> + </listitem> + <listitem> + <para>找到标记 <guilabel>Search</guilabel> 的选项</para> + </listitem> + </itemizedlist> + </example> + <example id="ex-precision-right"> + <title>正确:明确的用词</title> + <itemizedlist> + <listitem> + <para>在 <guimenu>Main Menu</guimenu> 菜单中,选择 <guimenuitem>Foobar</guimenuitem></para> + </listitem> + <listitem> + <para>选择 <guilabel>Search</guilabel> 选项。</para> + </listitem> + </itemizedlist> + </example> + <important> + <title>不要区别对待非图形界面用户</title> + <para>如果您的文档是关于纯图形界面程序的,那么可以随意使用 "点击"。如果应用程序有字符界面,那么可以使用 "选择",像上面那样。</para> + </important> + </section> + <section id="sn-misc-docbook-tips"> + <title>DocBook 技巧</title> + <para>这一节包含关于如何在文档中更有效地使用 DocBook 标记的技巧。</para> + <section id="sn-misc-admonitions"> + <title>创建提示</title> + <para>避免过分使用提示。在提示中只包含最重要的内容,使提示尽可能短。将用来解释的背景说明移到提示之外。使用简短的描述性的标题。标题的大小写规则与正文标题一致。</para> + <example id="ex-misc-ineffective-admonition"> + <title>不正确:过长的提示</title> + <para> + <warning> + <title>使用 <command>sfdisk</command> 检测输入</title> + <para> + <command>sfdisk</command> 命令接受一个脚本文件作为标准输入,来设置硬盘的分区。<command>sfdisk</command> 有些情况下拒绝一个有错的输入文件。在另一些情况下,它将无保留的执行输入,在硬盘上写入错误的分区。在写入磁盘前,总是用 <command>sfdisk -n</command> 命令检测输入文件。</para> + </warning> + </para> + </example> + <example id="ex-misc-good-admonition"> + <title>正确:简短的提示</title> + <para> + <command>sfdisk</command> 命令接受一个脚本文件作为标准输入,来设置硬盘的分区。<command>sfdisk</command> 有些情况下拒绝一个有错的输入文件。在另一些情况下,它将无保留的执行输入,在硬盘上写入错误的分区。<warning><title>检测输入</title><para>在写入磁盘前,总是用 <command>sfdisk -n</command> 命令检测输入文件。</para></warning></para> + </example> + <para>避免在章节或提示的标题中使用标点,除非必须使用逗号。在标题中包含与提示相关的内容,例如 "需要重启",而不是简单地使用提示类型作为标题 ("警告")。</para> + <para>提示的标题应使用与正文标题相同的大小写规则。</para> + </section> + <section id="sn-misc-replaceable"> + <title> + <sgmltag class="starttag">replaceable</sgmltag> 标记</title> + <para>如果您的文档表述了作为约定的一个特定的值,那么不要在文中或示例中使用 <sgmltag class="starttag">replaceable</sgmltag> 标记。</para> + </section> + <section id="sn-misc-entities"> + <title>XML 实体</title> + <para>使用 &FDP; 提供的实体。这些实体可以在 <filename>fedora-docs</filename> 的 <filename>common/</filename> 目录找到。(请参考 <xref linkend="ch-getting-files"/>。) 例如,不要使用缩写 "FC2",应当使用预定义的实体 "&FC; &FCVER;",这样将生成文本 "&FC; &FCVER;"。</para> + </section> + </section> + </section> +</chapter> diff --git a/docs-tutorial-zh_CN.xml b/docs-tutorial-zh_CN.xml new file mode 100644 index 0000000..28af5dd --- /dev/null +++ b/docs-tutorial-zh_CN.xml @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: docs-tutorial-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --><chapter id="ch-tutorial"> + <title>文档的布局</title> + <para>在本章您将看到 &PROJECT; 文档中,主控文件的示例。这个示例与 Docs Project 处理 DocBook XML 的方式相关。主控文件包含文档的主要结构,以及到定义公共实体的文件的链接,还包括定义文档版本和日期的实体。</para> + <sect1 id="s1-tutorial-parent"> + <title>主控文件</title> + <para>下面是一个简单的主控文件</para> + <screen> + <computeroutput> +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ + +<!ENTITY % FEDORA-ENTITIES-EN SYSTEM "../common/fedora-entities-en.xml"> +%FEDORA-ENTITIES-EN; + +<!ENTITY VERSION "0.1"> <!-- change version of tutorial here --> + +<!ENTITY BOOKID "example-tutorial-&VERSION; (2003-07-07)"> <!-- change last modified date here --> + +<!ENTITY LEGALNOTICE SYSTEM "../common/legalnotice-en.xml"> + + +]> + +<article id="example-tutorial" lang="en"> + <articleinfo> + <title>Example Tutorial</title> + <copyright> + <year>2003</year> + <holder>&FORMAL-RHI;</holder> + <holder>Tammy Fox</holder> + </copyright> + <authorgroup> + <author> + <surname>Fox</surname> + <firstname>Tammy</firstname> + </author> + </authorgroup> + &LEGALNOTICE; + </articleinfo> + + <section id="some-section"> + <title>Some Section</title> + + <para> + This is an example section. You can also use sect1, sect2, etc. + </para> + + <warning> + <title>Warning</title> + <para> + Example of an admonition. + </para> + </warning> + + </section> + +<index id="generated-index"></index> +</article> +</computeroutput> + </screen> + </sect1> + <sect1 id="s1-tutorial-license"> + <title>包含许可信息</title> + <indexterm> + <primary>文档版式</primary> + <secondary>许可</secondary> + </indexterm> + <para>所有 &PROJECT; 手册 <emphasis>必须</emphasis> 包含文件 <filename>legalnotice.xml</filename>。这个文件包含了 GNU Free Documentation License (FDL) 的文本。</para> + <para>示例主控文件显示了如何包含它们。</para> + </sect1> +</chapter> diff --git a/docs-vim-zh_CN.xml b/docs-vim-zh_CN.xml new file mode 100644 index 0000000..aea10db --- /dev/null +++ b/docs-vim-zh_CN.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: docs-vim-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --><chapter id="ch-vim"> + <title>VIM 与 DocBook</title> + <indexterm> + <primary>VIM</primary> + </indexterm> + <para>VIM 有很多特性,有助于撰写类似 DocBook 的 XML 文档,包括语法高亮和可定制的按键绑定。另外,还可以用外部程序辅助 VIM 完成拼写检查等操作。本章假定您已知悉 VIM 一般用法;如果您要学习一般用法,执行 <command>vimtutor</command> 或在 VIM 中执行 <userinput>:help tutor</userinput>。</para> + <sect1 id="s1-vimrc-file"> + <title>设置 <filename>.vimrc</filename> 文件</title> + <indexterm> + <primary>VIM</primary> + <secondary>配置文件</secondary> + </indexterm> + <para>下面是一个示例 <filename>.vimrc</filename> 文件,打开了一些 VIM 特性,便于编辑类似 DocBook 的 SGML 或 XML 文档: <screen><computeroutput> +" 关闭 vi 兼容特性,类似有限的撤销 +set nocompatible +" 基于文件扩展名的语法高亮 +syntax on +" 在 80 个字符后面自动插入新行 +set textwidth=80 +" 自动缩进 +set autoindent +" 使用 % 匹配 SGML 标记 +source $VIMRUNTIME/macros/matchit.vim +</computeroutput></screen></para> + <note> + <para>一些特性需要安装 <filename>vim-enhanced</filename>。如果您使用的是 <filename>vim-minimal</filename>,或者是旧版本的 VIM,可能不包含 <filename>$VIMRUNTIME/macros/matchit.vim</filename> 文件,那么可以在 Vim.org 下载 <ulink url="http://vim.org/scripts/script.php?script_id=39">matchit.zip</ulink> 并加载。</para> + </note> + </sect1> + <sect1 id="s1-vim-keymapping"> + <title>VIM 中的按键映射</title> + <para>VIM 可以使创建 DocBook 文档更加快捷,只要将经常使用的标记 (或任何词汇短语) 定义为快捷键。默认情况下,键盘映射以反斜线 (<literal>\</literal>) 开始,但是也可以用命令定义,类似 <userinput>let mapleader = + ","</userinput>。有两种方式来使用下面的例子;您可以将它写在 <filename>.vimrc</filename> 文件中,或者将它保存为单独的文件,并在 <filename>.vimrc</filename> 文件中以 <userinput>source</userinput> 命令加载。<screen><programlisting><![CDATA[ +let mapleader = "," + +" skip ahead to after next tag without leaving insert mode +imap <leader>e <esc>/><cr>:nohlsearch<cr>a + +" common tags that start a new text block +imap<leader>pa <para><cr></para><esc>O +imap<leader>s1 <sect1 id=""><cr><para><esc>jo</sect1><esc>O +imap<leader>pl <programlisting><cr></programlisting><esc>O<esc>0i +imap<leader>cp <computeroutput></computeroutput><esc>O<esc>0i + +" common tags that are placed inline +" use <esc>F>a +imap<leader>en <envar></envar><esc>F>a +imap<leader>fi <filename></filename><esc>F>a +imap<leader>lt <literal></literal><esc>F>a +imap<leader>re <replaceable></replaceable><esc>F>a +imap<leader>ui <userinput></userinput><esc>F>a +imap<leader>ul <ulink url=""></ulink><esc>F>a +imap<leader>si <systemitem></systemitem><esc>F>a +imap<leader>us <systemitem class="username"></systemitem><esc>F>a +imap<leader>sy <systemitem class="systemname"></systemitem><esc>F>a +imap<leader>cm <command></command><esc>F>a +" entities +imap <leader>> > +imap <leader>< < +]]></programlisting></screen></para> + <para>不幸的是,这不是所有 DocBook 命令的完整集合,因此您需要自行定义,或定制 <xref linkend="s1-vim-additional-resources"/> 范例中的定义。</para> + </sect1> + <sect1 id="s1-vim-additional-resources"> + <title>其他 VIM 资源</title> + <para>其他 VIM 相关的资源可以在这里找到:</para> + <itemizedlist> + <listitem> + <para> + <ulink url="http://newbiedoc.sourceforge.net/text_editing/vim.html#JESSE-SGMLRC"> 示例 sgml-vimrc</ulink>,来自 <citetitle>Beginner's guide to Vi Improved (VIM)</citetitle></para> + </listitem> + <listitem> + <para> + <ulink url="http://tnerual.eriogerg.free.fr/vim.html">VIM Quick Reference Card</ulink> + </para> + </listitem> + <listitem> + <para> + <ulink url="http://www.pinkjuice.com/howto/vimxml/">Vim 作为 XML 编辑器</ulink> + </para> + </listitem> + <listitem> + <para> + <citetitle>VIM REFERENCE MANUAL</citetitle>,包含在 <filename>vim-common</filename> 软件包中 — <filename>/usr/share/vim/<replaceable><version></replaceable>/doc/intro.txt</filename>,可以在 VIM 中执行 <userinput>:help intro</userinput> 查看。</para> + </listitem> + </itemizedlist> + </sect1> +</chapter> diff --git a/docs-xml-tags-zh_CN.xml b/docs-xml-tags-zh_CN.xml new file mode 100644 index 0000000..7cc752d --- /dev/null +++ b/docs-xml-tags-zh_CN.xml @@ -0,0 +1,1615 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: docs-xml-tags-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --><chapter id="ch-xml-tags"> + <title>DocBook XML 标记</title> + <indexterm> + <primary>XML</primary> + <secondary>标记</secondary> + <see>XML 标记</see> + </indexterm> + <para>请仔细阅读这一章。这一章描述了 Docs Project 使用的标记。一些规则是 Docs Project 特定的。</para> + <para>如果这些标记运用合适,搜索文档时可以得到有意义的结果。这些标记帮助搜索引擎确认与搜索条件相关的信息。另一个好处是使 &PROJECT; 文档拥有相同的外观。(不过,由于输出格式不同,外观仍然会有一些区别。)</para> + <indexterm> + <primary>XML</primary> + <secondary>标记概要</secondary> + </indexterm> + <para>XML 中所有标记必须有开标记和闭标记。另外,按照惯例,章、节、图象、表格等必须有唯一的标识符,这样可以被正确标识,需要的话也可以交叉引用。</para> + <para>尽管 XML 可以处理很多文档形式,这里介绍的只是 article 一种。</para> + <para>本章只介绍 &PROJECT; 文档使用的标记,并不是所有可用的 DocBook XML 标记。完整的列表请参考:</para> + <screen> + <computeroutput> + <ulink url="http://www.docbook.org/tdg/en/html/docbook.html">http://www.docbook.org/tdg/en/html/docbook.html</ulink> + </computeroutput> + </screen> + <sect1 id="s1-xml-tags-caveats"> + <title>标记和实体警告</title> + <indexterm> + <primary>xml 标记</primary> + <secondary>警告</secondary> + </indexterm> + <para>应当牢记本节的警告。它们比有效的 DocBook XML 更加严格,这些规则的存在,是为了使 HTML 和 PDF 输出看起来更合适。</para> + <variablelist> + <varlistentry> + <term>不要使用商标实体</term> + <listitem> + <para>不要使用商标实体 &trade;, &copy;, 或 &reg; 因为它们无法为所有字符集产生 HTML 输出。这些实体产生的 HTML 输出定义在 DTD 中,无法通过样式表改变。</para> + <para>应当使用 <command>trademark</command> 标记以及相关类别,如下所示:</para> + <itemizedlist> + <listitem> + <para><trademark>其后是商标符号</trademark></para> + </listitem> + <listitem> + <para><trademark class="registered">其后是注册商标符号</trademark></para> + </listitem> + <listitem> + <para><trademark class="copyright">其后是版权符号</trademark></para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term> + <command>para</command> 标记中的内容</term> + <listitem> + <para>除非是文本段落,否则不要使用 <command>para</command>。这个标记在 PDF 中,会使其间的文本包含多余的空白。</para> + <para>特别的,在下列标记之外不要使用 <command>para</command> (换句话说,不要把下列标记包含在 <command>para</command> 中):</para> + <itemizedlist> + <listitem> + <para><screen></para> + </listitem> + <listitem> + <para><itemizedlist></para> + </listitem> + <listitem> + <para><orderedlist></para> + </listitem> + <listitem> + <para><variablelist></para> + </listitem> + <listitem> + <para><table></para> + </listitem> + </itemizedlist> + </listitem> + </varlistentry> + <varlistentry> + <term>包含在 <command>para</command> 标记中的 <command>listitem</command></term> + <listitem> + <para>包含在 <command>para</command> 中的 <command>listitem</command> 标记 <emphasis>必须</emphasis> 紧挨 <para> 的开始标记,以避免 PDF 中的多余空白。</para> + </listitem> + </varlistentry> + <varlistentry> + <term>包含在 <command>screen</command> 标记中的内容</term> + <listitem> + <para>XML 文件中,<command>screen</command> 标记 (<screen> 和 </screen>) <emphasis>必须</emphasis> 靠左对齐,<command>screen</command> 包含的内容必须同样靠左对齐,除非有意留出空白。否则,多余的空白将出现在 HTML 中。</para> + </listitem> + </varlistentry> + </variablelist> + </sect1> + <sect1 id="s1-xml-tags-application"> + <title> + <command>application</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>application</secondary> + </indexterm> + <para>application 是图形界面应用程序的名字。command 是一个可执行的程序,或者运行应用程序的命令。</para> + <para> + <command><application></command> 和 <command></application></command> 标记使您可以引用应用程序。例如,下面的 XML:</para> + <screen> + <computeroutput> +要在 Linux 中访问 Web,您可以使用 +<application>Mozilla</application> 或 +<application>lynx</application>,如果您只需要字符界面的话。 +</computeroutput> + </screen> + <para>产生如下输出:</para> + <para>要在 Linux 中访问 Web,您可以使用 +<application>Mozilla</application> 或 +<application>lynx</application>,如果您只需要字符界面的话。</para> + </sect1> + <sect1 id="s1-xml-tags-chapter"> + <title> + <command>chapter</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>chapter</secondary> + </indexterm> + <para>一篇 DocBook 文档可以划分为多章,类似:</para> + <screen> + <computeroutput> +<!--$Id: docs-xml-tags-zh_CN.xml,v 1.1 2005/12/09 15:28:54 bbbush Exp $ --> + + <chapter id="ch-sample"> + <title>示例章</title> + + <para>这是示例章,显示了用于创建章、节和小节的 XML 标记。</para> + + </chapter> +</computeroutput> + </screen> + <para>chapter 还可以进一步划分为节 (<command>sect1</command>, <command>sect2</command>, <command>sect3</command> 等等)。请参考 <xref linkend="s1-xml-tags-sections"/>。</para> + </sect1> + <sect1 id="s1-xml-tags-citetitle"> + <title> + <command>citetitle</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>citetitle</secondary> + </indexterm> + <para> + <command><citetitle></command>标记用来格式化一个特别的引用 (引用标题可以自行输入,也可以使用实体<footnote><para>实体是引用其他手册或教程的快捷方式。它可以在主控文档中定义,对于特定的文档集合,也可以在 DTD 引用的文件中定义。</para></footnote>,如果在文档中已经定义的话)。</para> + <para>例如:</para> + <screen> + <computeroutput> +<citetitle>IG;</citetitle>. +</computeroutput> + </screen> + <para>输出类似于 <citetitle>&IG;</citetitle>,因为 &IG; 是已定义的实体。</para> + </sect1> + <sect1 id="s1-xml-tags-command"> + <title> + <command>command</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>command</secondary> + </indexterm> + <para>application 是图形界面应用程序的名字。command 是一个可执行的程序,或者运行应用程序的命令。任何命令行程序,或是只有字符界面的工具都应以 <command>command</command> 标记。</para> + <para>如果某些文本是一个命令,那就用 <command><command></command> 和 <command></command></command> 标记:</para> + <screen> + <computeroutput> +要在安装后改变键盘设置,切换为 root 并使用 <command>redhat-config-keyboard</command> 命令,或者在 root 提示符下输入 <command>setup</command>。 +</computeroutput> + </screen> + <para>输出:</para> + <para>要在安装后改变键盘设置,切换为 root 并使用 <command>redhat-config-keyboard</command> 命令,或者在 root 提示符下输入 <command>setup</command>。</para> + <para>另一个例子:</para> + <screen> + <computeroutput> +<command>MAILNOVIOLATIONS</command> — 如果设置为 <command>true</command>,这个选项使得 Tripwire 定时发送邮件报告,无论是否出现了越权操作。默认值是 <command>true</command>。 +</computeroutput> + </screen> + <para>输出:</para> + <para> + <command>MAILNOVIOLATIONS</command> — 如果设置为 <command>true</command>,这个选项使得 Tripwire 定时发送邮件报告,无论是否出现了越权操作。默认值是 <command>true</command>。</para> + <note> + <title>注意</title> <para>本例中,选项值 (true) 被标记为 <command>。由于选项是出现在配置文件中的,(命令行选项应当使用 <option> 标记,)并且由于没有为配置文件选项定义什么标记,我们约定使用 <command> 标记配置文件中的选项。</para></note> + <para>名词也标记为 <command>command</command>,因为没有其他合适的标记:</para> + <itemizedlist> + <listitem> + <para>配置文件中的选项,类似 Apache 指令</para> + </listitem> + <listitem> + <para>守护进程名称</para> + </listitem> + </itemizedlist> + </sect1> + <sect1 id="s1-xml-tags-compoutput"> + <title> + <command>computeroutput</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>computeroutput</secondary> + </indexterm> + <para>要显示屏幕输出,使用这个标记:</para> + <screen> + <computeroutput> +<computeroutput>您是否要删除文件? y n</computeroutput> +</computeroutput> + </screen> + <para>输出:</para> + <para> + <computeroutput>您是否要删除文件? y n</computeroutput> + </para> + </sect1> + <sect1 id="s1-xml-tags-emphasis"> + <title> + <command>emphasis</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>emphasis</secondary> + </indexterm> + <para>要强调的内容,使用 <command><emphasis></command> 和 <command></emphasis></command> 标记。例如:</para> + <screen> + <computeroutput> +安装过程将 <emphasis>删除所有</emphasis> 硬盘上的 <emphasis>所有</emphasis> 已有 Linux 分区,非 Linux 分区不会被删除。 +</computeroutput> + </screen> + <para>输出:</para> + <para>安装过程将 <emphasis>删除所有</emphasis> 硬盘上的 <emphasis>所有</emphasis> 已有 Linux 分区,非 Linux 分区不会被删除。</para> + </sect1> + <sect1 id="s1-xml-tags-example"> + <title> + <command>example</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>example</secondary> + </indexterm> + <para> + <command><example></command> 和 <command></example></command> 标记用来格式化某个文档中的文本,适于显示代码示例等。</para> + <para> + <command><example></command> 标记应当有一个 ID 和标题:</para> + <screen> + <example id="static-ip"> + <title>使用 DHCP 的静态 IP 地址</title> + +<screen width=60> +<computeroutput> +host apex { + option host-name "apex.example.com"; + hardware ethernet 00:A0:78:8E:9E:AA; + fixed-address 192.168.1.4; +} +<computeroutput> +</screen> + + </example> +</screen> + <para>输出:</para> + <example id="static-ip"> + <title>使用 DHCP 的静态 IP 地址</title> + <screen> + <computeroutput> +host apex { + option host-name "apex.example.com"; + hardware ethernet 00:A0:78:8E:9E:AA; + fixed-address 192.168.1.4; +} +</computeroutput> + </screen> + </example> + </sect1> + <sect1 id="s1-xml-tags-filename"> + <title> + <command>filename</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>filename</secondary> + </indexterm> + <para> + <command><filename></command> 和 <command></filename></command> 标记定义文件名和路径。由于目录是特殊的文件,因此也使用 <command>filename</command> 标记。例如:</para> + <screen> +编辑 <filename>/home/smoore/sam.xml</filename> 文件,修改它或加注释。 +</screen> + <para>输出:</para> + <para>编辑 <filename>/home/smoore/sam.xml</filename> 文件,修改它或加注释。</para> + <para>它们也用来标记 RPM 软件包名称。例如:</para> + <screen> +要使用 <application>Keyboard Configuration Tool</application>,必须安装 <filename>system-config-keyboard</filename> 软件包。 +</screen> + <para>输出:</para> + <para>要使用 <application>Keyboard Configuration Tool</application>,必须安装 <command>redhat-config-keyboard</command> 软件包。</para> + <note> + <title>注意</title> + <para>目录名必须以斜线 (<computeroutput>/</computeroutput>) 结尾,以与文件名区分。</para> + </note> + </sect1> + <sect1 id="s1-xml-tags-firstterm"> + <title> + <command>firstterm</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>firstterm</secondary> + </indexterm> + <para> + <command><firstterm></command> 和 <command></firstterm></command> 标记用来定义一个用户不熟悉,但将频繁出现的词。例如:</para> + <screen> + <computeroutput> +几乎所有现代操作系统都使用 <firstterm>disk +partitions</firstterm>(磁盘分区),&FC; 也不例外。 +</computeroutput> + </screen> + <para>输出:</para> + <para>几乎所有现代操作系统都使用 <firstterm>disk partitions</firstterm>(磁盘分区),&FC; 也不例外。</para> + </sect1> + <sect1 id="s1-xml-tags-footnote"> + <title> + <command>footnote</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>footnote</secondary> + </indexterm> + <para>如果您需要添加脚注,可以这样:</para> + <screen> + <computeroutput> +如果您想进行服务器级 +<footnote> +<para> +服务器级安装用于安装典型的服务器环境。注意,服务器级安装不会安装图形界面。 +</para> +</footnote> 安装,请参考 <citetitle>Installation Guide</citetitle>。 +</computeroutput> + </screen> + <para>输出:</para> + <para>如果您想进行服务器级 <footnote><para>服务器级安装用于安装典型的服务器环境。注意,服务器级安装不会安装图形界面。</para></footnote> 安装,请参考 <citetitle>Installation Guide</citetitle>。</para> + </sect1> + <sect1 id="s1-xml-tags-figure"> + <title> + <command>figure</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>figure</secondary> + </indexterm> + <important> + <title>注意</title> + <para>顺序很重要!EPS 文件 <emphasis>必须</emphasis> 首先声明。</para> + </important> + <para>示例图象声明:</para> + <screen> + <computeroutput> +<figure id="fig-ksconfig-basic"> + <title>基本设置</title> + <mediaobject> + <imageobject> + <imagedata fileref="./figs/ksconfig/ksconfig-basic.eps" + format="EPS"/> + </imageobject> + <imageobject> + <imagedata fileref="./figs/ksconfig/ksconfig-basic.png" + format="PNG"/> + </imageobject> + <textobject> + <phrase> + 一些关于图象的文本描述 + </phrase> + </textobject> + </mediaobject> +</figure> +</computeroutput> + </screen> + <para>下面列出了需要修改的内容:</para> + <screen> +<figure id="fig-ksconfig-basic"> <emphasis>==> id="" 可以修改</emphasis> + +<title>基本设置</title> <emphasis>==> 标题可以修改</emphasis> + +fileref="./figs/ksconfig/ksconfig-basics.eps"> <emphasis>==> .eps 位置可以修改</emphasis> + +fileref="./figs/ksconfig/ksconfig-basics.png"> <emphasis>==> .png 位置可以修改</emphasis> + +<phrase>一些关于图象的文本描述</phrase> <emphasis>==> "一些关于..." 可以修改</emphasis></screen> + <para>关于获取屏幕截图,请参考 <xref linkend="s1-screenshots"/>。</para> + </sect1> + <sect1 id="s1-xml-tags-gui"> + <title>图形用户界面标记</title> + <indexterm> + <primary>XML 标记</primary> + <secondary>GUI 标记</secondary> + </indexterm> + <sect2 id="s2-xml-tags-guilabel"> + <title> + <command>guilabel</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>GUI 标记</secondary> + <tertiary>guilabel</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>guilabel</secondary> + </indexterm> + <para>使用 <command><guilabel></command> 和 <command></guilabel></command> 作为描述 GUI 时的默认标记,类似窗体名称或窗体标题。例如:</para> + <screen> + <computeroutput> +<guilabel>Authentication Configuration</guilabel> 屏幕指引您如何配置更安全的系统。 +</computeroutput> + </screen> + <para>输出:</para> + <para> + <guilabel>Authentication Configuration</guilabel> 屏幕指引您如何配置更安全的系统。</para> + </sect2> + <sect2 id="s2-xml-tags-guibutton"> + <title> + <command>guibutton</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>GUI 标记</secondary> + <tertiary>guibutton</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>guibutton</secondary> + </indexterm> + <para>使用 <command><guibutton></command> 和 <command></guibutton></command> 标记表示屏幕或菜单中的按钮。例如:</para> + <screen> + <computeroutput> +选择 <guibutton>Activate on boot</guibutton> 按钮,配置 X 窗口系统自动启动。 +</computeroutput> + </screen> + <para>输出:</para> + <para>选择 <guibutton>Activate on boot</guibutton> 按钮,配置 X 窗口系统自动启动。</para> + </sect2> + <sect2 id="s2-xml-tags-guiicon"> + <title> + <command>guiicon</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>GUI 标记</secondary> + <tertiary>guiicon</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>guiicon</secondary> + </indexterm> + <para> + <command><guiicon></command> 和 <command></guiicon></command> 标记用来表示面板或桌面图标。例如:</para> + <screen> + <computeroutput> +双击桌面上的 <guiicon>Start Here</guiicon> 图标。 +</computeroutput> + </screen> + <para>输出:</para> + <para>双击桌面上的 <guiicon>Start Here</guiicon> 图标。</para> + </sect2> + <sect2 id="s2-xml-tags-guimenu"> + <title> + <command>guimenu</command> 和 <command>guimenuitem</command></title> + <indexterm> + <primary>XML 标记</primary> + <secondary>GUI 标记</secondary> + <tertiary>guimenu</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>guimenu</secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>GUI 标记</secondary> + <tertiary>guimenuitem</tertiary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>guimenuitem</secondary> + </indexterm> + <para>要表示一个菜单 (安装程序或控制面板中的菜单),使用 <command><guimenu></command> 和 <command></guimenu></command> 标记。</para> + <para>要表示子菜单,使用 <command><guimenuitem></command> 和 <command></guimenuitem></command> 标记。(请注意示例中为了输出需要,插入了一些换行。)例如:</para> + <screen> + <computeroutput> +选择 <guimenu>Main Menu</guimenu> => + <guimenuitem>Programming</guimenuitem> => <guimenuitem>Emacs</guimenuitem> 来启动 +<application>Emacs</application> 编辑器。 +</computeroutput> + </screen> + <para>输出:</para> + <para>选择 <guimenu>Main Menu</guimenu> => <guimenuitem>Programming</guimenuitem> => <guimenuitem>Emacs</guimenuitem> 来启动 <application>Emacs</application> 编辑器。</para> + </sect2> + </sect1> + <sect1 id="s1-xml-tags-keycap"> + <title> + <command>keycap</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>keycap</secondary> + </indexterm> + <para>要表示某个按键,应当使用 <command><keycap></command> 和 <command></keycap></command> 标记。按键会自动加上尖括号,因此不要在 XML 代码中再加一次。例如:</para> + <screen> + <computeroutput> +要作出选择,按下 <keycap>Enter</keycap> 键。 +</computeroutput> + </screen> + <para>输出:</para> + <para>要作出选择,按下 <keycap>Enter</keycap> 键。</para> + <sect2 id="s2-xml-tags-menuchoice"> + <title> + <command>menuchoice</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>menuchoice</secondary> + </indexterm> + <para>通常,使用鼠标对于频繁的操作过于繁琐。因此,程序员在程序中设置了快捷键来简化使用。应当使用 <command>shortcut</command> 标记包含 <command>keycap</command> 标记,然后再整个包含在 <command>menuchoice</command> 标记中,来表示快捷键。例如:</para> + <screen> + <computeroutput> +打开菜单并选择: + <menuchoice> + <shortcut> + <keycombo><keycap>Ctrl</keycap><keycap>s</keycap></keycombo> + </shortcut> + <guimenu><accel>F</accel>ile</guimenu> + <guimenuitem><accel>S</accel>ave</guimenuitem> + </menuchoice>. +</computeroutput> + </screen> + <para>输出:</para> + <para>打开菜单并选择:<menuchoice><shortcut><keycombo><keycap>Ctrl</keycap><keycap>s</keycap></keycombo></shortcut><guimenu><accel>F</accel>ile</guimenu><guimenuitem><accel>S</accel>ave</guimenuitem></menuchoice>.</para> + </sect2> + <sect2 id="s2-xml-tags-keycombo"> + <title> + <command>keycombo</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>keycombo</secondary> + </indexterm> + <para>要描述按键组合,使用 <command><keycombo></command> 和 <command></keycombo></command>, <command><keycap></command> 和 <command></keycap></command> 标记。例如:</para> + <screen> + <computeroutput> +要重启系统,按下 <keycombo> +<keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Del</keycap> +</keycombo>. +</computeroutput> + </screen> + <para>输出:</para> + <para>要重启系统,按下 <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Del</keycap></keycombo>.</para> + </sect2> + </sect1> + <sect1 id="s1-xml-tags-lists"> + <title>列表</title> + <indexterm> + <primary>列表</primary> + <secondary>创建</secondary> + </indexterm> + <para>您可以用 XML 创建多种列表。您可以创建无序的枚举,有序的编号列表,或是变量表 (先是一个词,然后是单独的一段话)。</para> + <para>还有一种列表适于表格,最后一种是用于定义词汇解释的列表。</para> + <para>下面各节描述了各种列表,以及如何创建。</para> + <sect2 id="s2-xml-tags-itemizedlist"> + <title> + <command>itemizedlist</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary> + <command>itemizedlist</command> + </secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>列表</secondary> + <tertiary>itemizedlist</tertiary> + </indexterm> + <indexterm> + <primary>列表</primary> + <secondary> + <command>itemizedlist</command> + </secondary> + </indexterm> + <para> + <command>itemizedlist</command> 适于向读者呈现重要的信息,而信息是无序的。它比 <command>variablelist</command> 更短,也简单一点。</para> + <para>要创建 <command>itemizedlist</command> (也称为枚举列表),可以这样:</para> + <note> + <title>注意</title> <para>下面列表中的文本是直接包含在 <command>para</command> 标记中的。如果您使用列表,不要用这个标记,否则列表中会包含多余空白,无法对齐。如果多个列表项是多行文本,空白会更加明显。HTML 版本不会像 PDF 版本那样明显。</para></note> + <screen> + <computeroutput> +<itemizedlist> + <listitem> + <para>熟悉安装程序的界面</para> + </listitem> + + <listitem> + <para>开始安装程序</para> + </listitem> + + <listitem> + <para>选择安装方法</para> + </listitem> +</itemizedlist> +</computeroutput> + </screen> + <para>输出:</para> + <itemizedlist> + <listitem> + <para>熟悉安装程序的界面</para> + </listitem> + <listitem> + <para>开始安装程序</para> + </listitem> + <listitem> + <para>选择安装方法</para> + </listitem> + </itemizedlist> + </sect2> + <sect2 id="s2-xml-tags-orderedlist"> + <title> + <command>orderedlist</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary> + <command>orderedlist</command> + </secondary> + </indexterm> + <indexterm> + <primary>列表</primary> + <secondary> + <command>orderedlist</command> + </secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>列表</secondary> + <tertiary>orderedlist</tertiary> + </indexterm> + <para> + <command>orderedlist</command> 适于向读者显示必须以一定顺序出现的信息。<command>orderedlist</command> 用来向读者描述一步一步的场景转换很不错。</para> + <para>要创建 <command>orderedlist</command> (有序列表) 可以这样:</para> + <note> + <title>注意</title> <para>下面列表中的文本是直接包含在 <command>para</command> 标记中的。如果您使用列表,不要用这个标记,否则列表中会包含多余空白,无法对齐。如果多个列表项是多行文本,空白会更加明显。HTML 版本不会像 PDF 版本那样明显。</para></note> + <screen> + <computeroutput> +<orderedlist> + <listitem> + <para>在线 &mdash; http://www.redhat.com/support/errata; 提供 + 可以在线阅读的更正,您也可以下载光盘镜像。 + </para> + </listitem> + + <listitem> + <para>电子邮件 &mdash; 发送空白邮件到 errata@redhat.com, + 您将收到完整的包含安装程序和相关软件 (如果有的话) 的更正说明。 + 同时还包括软件更新以及光盘镜像的 URL。通过这些 URL 来下载 + 镜像。请注意:下载时使用二进制模式。</para> + </listitem> +</orderedlist> +</computeroutput> + </screen> + <para>输出:</para> + <orderedlist> + <listitem> + <para>在线 — http://www.redhat.com/support/errata; 提供可以在线阅读的更正,您也可以下载光盘镜像。</para> + </listitem> + <listitem> + <para>电子邮件 — 发送空白邮件到 errata@redhat.com, 您将收到完整的包含安装程序和相关软件 (如果有的话) 的更正说明。同时还包括软件更新以及的光盘镜像的 URL。通过这些 URL 来下载镜像。请注意:下载时使用二进制模式。</para> + </listitem> + </orderedlist> + </sect2> + <sect2 id="s2-xml-tags-varlist"> + <title> + <command>variablelist</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary> + <command>variablelist</command> + </secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>列表</secondary> + <tertiary>variablelist</tertiary> + </indexterm> + <indexterm> + <primary>列表</primary> + <secondary> + <command>variablelist</command> + </secondary> + </indexterm> + <para> + <command>variablelist</command> 适于表现一个词以及相关的解释和描述。</para> + <para>要创建 <command>variablelist</command> 可以这样:</para> + <note> + <title>注意</title> <para>下面列表中的文本是直接包含在 <command>para</command> 标记中的。如果您使用列表,不要用这个标记,否则列表中会包含多余空白,无法对齐。如果多个列表项是多行文本,空白会更加明显。HTML 版本不会像 PDF 版本那样明显。</para></note> + <screen> + <computeroutput> +<variablelist> + <varlistentry> + <term> 新的多介质安装过程 </term> + <listitem> + <para>由于安装程序越来越大,RedHat 开发了 + 可以处理多张 CD-ROM 介质的安装程序。</para> + </listitem> + </varlistentry> + + <varlistentry> + <term>XFree 4.0 </term> + <listitem> + <para>X 窗口系统的配置从来没有如此简单。 + 从选择显示器及其设置,到显卡探测,以及测试您期望的 X 窗口设置, + Xconfigurator 可以搞定一切。</para> + </listitem> + </varlistentry> +</variablelist> +</computeroutput> + </screen> + <para>输出:</para> + <variablelist> + <varlistentry> + <term>新的多介质安装过程</term> <listitem> <para>由于安装程序越来越大,RedHat 开发了可以处理多张 CD-ROM 介质的安装程序。</para></listitem></varlistentry> + <varlistentry> + <term>XFree 4.0</term> + <listitem> + <para>X 窗口系统的配置从来没有如此简单。从选择显示器及其设置,到显卡探测,以及测试您期望的 X 窗口设置,Xconfigurator 可以搞定一切。</para> + </listitem> + </varlistentry> + </variablelist> + <warning> + <title>警告</title> + <para> + <emphasis>不要</emphasis> 设置表格的 <computeroutput>frame</computeroutput> 属性,否则 PDF 生成会失败。</para> + </warning> + </sect2> + <sect2 id="s2-xml-tags-simplelist"> + <title>在表格中创建列表,使用 <command>simplelist</command></title> + <indexterm> + <primary>XML 标记</primary> + <secondary> + <command>simplelist</command> + </secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>列表</secondary> + <tertiary>simplelist</tertiary> + </indexterm> + <indexterm> + <primary>列表</primary> + <secondary> + <command>simplelist</command> + </secondary> + </indexterm> + <indexterm> + <primary>表格</primary> + <secondary>在表格中创建列表</secondary> + <tertiary> + <command>simplelist</command> + </tertiary> + </indexterm> + <para> + <command>simplelist</command> 是无修饰的列表。<command>simplelist</command> 可以内联或按列对齐。</para> + <para>使用 <command>simplelist</command> 在表格内添加分离的文本段落。通常的列表,例如 <command>itemizedlist</command>,不能嵌入在表格内。</para> + <para>XML 代码如下:</para> + <screen> + <computeroutput> + <table id="tb-hwinfo-hostbus"> + <title>主机总线适配器特性及配置要求</title> + + <tgroup cols="3"> + <colspec colnum="1" colname="HostBus" colwidth="33"/> + <colspec colnum="2" colname="Features" colwidth="34"/> + <colspec colnum="3" colname="Single" colwidth="33"/> + + <thead> + <row> + <entry>主机总线适配器</entry> + <entry>特性</entry> + <entry>Single-Initiator 配置</entry> + </row> + </thead> + + <tbody> + + <row> + <entry>Adaptec 2940U2W</entry> + + <entry><simplelist> + <member>Ultra2, wide, LVD.</member> + <member>HD68 external connector.</member> + <member>One channel, with two bus segments.</member> + <member>Set the onboard termination by using the BIOS + utility.</member> + <member>Onboard termination is disabled when the power is + off.</member> + </simplelist></entry> + + <entry><simplelist> + <member>Set the onboard termination to automatic (the + default).</member> + <member>Use the internal SCSI connector for private + (non-cluster) storage.</member> + </simplelist></entry> + </row> + + <row> + <entry>Qlogic QLA1080</entry> + + <entry><simplelist> + <member>Ultra2, wide, LVD</member> + <member>VHDCI external connector</member> + <member>One channel</member> + <member>Set the onboard termination by using the BIOS + utility.</member> + <member>Onboard termination is disabled when the power is off, + unless jumpers are used to enforce termination.</member> + </simplelist></entry> + + + <entry><simplelist> + <member>Set the onboard termination to + automatic (the default).</member> + <member>Use the internal SCSI connector for private + (non-cluster) storage.</member> + </simplelist></entry> + </row> + + </tbody> + </tgroup> + </table> +</computeroutput> + </screen> + <para>输出:</para> + <table id="tb-hwinfo-hostbus"> + <title>主机总线适配器特性及配置要求</title> + <tgroup cols="3"> + <colspec colname="HostBus" colnum="1" colwidth="33"/> + <colspec colname="Features" colnum="2" colwidth="34"/> + <colspec colname="Single" colnum="3" colwidth="33"/> + <thead> + <row> + <entry>主机总线适配器</entry> + <entry>特性</entry> + <entry>Single-Initiator 配置</entry> + </row> + </thead> + <tbody> + <row> + <entry>Adaptec 2940U2W</entry> + <entry> + <simplelist> + <member>Ultra2, wide, LVD.</member> + <member>HD68 external connector.</member> + <member>One channel, with two bus segments.</member> + <member>Set the onboard termination by using the BIOS utility.</member> + <member>Onboard termination is disabled when the power is off.</member> + </simplelist> + </entry> + <entry> + <simplelist> + <member>Set the onboard termination to automatic (the default).</member> + <member>Use the internal SCSI connector for private (non-cluster) storage.</member> + </simplelist> + </entry> + </row> + <row> + <entry>Qlogic QLA1080</entry> + <entry> + <simplelist> + <member>Ultra2, wide, LVD</member> + <member>VHDCI external connector</member> + <member>One channel</member> + <member>Set the onboard termination by using the BIOS utility.</member> + <member>Onboard termination is disabled when the power is off, unless jumpers are used to enforce termination.</member> + </simplelist> + </entry> + <entry> + <simplelist> + <member>Set the onboard termination to automatic (the default).</member> + <member>Use the internal SCSI connector for private (non-cluster) storage.</member> + </simplelist> + </entry> + </row> + </tbody> + </tgroup> + </table> + <note> + <title>注意</title> + <para>注意 <command>simplelist</command> 标记的用法。<entry> 和 <simplelist> 标记必须靠紧,否则将产生解析错误。</para> + </note> + <para>每个要加入 <command>simplelist</command> 的段落或列表项应当包含在 <member> 标记中。</para> + </sect2> + <sect2 id="s2-xml-tags-glossary"> + <title> + <command>glosslist</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary> + <command>glosslist</command> + </secondary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>列表</secondary> + <tertiary>glosslist</tertiary> + </indexterm> + <indexterm> + <primary>列表</primary> + <secondary> + <command>glosslist</command> + </secondary> + </indexterm> + <para>使用 <command>glosslist</command> 来创建词汇表和解释。</para> + <para>XML 代码如下:</para> + <screen> + <computeroutput> + <glosslist> + <glossentry> + <glossterm>applet</glossterm> + <glossdef> + <para>一个小程序,通常是实用工具或简单程序。</para> + </glossdef> + </glossentry> + + <glossentry> + <glossterm>architecture</glossterm> + <glossdef> + <para>计算机或计算机系统中, + 组件的组织和整合的设计。</para> + </glossdef> + </glossentry> + + <glossentry> + <glossterm>archive</glossterm> + <glossdef> + <para>将文件传送到存储设备,以节省空间和/或 + 加以组织。</para> + </glossdef> + </glossentry> + </glosslist> +</computeroutput> + </screen> + <para>输出:</para> + <glosslist> + <glossentry> + <glossterm>applet</glossterm> + <glossdef> + <para>一个小程序,通常是实用工具或简单程序。</para> + </glossdef> + </glossentry> + <glossentry> + <glossterm>architecture</glossterm> + <glossdef> + <para>计算机或计算机系统中,组件的组织和整合的设计。</para> + </glossdef> + </glossentry> + <glossentry> + <glossterm>archive</glossterm> + <glossdef> + <para>将文件传送到存储设备,以节省空间和/或加以组织。</para> + </glossdef> + </glossentry> + </glosslist> + </sect2> + </sect1> + <sect1 id="s1-xml-tags-option"> + <title> + <command>option</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>option</secondary> + </indexterm> + <para>如果您的命令需要选项或设置标志,使用 <command><option></command> 和 <command></option></command> 标记。</para> + <note> + <title>注意</title> + <para><option> 标记只用于命令行选项,不用于配置文件。</para> + </note> + <para>指定选项的 XML 代码如下:</para> + <screen> + <computeroutput> +例如,运行命令 <command>ls</command> 时可以指定选项 <option>-la</option>。 +</computeroutput> + </screen> + <para>输出:</para> + <para>例如,运行命令 <command>ls</command> 时可以指定选项 <option>-la</option>。</para> + </sect1> + <sect1 id="s1-xml-tags-indexing"> + <title>索引节点</title> + <indexterm> + <primary>创建索引</primary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>创建索引</secondary> + </indexterm> + <para>下面的命令序列展示了如何向文档中添加一个索引项的代码:</para> + <screen> + <computeroutput> +<indexterm> <-- 这是要在索引中添加的词汇 +<primary>foo</primary> <-- 表示 "foo" 是首要条目 +<secondary>bar</secondary> <-- "bar" 将列在 "foo" 条目之下 +</indexterm> <-- 关闭索引项 +</computeroutput> + </screen> + <indexterm> + <primary>foo</primary> + <secondary>bar</secondary> + </indexterm> + <para> + <command><seealso></command> 标记允许您引用另一个索引项或其他手册。应确保您指向的 <command><seealso></command> 引用有自己的节点。例如:</para> + <indexterm> + <primary>创建索引</primary> + <secondary>seealso 标记</secondary> + </indexterm> + <screen> + <computeroutput> +<indexterm> +<primary>SWAK</primary> +<seealso>salutations</seealso> +</indexterm> + + +<indexterm> +<primary>salutations</primary> +</indexterm> +</computeroutput> + </screen> + <indexterm> + <primary>SWAK</primary> + <seealso>Salutations</seealso> + </indexterm> + <indexterm> + <primary>Salutations</primary> + </indexterm> + <para> + <command><see></command> 标记允许您引用一个完整的索引节点。例如:</para> + <indexterm> + <primary>创建索引</primary> + <secondary>see 标记</secondary> + </indexterm> + <screen> + <computeroutput> +<indexterm> +<primary>Guinness</primary> +<see>beer</see> <-- "beer" 将被列在 "Guinness" 条目下,但是应确保所引用的 "beer" 有自己的索引节点。 +</indexterm> + +<indexterm> +<primary>beer</primary> +</indexterm> +</computeroutput> + </screen> + <indexterm> + <primary>Guinness</primary> + <see>Beer</see> + </indexterm> + <indexterm> + <primary>Beer</primary> + </indexterm> + <para>要查看这里的索引节点的 HTML 输出,请参考文档最后的 <filename>generated-index.html</filename> 文件。</para> + <para>索引是如何生成的? 如果文档中包含 indexterm,并且开标记和闭标记出现在文档或文章的结束标记之前,就创建索引,因为样式表参数 <command>generate.index</command> 的默认值是真。</para> + </sect1> + <sect1 id="s1-xml-tags-para"> + <title> + <command>para</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>para</secondary> + </indexterm> + <para>对于任意一段,<command><para></command> 和 <command></para></command> 标记必须作为这一段的开始和结束。</para> + <para>不要在除了简单段落之外使用 <command>para</command> 标记。否则,文本内部会产生多余的空白。</para> + <para>在下列标记周围不要使用 <command><para></command> (换句话说,不要把下列标记放在 <command><para></command> 标记中):</para> + <itemizedlist> + <listitem> + <para> + <command><screen></command> + </para> + </listitem> + <listitem> + <para> + <command><itemizedlist></command> + </para> + </listitem> + <listitem> + <para> + <command><orderedlist></command> + </para> + </listitem> + <listitem> + <para> + <command><variablelist></command> + </para> + </listitem> + <listitem> + <para> + <command><table></command> + </para> + </listitem> + </itemizedlist> + </sect1> + <sect1 id="s1-xml-tags-part"> + <title> + <command>part</command> + </title> + <indexterm> + <primary>parts</primary> + </indexterm> + <indexterm> + <primary>XML 标记</primary> + <secondary>part</secondary> + </indexterm> + <para>在主控文件中,可以将章划分为部,以表示逻辑分组。例如,在主控文件中,以 <command>part</command> 标签包含章的实体:</para> + <screen> + <computeroutput> +<part id="pt-foo"> + <partintro> + <para>一些文本,对这一部分的介绍</para> + &CHAPTER; + + &ANOTHER-CHAPTER; +</part> +</computeroutput> + </screen> + <para>如果您创建了一个 part,应当对内容作一些介绍。例如:</para> + <screen> + <computeroutput> + <part id="pt-setup"> + <title>设置环境</title> + <partintro> + <para>本节讲述当您刚加入 Docs Group 时需要的信息。 + 您也许会再参考本节中,有关安装 &FC; 的信息。</para> + </partintro> +</computeroutput> + </screen> + <para>在 HTML 输出中,会生成单独的 HTML 页面,包含这一部的编号、标题、介绍和目录。在 PDF 输出中,这些信息会出现在单独的一页上。</para> + </sect1> + <sect1 id="s1-xml-tags-prompt"> + <title> + <command>prompt</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>prompt</secondary> + </indexterm> + <para>要显示提示符,类似 root 提示符或 DOS 提示符,使用 <command><prompt></command> 和 <command></prompt></command> 标记。例如:</para> + <screen> + <computeroutput> +在 <prompt>LILO:</prompt> 启动提示符下,输入 linux 来启动到 Linux 分区。 + +在 <prompt>C:\></prompt> 提示符下,输入... +</computeroutput> + </screen> + <para>输出:</para> + <para>在 <prompt>LILO:</prompt> 启动提示符下,输入 linux 来启动到 Linux 分区。</para> + <para>在 <prompt>C:\></prompt> 提示符下,输入...</para> + <note> + <title>注意</title> + <para>在显示计算机输出的范例时 (通常是在 <command>screen</command> 标记中),不要包含提示符或命令 (除非命令或提示符是您意图显示的计算机输出)。</para> + </note> + </sect1> + <sect1 id="s1-xml-tags-replaceable"> + <title> + <command>replaceable</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>replaceable</secondary> + </indexterm> + <para>要创建可替换的文本,使用 <command><replaceable></command> 和 <command></replaceable></command> 标记包围您用作可变值的文本。</para> + <para>这个例子演示了在引用 RPM 文件时如何使用 <command>replaceable</command> 标记。</para> + <screen> +foo-<replaceable>version-number</replaceable>.<replaceable>arch</replaceable>.rpm +</screen> + <para>输出:</para> + <screen> +foo-<replaceable>version-number</replaceable>.<replaceable>arch</replaceable>.rpm +</screen> + </sect1> + <sect1 id="s1-xml-tags-screen"> + <title> + <command>screen</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>screen</secondary> + </indexterm> + <para> + <command><screen></command> 标记用来格式化文档中的文本,适于用来添加代码示例,计算机输出等等。在 HTML 中,使用 Fedora CSS 文件,可以显示为灰色背景的方框。需要这种效果时,只要将开标记 <command><screen></command> 和闭标记 <command></screen></command> 包围在需要强调的文本前后。</para> + <important> + <title>注意</title> + <para>使用 <command><screen></command> 标记时,必须设置所包含的所有内容,包括 <command><screen></command> 标记本身为左对齐。这样,在转化为 HTML 时,在灰色背景内部文字之前不会出现多余的空白。</para> + </important> + <para> + <command><screen></command> 标记可能包含其他内联标记,类似 <command><computeroutput></command>, <command><userinput></command>, 或 <command><replaceable></command> 等等。其他内联标记未作要求。<command><screen></command> 标记本身可以提供足够的上下文,尤其对于简单的范例或列举文件而言。考虑范例的上下文,如果内联标记有助于阅读,那么就使用它。</para> + <para>如果您使用内联标记,牢记 <command><screen></command> 标记中的换行会在任何输出中生成换行。将标记与内容 <emphasis>放在同一行</emphasis>。不要在 <command><screen></command> 的内容中过分使用标记。</para> + <para> + <command><screen></command> 示例如下:</para> + <screen> + <computeroutput><screen> +这是 screen 的示例。其中无须使用 &lt;para&gt; 标记。 +</screen></computeroutput> + </screen> + <para>输出:</para> + <screen> +这是 screen 的示例。其中无须使用 <para> 标记。 +</screen> + <sect2 id="s2-xml-tags-screen-inline-tags"> + <title>在 <command>screen</command> 中使用内联标记</title> + <para>如果您在 <command><screen></command> 中使用内联标记,遵循下列准则以保持一致。如果 screen 的内容是配置文件的清单或程序的输出,使用 <command><computeroutput></command> 标记包含整个输出。如果用户应当在命令行照范例输入,或是配置文件,使用 <command><userinput></command> 标记。用简短的叙述性的话来区分输入和输出,如下所示:</para> + <screen> + <command><para></command> + 输入下面的命令: + <command></para></command><command><screen></command><command><userinput></command>command -sw file1<command></userinput></command><command></screen></command><command><para></command> + 可以看到下列输出: + <command></para></command><command><screen></command><command><computeroutput></command>Completed, time = 0.12 sec<command></computeroutput></command><command></screen></command></screen> + <para>输出:</para> + <para>输入下面的命令:</para> + <screen> + <userinput>command -sw file1</userinput> + </screen> + <para>可以看到下列输出:</para> + <screen> + <computeroutput>Completed, time = 0.12 sec</computeroutput> + </screen> + <note> + <title>注意</title> + <para>在 <command>screen</command> 标记中显示一条命令或命令序列时,不要显示提示符。</para> + </note> + <para>如果 <command><screen></command> 向读者显示如何修改文本的 <emphasis>一部分</emphasis>,可以将修改部分以内联的 <command><userinput></command> 标记。您可以在大块内联的 <command><computeroutput></command> 文本中使用 <command><userinput></command>。这时不要包含更多上下文,除非必须这么做。下面的示例演示了这些准则:</para> + <screen> + <command><para></command> + 编辑 <command><filename></command>/etc/sysconfig/init<command></filename></command> 文件,如下所示: + <command></para></command><command><screen></command> +GRAPHICAL=<command><userinput></command>yes<command></userinput></command><command></screen></command></screen> + <para>输出:</para> + <para>编辑 <filename>/etc/sysconfig/init</filename> 文件,如下所示:</para> + <screen> +GRAPHICAL=<userinput>yes</userinput></screen> + <para>对于如何在 <command>screen</command> 标记中使用 <command>replaceable</command> 标记,请参考 <xref linkend="s1-xml-tags-replaceable"/>。</para> + </sect2> + </sect1> + <sect1 id="s1-xml-tags-sections"> + <title>section</title> + <indexterm> + <primary>XML 标记</primary> + <secondary>节</secondary> + </indexterm> + <indexterm> + <primary>节</primary> + </indexterm> + <para>在文章中 (或者在 chapter 中,如果是 DocBook XML book 样式的话,类似 <citetitle>&IG;</citetitle>),可以细分为节和小节。<command><sect1></command> 总是最顶层的节。如果两个 section 级别相同,那么一个不能包含另一个 (section 2 可以包含在 section 1 里面,但是如果再创建新的 section 1,必须先关闭当前的 section 1)。大致的布局如下:</para> + <screen> + <computeroutput> +<sect1 id="s1-uniquename"> + <title>插入标题</title> + <para> + 内容文本。 + </para> + + + <sect2 id="s2-uniquename"> + <title>插入标题</title> + <para> + 内容文本。 + </para> + + <sect3 id="s3-uniquename"> + <title>插入标题</title> + <para> + 内容文本。 + </para> + + </sect3> + + </sect2> + +</sect1> +</computeroutput> + </screen> + <para>在 DocBook article 样式中,如果您只需要一级 section,可以使用 <command>section</command> 标记。例如:</para> + <screen> + <computeroutput> +<section id="sn-uniquename"> + <title>插入标题</title> + <para> + 内容文本。 + </para> +</section> +<section id="sn-anothername"> + <title>插入标题</title> + <para> + 内容文本。 + </para> +</section> +</computeroutput> + </screen> + </sect1> + <sect1 id="s1-xml-tags-table"> + <title> + <command>table</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>table</secondary> + </indexterm> + <para>下面是创建表格的范例。</para> + <screen> +<table id="tb-mockup-before-begin"> + <emphasis>这在 XML 中声明了一个表格,ID 是 <command>"tb-mockup-before-begin"</command>。</emphasis> + +<title>Available Features of GNOME and KDE</title> + +<tgroup cols="3"> + <emphasis>这在 XML 中声明了一个表格,包含三列。</emphasis> + +<colspec colnum="1" colname="Features" colwidth="3"/> + <emphasis><command>colspec</command> 表示您向 XML 声明的表格列信息。</emphasis> <emphasis><command>colnum="1"</command> 表示您对第一列的设定。</emphasis><emphasis><command>colname="Features"</command> 表示本列的标题是 "Features"。</emphasis><emphasis><command>colwidth="3"</command> 指定列宽。这里有些机关:如果两列的列宽分别是 1 和 2,那么 1 占据的页宽就是 2 的一半。但是,如果您需要让第一列比第二列的一半稍微宽一点,那么就用一个更大的数值,例如指定列宽分别为 10 和 20,然后把 10 增加到 11 或 12,这样就比第二列的 20 的一半大一点了。如果没有给定任何值,默认就是 1。</emphasis> + +<colspec colnum="2" colname="GNOME" colwidth="2"/> +<colspec colnum="3" colname="KDE" colwidth="2"/> + +<thead> + <emphasis>包含一个或多个表格行。</emphasis> + +<row> + <emphasis>包含一个或多个表格单元。</emphasis> + +<entry>Features</entry> + <emphasis>表格单元元素,一列表格单元中的一个,定义了行内的列。</emphasis> + +<entry>GNOME</entry> +<entry>KDE</entry> +</row> +</thead> + +<tbody> + <emphasis>包含一个或多个表格行,作为表格的主体。</emphasis> + +<row> +<entry>高度可定制</entry> +<entry>yes</entry> +<entry>yes</entry> +</row> +<row> +<entry>多种窗口管理器</entry> +<entry>yes</entry> +<entry>yes</entry> +</row> +<row> +<entry>互联网程序</entry> +<entry>yes </entry> +<entry>yes </entry> +</row> +</tbody> +</tgroup> +</table> +</screen> + <table id="tb-mockup-before-begin"> + <title>Available Features of GNOME and KDE</title> + <tgroup cols="3"> + <colspec colname="Features" colnum="1" colwidth="3"/> + <colspec colname="GNOME" colnum="2" colwidth="2"/> + <colspec colname="KDE" colnum="3" colwidth="2"/> + <thead> + <row> + <entry>特性</entry> + <entry>GNOME</entry> + <entry>KDE</entry> + </row> + </thead> + <tbody> + <row> + <entry>高度可定制</entry> + <entry>yes</entry> + <entry>yes</entry> + </row> + <row> + <entry>多种窗口管理器</entry> + <entry>yes</entry> + <entry>yes</entry> + </row> + <row> + <entry>互联网程序</entry> + <entry>yes</entry> + <entry>yes</entry> + </row> + </tbody> + </tgroup> + </table> + <sect2 id="s2-xml-tags-listintable"> + <title>在表格中创建列表</title> + <indexterm> + <primary>XML 标记</primary> + <secondary>table</secondary> + <tertiary>表格中的列表</tertiary> + </indexterm> + <para>在表格中创建列表比较困难,它要求严格的格式化以及一些 <application>Emacs</application> 无法完成的命令补全。</para> + <para>需要使用的标记是 <command><simplelist></command> 和 <command><member></command>。</para> + <para>下面是在表格中创建列表的例子。</para> + <screen> + <computeroutput> +<table id="tb-hardware-powerswitch"> + <title>不间断电源硬件</title> + <tgroup cols="4"> + <colspec colnum="1" colname="Hardware" colwidth="2"/> + <colspec colnum="2" colname="Quantity" colwidth="2"/> + <colspec colnum="3" colname="Description" colwidth="6"/> + <colspec colnum="4" colname="Required" colwidth="2"/> + + <thead> + <row> + <entry>Hardware</entry> + <entry>Quantity</entry> + <entry>Description</entry> + <entry>Required</entry> + </row> + </thead> + + <tbody> + + <row> + <entry>Serial power switches</entry> + + <entry>Two</entry> + + <entry><simplelist> <member>Power switches enable each cluster system + to power-cycle the other cluster system. Note that clusters are + configured with either serial or network attached power switches and + not both.</member> + + <member>The following serial attached power switch has been + fully tested:</member> + + <member>RPS-10 (model M/HD in the US, and model M/EC in + Europe) </member> + + <member>Latent support is provided for the following serial + attached power switch. This switch has not yet been fully + tested:</member> + + <member>APC Serial On/Off Switch (partAP9211), <ulink + url="http://www.apc.com/">http://www.apc.com/</ulink></member> + </simplelist></entry> + + <entry>Strongly recommended for data integrity under all failure + conditions</entry> + + </row> + </tbody> + </tgroup> +</table> +</computeroutput> + </screen> + <para> + <command><simplelist></command> 标记必须紧挨 <command><entry></command> 标记。如果不这样,就无法成功解析。</para> + <para>上面的示例看起来象这样:</para> + <table id="tb-hardware-powerswitch"> + <title>不间断电源硬件</title> + <tgroup cols="4"> + <colspec colname="Hardware" colnum="1" colwidth="2"/> + <colspec colname="Quantity" colnum="2" colwidth="2"/> + <colspec colname="Description" colnum="3" colwidth="6"/> + <colspec colname="Required" colnum="4" colwidth="2"/> + <thead> + <row> + <entry>Hardware</entry> + <entry>Quantity</entry> + <entry>描述</entry> + <entry>Required</entry> + </row> + </thead> + <tbody> + <row> + <entry>Serial power switches</entry> + <entry>Two</entry> + <entry> + <simplelist> <member>Power switches enable each cluster system to power-cycle the other cluster system. Note that clusters are configured with either serial or network attached power switches and not both.</member><member>The following serial attached power switch has been fully tested:</member><member>RPS-10 (model M/HD in the US, and model M/EC in Europe)</member><member>Latent support is provided for the following serial attached power switch. This switch has not yet been fully tested:</member><member>APC Serial On/Off Switch (partAP9211), <ulink url="http://www.apc.com/">http://www.apc.com/</ulink></member></simplelist> + </entry> + <entry>Strongly recommended for data integrity under all failure conditions</entry> + </row> + </tbody> + </tgroup> + </table> + </sect2> + </sect1> + <sect1 id="s1-xml-tags-trademark"> + <title> + <command>trademark</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary> + <command>trademark</command> + </secondary> + </indexterm> + <para>不要使用商标实体 &trade;, &copy;, 或 &reg; 因为它们无法为所有字符集产生 HTML 输出。这些实体产生的 HTML 输出定义在 DTD 中,无法通过样式表改变。</para> + <para>应当使用 <command>trademark</command> 标记以及相关类别,如下所示:</para> + <screen> + <computeroutput> +<trademark>其后是商标符号</trademark> +<trademark class="registered">其后是注册商标符号</trademark> +<trademark class="copyright">其后是版权符号</trademark> +</computeroutput> + </screen> + </sect1> + <sect1 id="s1-xml-tags-userinput"> + <title> + <command>userinput</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary> + <command>userinput</command> + </secondary> + </indexterm> + <para>要显示用户将输入的内容,使用 <command>userinput</command> 标记。例如:</para> + <screen> + <computeroutput> +在提示符下,输入: + +<userinput>dd if=boot.img of=/dev/fd0 bs=1440k</userinput> +</computeroutput> + </screen> + <para>输出:</para> + <para>在提示符下,输入:</para> + <para> + <userinput>dd if=boot.img of=/dev/fd0 bs=1440k</userinput> + </para> + </sect1> + <!-- <sect1 id="s1-xml-tags-mouse"> + <title><command>mousebutton</command></title> + + <indexterm> + <primary>XML tags</primary> + <secondary>mousebutton</secondary> + </indexterm> + <para> +Describe mouse actions with the mousebutton tag. Below is an example of its use. +</para> + +<screen> +<mousebutton>Right click</mousebutton> on the image and a new menu will appear. +</screen> + + <para> +<mousebutton>Right click</mousebutton> on the image and a new menu will appear. + </para> + + </sect1> --> + <sect1 id="s1-xml-tag-sulink"> + <title> + <command>ulink</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>ulink</secondary> + </indexterm> + <para>要在文本中创建 URL,如下:</para> + <screen> + <computeroutput> +在线 &mdash; <ulink url="http://www.redhat.com/support/errata/"> +http://www.redhat.com/support/errata/</ulink>; 提供可以在线阅读的更正,您也可以下载光盘镜像。 +</computeroutput> + </screen> + <para>输出:</para> + <para>在线 — <ulink url="http://www.redhat.com/support/errata/"> http://www.redhat.com/support/errata/</ulink>; 提供可以在线阅读的更正,您也可以下载光盘镜像。</para> + <note> + <title>注意</title> + <para>如果 URL 不是以文件名结尾,必须以斜线结束 (<computeroutput>/</computeroutput>),才是格式正确的 URL,例如 <ulink url="http://www.redhat.com/">http://www.redhat.com/</ulink>。</para> + </note> + </sect1> + <sect1 id="s1-xml-tags-wordasword"> + <title> + <command>wordasword</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>wordasword</secondary> + </indexterm> + <para><wordasword> 标记用来定义一个词只作为语法单位,不代表其他含义。</para> + <para>许多技术文档使用了有丰富意义的词汇。有时又需要用到不带技术意味的这个词。<wordasword> 标记这样的词,指示这个词应当简单地理解为一个词而不是其他东西。</para> + <para>使用这个标记不会帮助读者理解其中的意义差别;好文档应当做到这一点。实际上 <wordasword> 的价值在于全文搜索和索引工具可以用它来减少虚假结果。</para> + <para>例如:</para> + <screen> + <computeroutput>要使用 <command>grep</command> 搜索单词 +<wordasword>linux</wordasword>,使用命令 +<command>grep linux</command>。</computeroutput> + </screen> + <para>输出:</para> + <para>要使用 <command>grep</command> 搜索单词 <wordasword>linux</wordasword>,使用命令 <command>grep linux</command>。</para> + <para>这个例子中,"linux" 仅仅是一个单词。文档不是以 Linux 为主题,这个词也不为内容添加任何相关含义,可以替换为其他任何词。</para> + </sect1> + <sect1 id="s1-xml-tags-xref"> + <title> + <command>xref</command> + </title> + <indexterm> + <primary>XML 标记</primary> + <secondary>xref</secondary> + </indexterm> + <para>要引用手册中其他章节,使用 <command><xref></command> 标记。</para> + <para>它的输出是您向读者指引的章节的标题。例如:</para> + <screen> + <computeroutput> +关于主控文件,请参考 +<xref linkend="ch-tutorial"></xref> 和 <xref linkend="s1-tutorial-parent"></xref> +</computeroutput> + </screen> + <para>输出:</para> + <para>关于主控文件,请参考 <xref linkend="ch-tutorial"/> 和 <xref linkend="s1-tutorial-parent"/>。</para> + </sect1> +</chapter> diff --git a/documentation-guide-zh_CN.xml b/documentation-guide-zh_CN.xml new file mode 100644 index 0000000..aea70d3 --- /dev/null +++ b/documentation-guide-zh_CN.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!-- *************** Bring in Fedora entities *************** --> +<!ENTITY % FEDORA-ENTITIES-EN SYSTEM "../docs-common/common/fedora-entities-en.ent"> +%FEDORA-ENTITIES-EN; + +<!ENTITY VERSION "0.2.6.3"> +<!ENTITY BOOKID "documentation-guide-&VERSION; (2005-09-18)"> +<!ENTITY INTRODUCTION SYSTEM "docs-intro-zh_CN.xml" > +<!ENTITY GETTINGFILES SYSTEM "docs-getting-files-zh_CN.xml" > +<!ENTITY GUIDELINES SYSTEM "docs-rh-guidelines-zh_CN.xml" > +<!ENTITY EMACS SYSTEM "docs-emacs-zh_CN.xml" > +<!ENTITY EMACS-NXML SYSTEM "docs-emacs-nxml-zh_CN.xml" > +<!ENTITY VIM SYSTEM "docs-vim-zh_CN.xml" > +<!ENTITY TAGS SYSTEM "docs-xml-tags-zh_CN.xml" > +<!ENTITY TUTORIAL SYSTEM "docs-tutorial-zh_CN.xml" > +<!ENTITY CONVERTING SYSTEM "docs-converting-zh_CN.xml" > +<!ENTITY CVS SYSTEM "../docs-common/common/cvs-zh_CN.xml" > +<!ENTITY ACKNOWLEDGMENTS SYSTEM "acknowledgments-zh_CN.xml" > +<!ENTITY STYLE SYSTEM "docs-style-zh_CN.xml" > +]> +<book id="documentation-guide" lang="zh_CN"> + <bookinfo> + <title>&FP; 文档撰写准则</title> + <subtitle>版本 &VERSION;</subtitle> + <copyright> + <year>2003,2004,2005</year> + <holder>&FORMAL-RHI;</holder> + <holder>Tammy Fox</holder> + <holder>Johnray Fuller</holder> + <holder>Sandra Moore</holder> + </copyright> + <authorgroup> + <author> + <surname>Fox</surname> + <firstname>Tammy</firstname> + </author> + <author> + <surname>Fuller</surname> + <firstname>Johnray</firstname> + </author> + <author> + <surname>Moore</surname> + <firstname>Sandra</firstname> + </author> + </authorgroup> &LEGALNOTICE;</bookinfo> &INTRODUCTION; &GETTINGFILES; &GUIDELINES; &EMACS; &EMACS-NXML; &VIM; &TAGS; &TUTORIAL; &STYLE; &CONVERTING; &CVS; &ACKNOWLEDGMENTS; <index id="generated-index"/></book> |