[svnbook] r5387 committed - branches/1.8/zh/book/ch03-advanced-topics.xml
wuzhouhui at users.sourceforge.net
wuzhouhui at users.sourceforge.net
Mon Aug 7 08:48:34 CDT 2017
Revision: 5387
http://sourceforge.net/p/svnbook/source/5387
Author: wuzhouhui
Date: 2017-08-07 13:48:33 +0000 (Mon, 07 Aug 2017)
Log Message:
-----------
1.8/zh: translation of chapter 3 in progress
Modified Paths:
--------------
branches/1.8/zh/book/ch03-advanced-topics.xml
Modified: branches/1.8/zh/book/ch03-advanced-topics.xml
===================================================================
--- branches/1.8/zh/book/ch03-advanced-topics.xml 2017-08-06 04:02:13 UTC (rev 5386)
+++ branches/1.8/zh/book/ch03-advanced-topics.xml 2017-08-07 13:48:33 UTC (rev 5387)
@@ -4977,6 +4977,7 @@
</varlistentry>
</variablelist>
+ <!--
<para>As you can see, many of the individual format codes serve as
placeholders for the same information available through the
stock keywords. But of course, the custom keyword format allows
@@ -4986,6 +4987,11 @@
of the file and last-changed revision, formatted in a pleasant,
human-readable way. To do so, you'd first define your custom
keyword:</para>
+ -->
+ <para>可以看到, 很多单独的格式控制字符所表示的信息与预定义的关键字所表示
+ 的信息相同, 但是自定义关键字允许用户得到更灵活和更丰富的信息. 比如说,
+ 用户希望有一个关键字能被替换成文件在仓库里的相对路径, 以及最后一次修改
+ 文件的版本号, 此时就需要自定义一个关键字:</para>
<informalexample>
<screen>
@@ -4995,6 +5001,7 @@
</screen>
</informalexample>
+ <!--
<para>Next, you'd edit the file's contents to add the keyword
anchor for your custom keyword, which in this case
is <literal>$PathRev$</literal>. After committing these
@@ -5003,14 +5010,25 @@
expect—where previously the file
contained <literal>$PathRev$</literal>, it now reads
<literal>$PathRev: trunk/calc/button.c, r23 $</literal>.</para>
+ -->
+ <para>接下来用户要把关键字锚点插入到文档的适当位置, 在这个例子里, 关键字
+ 锚点要写成 <literal>$PathRev$</literal>. 提交修改后, 文件中原来显示
+ <literal>$PathRev$</literal> 的文本, 变成了
+ <literal>$PathRev: trunk/calc/button.c, r23 $</literal>.</para>
<note>
+ <!--
<para>Subversion will automatically truncate any keyword
expansions which exceed 255 bytes in length. Also custom
keywords defined with names that exceed 255 bytes will be
ignored altogether.</para>
+ -->
+ <para>如果关键字替换后的内容超过了 255 个字符, Subversion 会自动截断过
+ 长的部分. 自定义关键字的名字如果超过了 255 个字符, Subversion 会自动
+ 忽略超出的部分.</para>
</note>
+ <!--
<para>You can also instruct Subversion to maintain a fixed length
(in terms of the number of bytes consumed) for the substituted
keyword. By using a double colon (<literal>::</literal>) after
@@ -5024,12 +5042,24 @@
if it is too long, it is truncated with a special hash
(<literal>#</literal>) character just before the final dollar
sign terminator.</para>
+ -->
+ <para>用户还可以为替换后的字符串指定一个固定的长度. 在关键字名字后面加
+ 两个冒号 (<literal>::</literal>), 然后是一定个数的空格, 这样就指定了
+ 一个固定长度. 当 Subversion 准备替换关键字时, 如果发现锚点指定了一个固
+ 定长度, Subversion 就只会替换空格部分. 如果替换后的字符串不够长, 不足
+ 的部分就会用空格填充; 如果替换后的字符串不过长, 字符串就会被截断, 并在
+ 截断的地方放置一个 <literal>#</literal> 字符.</para>
+ <!--
<para>For example, say you have a document in which you have
some section of tabular data reflecting the document's
Subversion keywords. Using the original Subversion keyword
substitution syntax, your file might look something
like:</para>
+ -->
+ <para>比如说, 你有一个文档, 文档把 Subversion 的关键字按照表格的样式进行
+ 排版, 如果使用原来形式的关键字替换语法, 替换前的文件内容看起来就像:
+ </para>
<informalexample>
<programlisting>
@@ -5039,9 +5069,13 @@
</programlisting>
</informalexample>
+ <!--
<para>Now, that looks nice and tabular at the start of things.
But when you then commit that file (with keyword substitution
enabled, of course), you see:</para>
+ -->
+ <para>现在看起来表格的格式还挺工整的, 但是提交后 (开启了关键字替换功能),
+ 文件的内容就变成了:</para>
<informalexample>
<programlisting>
More information about the svnbook-dev
mailing list