aboutsummaryrefslogtreecommitdiff
path: root/zh_TW.UTF-8/books/fdp-primer/book.xml
diff options
context:
space:
mode:
authorRuey-Cherng Yu <rcyu@FreeBSD.org>2016-12-26 08:47:50 +0000
committerRuey-Cherng Yu <rcyu@FreeBSD.org>2016-12-26 08:47:50 +0000
commit953f7badd4e7d2e705a6fa9666ac7e3b85c5f541 (patch)
treebe345585f2bc0b7be350825dd0ee21ff52aa254d /zh_TW.UTF-8/books/fdp-primer/book.xml
parent4a8f5c0329a669e8d8ee4bd39a9916c126c58cda (diff)
downloaddoc-953f7badd4e7d2e705a6fa9666ac7e3b85c5f541.tar.gz
doc-953f7badd4e7d2e705a6fa9666ac7e3b85c5f541.zip
-remove the duplicate msgid in po file
-recover the expanded $FreeBSD$ string in po file -update the book.xml after the fix of the po file
Notes
Notes: svn path=/head/; revision=49764
Diffstat (limited to 'zh_TW.UTF-8/books/fdp-primer/book.xml')
-rw-r--r--zh_TW.UTF-8/books/fdp-primer/book.xml264
1 files changed, 164 insertions, 100 deletions
diff --git a/zh_TW.UTF-8/books/fdp-primer/book.xml b/zh_TW.UTF-8/books/fdp-primer/book.xml
index c434e72d9d..698093068a 100644
--- a/zh_TW.UTF-8/books/fdp-primer/book.xml
+++ b/zh_TW.UTF-8/books/fdp-primer/book.xml
@@ -2543,56 +2543,39 @@ example.xml:5: element head: validity error : Element head content does not foll
<sect1 xml:id="xml-primer-comments">
<title xml:lang="en">Comments</title>
- <para xml:lang="en">Comments are an <acronym>XML</acronym> construct, and are
- normally only valid inside a <acronym>DTD</acronym>. However,
- as <xref linkend="xml-primer-xml-escape"/> shows, it is possible
- to use <acronym>XML</acronym> syntax within the document.</para>
+ <para xml:lang="en">An <acronym>XML</acronym> document may contain comments.
+ They may appear anywhere as long as they are not inside tags.
+ They are even allowed in some locations inside the
+ <acronym>DTD</acronym> (e.g., between <link linkend="xml-primer-entities">entity
+ declarations</link>).</para>
- <para xml:lang="en">The delimiter for XML comments is the string
- <quote><literal>--</literal></quote>. The first occurrence of
- this string opens a comment, and the second closes it.</para>
+ <para xml:lang="en"><acronym>XML</acronym> comments start with the string
+ <quote><literal>&lt;!--</literal></quote> and end with the
+ string <quote><literal>--&gt;</literal></quote>.</para>
+
+ <para xml:lang="en">Here are some examples of valid <acronym>XML</acronym>
+ comments:</para>
<example>
- <title xml:lang="en"><acronym>XML</acronym> Generic Comment</title>
+ <title xml:lang="en"><acronym>XML</acronym> Generic Comments</title>
<programlisting xml:lang="en">&lt;!-- This is inside the comment --&gt;
-&lt;!-- This is another comment --&gt;
+&lt;!--This is another comment--&gt;
-&lt;!-- This is one way
- of doing multiline comments --&gt;
+&lt;!-- This is how you
+ write multiline comments --&gt;
-&lt;!-- This is another way of --
- -- doing multiline comments --&gt;</programlisting>
+&lt;p&gt;A simple &lt;!-- Comment inside an element's content --&gt; paragraph.&lt;/p&gt;</programlisting>
</example>
- <para xml:lang="en"><acronym>XHTML</acronym> users may be familiar with different
- rules for comments. In particular, it is often believed that
- the string <literal>&lt;!--</literal> opens a comment, and it is
- only closed by <literal>--&gt;</literal>.</para>
-
- <para xml:lang="en">This is <emphasis>not</emphasis> correct. Many web browsers
- have broken <acronym>XHTML</acronym> parsers, and will accept
- incorrect input as valid. However, the <acronym>XML</acronym>
- parsers used by the Documentation Project are more strict, and
- will reject documents with that error.</para>
+ <para xml:lang="en"><acronym>XML</acronym> comments may contain any strings
+ except <quote><literal>--</literal></quote>:</para>
<example>
- <title xml:lang="en">Erroneous <acronym>XML</acronym> Comments</title>
-
- <programlisting xml:lang="en">&lt;!-- This is in the comment --
-
- THIS IS OUTSIDE THE COMMENT!
-
- -- back inside the comment --&gt;</programlisting>
+ <title xml:lang="en">Erroneous <acronym>XML</acronym> Comment</title>
- <para xml:lang="en">The <acronym>XML</acronym> parser will treat this as
- though it were actually:</para>
-
- <programlisting xml:lang="en">&lt;!THIS IS OUTSIDE THE COMMENT&gt;</programlisting>
-
- <para xml:lang="en">That is not valid <acronym>XML</acronym>, and may give
- confusing error messages.</para>
+ <programlisting xml:lang="en">&lt;!-- This comment--is wrong --&gt;</programlisting>
</example>
<sect2>
@@ -4292,38 +4275,51 @@ example.xml:5: element head: validity error : Element head content does not foll
<!-- Cannot put this in a marked section because of the
replaceable elements -->
- <programlisting xml:lang="en"><tag class="starttag">book</tag>
+ <programlisting>&lt;!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN"
+ "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd"&gt;
+
+<tag class="starttag">article xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
+ xml:lang="en"</tag>
+
<tag class="starttag">info</tag>
- <tag class="starttag">title</tag><replaceable>Your Title Here</replaceable><tag class="endtag">title</tag>
+ <tag class="starttag">title</tag>An Example Article<tag class="endtag">title</tag>
<tag class="starttag">author</tag>
<tag class="starttag">personname</tag>
- <tag class="starttag">firstname</tag><replaceable>Your first name</replaceable><tag class="endtag">firstname</tag>
- <tag class="starttag">surname</tag><replaceable>Your surname</replaceable><tag class="endtag">surname</tag>
+ <tag class="starttag">firstname</tag>Your first name<tag class="endtag">firstname</tag>
+ <tag class="starttag">surname</tag>Your surname<tag class="endtag">surname</tag>
<tag class="endtag">personname</tag>
<tag class="starttag">affiliation</tag>
<tag class="starttag">address</tag>
- <tag class="starttag">email</tag><replaceable>Your email address</replaceable><tag class="endtag">email</tag>
+ <tag class="starttag">email</tag>foo@example.com<tag class="endtag">email</tag>
<tag class="endtag">address</tag>
<tag class="endtag">affiliation</tag>
<tag class="endtag">author</tag>
<tag class="starttag">copyright</tag>
- <tag class="starttag">year</tag><replaceable>1998</replaceable><tag class="endtag">year</tag>
- <tag class="starttag">holder role="mailto:<replaceable>your email address</replaceable>"</tag><replaceable>Your name</replaceable><tag class="endtag">holder</tag>
+ <tag class="starttag">year</tag>2000<tag class="endtag">year</tag>
+ <tag class="starttag">holder</tag>Copyright string here<tag class="endtag">holder</tag>
<tag class="endtag">copyright</tag>
- <tag class="starttag">releaseinfo</tag>$FreeBSD$<tag class="endtag">releaseinfo</tag>
-
<tag class="starttag">abstract</tag>
- <tag class="starttag">para</tag><replaceable>Include an abstract of the book's contents here.</replaceable><tag class="endtag">para</tag>
+ <tag class="starttag">para</tag>If your article has an abstract then it should go here。<tag class="endtag">para</tag>
<tag class="endtag">abstract</tag>
<tag class="endtag">info</tag>
- …
+ <tag class="starttag">sect1</tag>
+ <tag class="starttag">title</tag>My First Section<tag class="endtag">title</tag>
-<tag class="endtag">book</tag></programlisting>
+ <tag class="starttag">para</tag>This is the first section in my article。<tag class="endtag">para</tag>
+
+ <tag class="starttag">sect2</tag>
+ <tag class="starttag">title</tag>My First Sub-Section<tag class="endtag">title</tag>
+
+ <tag class="starttag">para</tag>This is the first sub-section in my article。<tag class="endtag">para</tag>
+ <tag class="endtag">sect2</tag>
+ <tag class="endtag">sect1</tag>
+<tag class="endtag">article</tag></programlisting>
</example>
</sect2>
@@ -4347,37 +4343,50 @@ example.xml:5: element head: validity error : Element head content does not foll
<!-- Cannot put this in a marked section because of the
replaceable elements -->
- <programlisting xml:lang="en"><tag class="starttag">article</tag>
+ <programlisting>&lt;!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN"
+ "http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd"&gt;
+
+<tag class="starttag">article xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
+ xml:lang="en"</tag>
+
<tag class="starttag">info</tag>
- <tag class="starttag">title</tag><replaceable>Your title here</replaceable><tag class="endtag">title</tag>
+ <tag class="starttag">title</tag>An Example Article<tag class="endtag">title</tag>
<tag class="starttag">author</tag>
<tag class="starttag">personname</tag>
- <tag class="starttag">firstname</tag><replaceable>Your first name</replaceable><tag class="endtag">firstname</tag>
- <tag class="starttag">surname</tag><replaceable>Your surname</replaceable><tag class="endtag">surname</tag>
+ <tag class="starttag">firstname</tag>Your first name<tag class="endtag">firstname</tag>
+ <tag class="starttag">surname</tag>Your surname<tag class="endtag">surname</tag>
<tag class="endtag">personname</tag>
<tag class="starttag">affiliation</tag>
<tag class="starttag">address</tag>
- <tag class="starttag">email</tag><replaceable>Your email address</replaceable><tag class="endtag">email</tag><tag class="endtag">address</tag>
+ <tag class="starttag">email</tag>foo@example.com<tag class="endtag">email</tag>
<tag class="endtag">address</tag>
<tag class="endtag">affiliation</tag>
<tag class="endtag">author</tag>
<tag class="starttag">copyright</tag>
- <tag class="starttag">year</tag><replaceable>1998</replaceable><tag class="endtag">year</tag>
- <tag class="starttag">holder role="mailto:<replaceable>your email address</replaceable>"</tag><replaceable>Your name</replaceable><tag class="endtag">holder</tag>
+ <tag class="starttag">year</tag>2000<tag class="endtag">year</tag>
+ <tag class="starttag">holder</tag>Copyright string here<tag class="endtag">holder</tag>
<tag class="endtag">copyright</tag>
- <tag class="starttag">releaseinfo</tag>$FreeBSD$<tag class="endtag">releaseinfo</tag>
-
<tag class="starttag">abstract</tag>
- <tag class="starttag">para</tag><replaceable>Include an abstract of the article's contents here.</replaceable><tag class="endtag">para</tag>
+ <tag class="starttag">para</tag>If your article has an abstract then it should go here。<tag class="endtag">para</tag>
<tag class="endtag">abstract</tag>
<tag class="endtag">info</tag>
- …
+ <tag class="starttag">sect1</tag>
+ <tag class="starttag">title</tag>My First Section<tag class="endtag">title</tag>
+
+ <tag class="starttag">para</tag>This is the first section in my article。<tag class="endtag">para</tag>
+
+ <tag class="starttag">sect2</tag>
+ <tag class="starttag">title</tag>My First Sub-Section<tag class="endtag">title</tag>
+ <tag class="starttag">para</tag>This is the first sub-section in my article。<tag class="endtag">para</tag>
+ <tag class="endtag">sect2</tag>
+ <tag class="endtag">sect1</tag>
<tag class="endtag">article</tag></programlisting>
</example>
</sect2>
@@ -6961,7 +6970,7 @@ IMAGES= chapter1/fig1.png
<para>每份英文版原稿的開頭,通常會有像下面的內容:</para>
- <programlisting xml:lang="en">&lt;!--
+ <programlisting>&lt;!--
The FreeBSD Documentation Project
$FreeBSD$
@@ -6975,17 +6984,13 @@ IMAGES= chapter1/fig1.png
<literal>$FreeBSD$</literal>) for new
files.</para>
- <para xml:lang="en">Your translated documents should include their own
- $FreeBSD$ line, and change the
- <literal>FreeBSD Documentation Project</literal> line to
- <literal>The FreeBSD <replaceable>language</replaceable>
- Documentation Project</literal>.</para>
+ <para>翻譯文件中,必須都要有 $FreeBSD$ 這行,並且把 <literal>FreeBSD Documentation Project</literal> 這行改為 <literal>The FreeBSD <replaceable>language</replaceable> Documentation Project</literal>。</para>
<para>此外,還必須加上第三行來指出你所翻譯的,到底是以英文版原稿的哪一版本為母本所做的翻譯。</para>
<para>因此呢,西班牙文版(Spanish)的檔案開頭應該是長像這樣:</para>
- <programlisting xml:lang="en">&lt;!--
+ <programlisting>&lt;!--
The FreeBSD Spanish Documentation Project
$FreeBSD$
@@ -7317,10 +7322,10 @@ A Makefile</screen>
<para>修改 <filename>Makefile</filename> 內容以產生單一的 <filename>book.xml</filename>:</para>
- <programlisting xml:lang="en">#
+ <programlisting>#
# $FreeBSD$
#
-# Build the FreeBSD Porter's Handbook.
+# Build the FreeBSD Porter's Handbook。
#
MAINTAINER=doc@FreeBSD.org
@@ -7390,10 +7395,10 @@ A Makefile</screen>
<para>檢查 <filename>Makefile</filename> 的內容。因為這是簡單的文章,此例的 <filename>Makefile</filename> 不用修改。第二行的 <literal>$FreeBSD...$</literal> 版本字串將會在檔案提交時被版本控制系統替換掉。</para>
- <programlisting xml:lang="en">#
+ <programlisting>#
# $FreeBSD$
#
-# Article: PGP Keys
+# Article:PGP Keys
DOC?= article
@@ -7405,7 +7410,7 @@ INSTALL_ONLY_COMPRESSED?=
SRCS= article.xml
-# To build with just key fingerprints, set FINGERPRINTS_ONLY.
+# To build with just key fingerprints, set FINGERPRINTS_ONLY。
URL_RELPREFIX?= ../../../..
DOC_PREFIX?= ${.CURDIR}/../../..
@@ -7554,12 +7559,7 @@ DOC_PREFIX?= ${.CURDIR}/../../..
<para>版本控制符號不會把 <literal>&amp;dollar;</literal> entities 看成金錢符號,所以不會把字串展開成版本字串。</para>
- <para xml:lang="en">When a <acronym>PO</acronym> file is created, the
- <literal>&amp;dollar;</literal> entities used in examples are
- replaced with actual dollar signs. The resulting literal
- <literal>$FreeBSD$</literal> string will be
- wrongly expanded by the version control system when the file
- is committed.</para>
+ <para>當 <acronym>PO</acronym> 檔建立後,範例中的 <literal>&amp;dollar;</literal> entities 被實際的金錢符號取代。當檔案提交時,產生的 <literal>$FreeBSD$</literal> 將會被版本控制系統展開。</para>
<para>英文文件用的相同技術可以被用在翻譯上。翻譯時用 <literal>&amp;dollar;</literal> 來取代金錢符號,輸入到 <acronym>PO</acronym> 檔編輯器:</para>
@@ -7663,13 +7663,7 @@ A es_ES.po</screen>
</step>
<step>
- <para xml:lang="en">Set the
- <application>Subversion</application>
- <literal>svn:keywords</literal> properties on these files
- to <literal>FreeBSD=%H</literal> so
- <literal>$FreeBSD$</literal> strings are
- expanded into the path, revision, date, and author when
- committed:</para>
+ <para>設定這些檔案的 <application>Subversion</application> <literal>svn:keywords</literal> 屬性到 <literal>FreeBSD=%H</literal>,讓提交時 <literal>$FreeBSD$</literal> 字串可以被展開成路徑、版本、日期和作者。</para>
<screen><prompt>%</prompt> <userinput>svn propset svn:keywords FreeBSD=%H Makefile article.xml es_ES.po</userinput>
property 'svn:keywords' set on 'Makefile'
@@ -7718,12 +7712,7 @@ A ko_KR.po</screen>
</step>
<step>
- <para xml:lang="en">Set the <application>Subversion</application>
- <literal>svn:keywords</literal> properties on these files
- to <literal>FreeBSD=%H</literal> so
- <literal>$FreeBSD$</literal> strings are
- expanded into the path, revision, date, and author when
- committed:</para>
+ <para>設定這些檔案的 <application>Subversion</application> <literal>svn:keywords</literal> 屬性到 <literal>FreeBSD=%H</literal>,讓提交時 <literal>$FreeBSD$</literal> 字串可以被展開成路徑、版本、日期和作者。</para>
<screen><prompt>%</prompt> <userinput>svn propset svn:keywords FreeBSD=%H Makefile article.xml ko_KR.po</userinput>
property 'svn:keywords' set on 'Makefile'
@@ -8329,15 +8318,16 @@ GB。 Hardware compression …</literallayout>
<sect1 xml:id="editor-config-vim">
<title xml:lang="en"><application>Vim</application></title>
- <para xml:lang="en">Install from <package>editors/vim</package>
- or <package>editors/vim-lite</package>, then follow the
+ <para xml:lang="en">Install from <package>editors/vim</package> or
+ <package>editors/vim-lite</package>, then follow the
configuration instructions in
<xref linkend="editor-config-vim-config"/>.</para>
<sect2 xml:id="editor-config-vim-use">
<title xml:lang="en">Use</title>
- <para xml:lang="en">Press <keycap>P</keycap> to reformat paragraphs or text that has been selected in Visual mode. Press
+ <para xml:lang="en">Press <keycap>P</keycap> to reformat paragraphs or text
+ that has been selected in Visual mode. Press
<keycap>T</keycap> to replace groups of eight spaces with a
tab.</para>
</sect2>
@@ -8392,14 +8382,88 @@ endfunction " Set_SGML()</programlisting>
<sect1 xml:id="editor-config-emacs">
<title xml:lang="en"><application>Emacs</application></title>
- <para xml:lang="en">Install from
- <package>editors/emacs</package>
- or <package>editors/xemacs</package>.</para>
+ <para xml:lang="en">Install from <package>editors/emacs</package> or
+ <package>editors/emacs-devel</package>.</para>
- <para xml:lang="en">Edit <filename>~/.emacs</filename>, adding this
- line:</para>
+ <sect2 xml:id="editor-config-emacs-validation">
+ <title xml:lang="en">Validation</title>
- <programlisting xml:lang="en">(add-hook 'nxml-mode-hook 'turn-on-auto-fill)</programlisting>
+ <para xml:lang="en">Emacs's nxml-mode uses compact relax NG schemas for
+ validating XML. A compact relax NG schema for FreeBSD's
+ extension to DocBook 5.0 is included in the documentation
+ repository. To configure nxml-mode to validate using this
+ schema, create
+ <filename>~/.emacs.d/schema/schemas.xml</filename> and add
+ these lines to the file:</para>
+
+ <programlisting xml:lang="en"><tag class="starttag">locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"</tag>
+ <tag class="starttag">documentElement localName="section" typeId="DocBook"</tag>
+ <tag class="starttag">documentElement localName="chapter" typeId="DocBook"</tag>
+ <tag class="starttag">documentElement localName="article" typeId="DocBook"</tag>
+ <tag class="starttag">documentElement localName="book" typeId="DocBook"</tag>
+ <tag class="starttag">typeId id="DocBook" uri="/usr/local/share/xml/docbook/5.0/rng/docbook.rnc"</tag>
+<tag class="endtag">locatingRules</tag></programlisting>
+
+ </sect2>
+
+ <sect2 xml:id="editor-config-emacs-igor">
+ <title xml:lang="en">Automated Proofreading with Flycheck and Igor</title>
+
+ <para xml:lang="en">The Flycheck package is available from Milkypostman's
+ Emacs Lisp Package Archive (<acronym>MELPA</acronym>). If
+ <acronym>MELPA</acronym> is not already in Emacs's
+ packages-archives, it can be added by evaluating</para>
+
+ <programlisting xml:lang="en">(add-to-list 'package-archives '("melpa" . "http://stable.melpa.org/packages/") t)</programlisting>
+
+ <para xml:lang="en">Add the line to Emacs's initialization file (one of
+ <filename>~/.emacs</filename>,
+ <filename>~/.emacs.el</filename>, or
+ <filename>~.emacs.d/init.el</filename>) to make this change
+ permanent.</para>
+
+ <para xml:lang="en">To install Flycheck, evaluate</para>
+
+ <programlisting xml:lang="en">(package-install 'flycheck)</programlisting>
+
+ <para xml:lang="en">Create a Flycheck checker for
+ <package>textproc/igor</package> by evaluating</para>
+
+ <programlisting xml:lang="en">(flycheck-define-checker igor
+ "FreeBSD Documentation Project sanity checker.
+
+See URLs http://www.freebsd.org/docproj/ and
+http://www.freshports.org/textproc/igor/."
+ :command ("igor" "-X" source-inplace)
+ :error-parser flycheck-parse-checkstyle
+ :modes (nxml-mode)
+ :standard-input t)
+
+ (add-to-list 'flycheck-checkers 'igor 'append)</programlisting>
+
+ <para xml:lang="en">Again, add these lines to Emacs's initialization file to
+ make the changes permanent.</para>
+ </sect2>
+
+ <sect2 xml:id="editor-config-emacs-specifc">
+ <title xml:lang="en">FreeBSD Documentation Specific Settings</title>
+
+ <para xml:lang="en">To apply settings specific to the FreeBSD documentation
+ project, create <filename>.dir-locals.el</filename> in the
+ root directory of the documentation repository and add these
+ lines to the file:</para>
+
+ <programlisting xml:lang="en">;;; Directory Local Variables
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nxml-mode
+ (eval . (turn-on-auto-fill))
+ (fill-column . 70)
+ (eval . (require 'flycheck))
+ (eval . (flycheck-mode 1))
+ (flycheck-checker . igor)
+ (eval . (add-to-list 'rng-schema-locating-files "~/.emacs.d/schema/schemas.xml"))))</programlisting>
+ </sect2>
</sect1>
<sect1 xml:id="editor-config-nano">