Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
zh-cn:wiki:syntax [2012/04/16 18:31] – [Quoting] haobugzh-cn:wiki:syntax [2012/04/16 19:45] – [RSS/ATOM Feed 聚合] haobug
Line 244: Line 244:
 >> 是!   >> 是!  
 >>> 那来做吧! >>> 那来做吧!
-===== Tables =====+===== 表格 =====
  
-DokuWiki supports a simple syntax to create tables.+DokuWiki 支持用简单的语法创建表格。
  
-Heading 1      ^ Heading 2       Heading 3          ^ +标题 1      ^ 标题 2       标题 3          ^ 
-Row Col 1    | Row Col 2     Row Col 3        | +行 列 1    | 行 列 2     行 列 3        | 
-Row Col 1    | some colspan (note the double pipe) || +行 列 1    | 跨列合并(注意两条竖线) || 
-Row Col 1    | Row Col 2     Row Col 3        |+行 列 1    | 行 列 2     行 列 3        |
  
-Table rows have to start and end with a ''|'' for normal rows or a ''^'' for headers.+表格的每一行都以分隔符 (普通行)或者 (标题行)作为开头和结束。
  
-  ^ Heading 1      ^ Heading 2       Heading 3          ^ +  ^ 标题 1      ^ 标题 2       标题 3          ^ 
-  | Row Col 1    | Row Col 2     Row Col 3        | +  | 行 列 1    | 行 列 2     行 列 3        | 
-  | Row Col 1    | some colspan (note the double pipe) || +  | 行 列 1    | 跨列合并(注意两条竖线) || 
-  | Row Col 1    | Row Col 2     Row Col 3        |+  | 行 列 1    | 行 列 2     行 列 3        |
  
-To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators!+要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符!
  
-Vertical tableheaders are possible, too.+竖直的标题列也是可以实现的:
  
-|              ^ Heading 1            ^ Heading 2          ^ +|              ^ 标题 1            ^ 标题 2          ^ 
-Heading 3    | Row Col 2          | Row Col 3        | +标题 3    | 行 列 2          | 行 列 3        | 
-Heading 4    | no colspan this time |                    | +标题 4    | 没有跨列合并 |                    | 
-Heading 5    | Row Col 2          | Row Col 3        |+标题 5    | 行 列 2          | 行 列 3        |
  
-As you can see, it's the cell separator before a cell which decides about the formatting:+可以看到,单元格前面的分隔符决定了单元格的格式:
  
-  |              ^ Heading 1            ^ Heading 2          ^ +  |              ^ 标题 1            ^ 标题 2          ^ 
-  ^ Heading 3    | Row Col 2          | Row Col 3        | +  ^ 标题 3    | 行 列 2          | 行 列 3        | 
-  ^ Heading 4    | no colspan this time |                    | +  ^ 标题 4    | 没有跨列合并 |                    | 
-  ^ Heading 5    | Row Col 2          | Row Col 3        |+  ^ 标题 5    | 行 列 2          | 行 列 3        |
  
-You can have rowspans (vertically connected cellsby adding '':::'' into the cells below the one to which they should connect.+跨行合并单元格(垂直合并单元格)也是可以实现的,通过在下面的相邻单元格输入 '':::'' 可以把两个相邻行的单元格合并。
  
-Heading 1      ^ Heading                  Heading 3          ^ +标题 1      ^ 标题        标题 3          ^ 
-Row Col 1    | this cell spans vertically Row Col 3        | +行 列 1    | 单元格垂直跨行 行 列 3        | 
-Row Col 1    | :::                        Row Col 3        | +行 列 1    | :::          行 列 3        | 
-Row Col 1    | :::                        Row Col 3        |+行 列 1    | :::          行 列 3        |
  
-Apart from the rowspan syntax those cells should not contain anything else.+跨行合并单元格中不能包含语法外其他任何内容。
  
-  ^ Heading 1      ^ Heading                  Heading 3          ^ +  ^ 标题 1      ^ 标题        标题 3          ^ 
-  | Row Col 1    | this cell spans vertically Row Col 3        | +  | 行 列 1    | 单元格垂直跨行 行 列 3        | 
-  | Row Col 1    | :::                        Row Col 3        | +  | 行 列 1    | :::          行 列 3        | 
-  | Row Col 1    | :::                        Row Col 3        |+  | 行 列 1    | :::          行 列 3        |
  
-You can align the table contents, too. Just add at least two whitespaces at the opposite end of your text: Add two spaces on the left to align right, two spaces on the right to align left and two spaces at least at both ends for centered text.+您也可以设置表格内容的对齐方式。只需在文本的相反方向添加至少两个空格:如果需要右对齐,在左边添加两个空格;反之,则在右边添加。在两边均添加空格可以实现居中对齐。
  
-          Table with alignment           ^^^ +               表格对齐方式                ^^^ 
-        right   center    |left          +           右      中      |左            
-|left                  right   center    |+|左                        右     中      |
 | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
  
-This is how it looks in the source:+下面是源文件中的样子:
  
-  ^           Table with alignment           ^^^ +  ^                表格对齐方式                ^^^ 
-  |         right   center    |left          +  |            右      中      |左            
-  |left                  right   center    |+  |左                        右     中      |
   | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |   | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
  
-Note: Vertical alignment is not supported.+注意:不支持垂直对齐方式。
  
-===== No Formatting =====+===== 无格式化 =====
  
-If you need to display text exactly like it is typed (without any formatting), enclose the area either with ''%%<nowiki>%%'' tags or even simpler, with double percent signs ''<nowiki>%%</nowiki>''.+如果您需要文本完全显示为它键入的样子(没有任何格式化), 用 ''%%<nowiki>%%'' 标签包围这个区域 或更简单地用两个百分号 ''<nowiki>%%</nowiki>''
  
 <nowiki> <nowiki>
-This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it.+这是一些包含像这样的地址文字:http://www.splitbrain.org 以及 **格式**,但它没有被解析。
 </nowiki> </nowiki>
-The same is true for %%//__this__ text// with a smiley ;-)%%.+ 
 +对于带有表情符号的 %%;-)//__这段__ 文本 //%%也一样。
  
   <nowiki>   <nowiki>
-  This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it.+  这是一些包含像这样的地址文字:http://www.splitbrain.org 以及 **格式**,但它们没有被解析。
   </nowiki>   </nowiki>
-  The same is true for %%//__this__ text// with a smiley ;-)%%. 
  
-===== Code Blocks =====+  对于带有表情符号的 %%;-)//__这段__ 文本 //%%也一样。 
 + 
 +===== 代码块 =====
  
-You can include code blocks into your documents by either indenting them by at least two spaces (like used for the previous examples) or by using the tags ''%%<code>%%'' or ''%%<file>%%''.+您可以将代码块包含到文档中,可以通过缩进两个空格(像前面例子中所用的那样) 或者使用标 ''%%<code>%%'' 或 ''%%<file>%%''标签。
  
-  This is text is indented by two spaces.+  这是缩进了两个空格的文本。
  
 <code> <code>
-This is preformatted code all spaces are preserved: like              <-this+这是预格式化的代码,所有空格都被保留:像              <-这样
 </code> </code>
  
 <file> <file>
-This is pretty much the same, but you could use it to show that you quoted a file.+这非常相似,但您可以用它来表明您引用了一个文件。
 </file> </file>
  
-Those blocks were created by this source:+这些区块由下面的源码创建:
  
-    This is text is indented by two spaces.+    这是缩进了两个空格的文本。
  
   <code>   <code>
-  This is preformatted code all spaces are preserved: like              <-this+  这是预格式化的代码,所有空格都被保留:像              <-这样
   </code>   </code>
  
   <file>   <file>
-  This is pretty much the same, but you could use it to show that you quoted a file.+  这非常相似,但您可以用它来表明您引用了一个文件。
   </file>   </file>
  
-==== Syntax Highlighting ====+==== 语法高亮 ====
  
-[[wiki:DokuWiki]] can highlight sourcecode, which makes it easier to read. It uses the [[http://qbnz.com/highlighter/|GeSHi]] Generic Syntax Highlighter -- so any language supported by GeSHi is supported. The syntax is the same like in the code and file blocks in the previous section, but this time the name of the used language is inserted inside the tag. Eg. ''<nowiki><code java></nowiki>'' or ''<nowiki><file java></nowiki>''.+[[wiki:DokuWiki]] 可以高亮源代码,使其更容易阅读。它使用[[http://qbnz.com/highlighter/|GeSHi]] 通用语法高亮器 -- 因此支持任何GeSHi所支持的语言。语法和前面章节中代码与文件块的很像,只是现在把所用语言的名称写到标签里面。例如''<nowiki><code java></nowiki>'' 或者 ''<nowiki><file java></nowiki>''
  
 <code java> <code java>
 /** /**
- The HelloWorldApp class implements an application that + * HelloWorldApp 类实现一个向到标准输出显示 "Hello World!"的程序。 
- * simply displays "Hello World!" to the standard output.+
  */  */
 class HelloWorldApp { class HelloWorldApp {
     public static void main(String[] args) {     public static void main(String[] args) {
-        System.out.println("Hello World!"); //Display the string.+        System.out.println("Hello World!"); //显示字符串。
     }     }
 } }
 </code> </code>
  
-The following language strings are currently recognized: //4cs, abap, actionscript-french, actionscript, actionscript3, ada, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, ecmascript, eiffel, email, erlang, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lisp, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender, plsql, postgresql, povray, powerbuilder, powershell, progress, prolog, properties, providex, purebasic, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, z80//+下列字符串为当前可以识别语言://4cs, abap, actionscript-french, actionscript, actionscript3, ada, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, ecmascript, eiffel, email, erlang, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lisp, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender, plsql, postgresql, povray, powerbuilder, powershell, progress, prolog, properties, providex, purebasic, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, z80//
  
-==== Downloadable Code Blocks ====+==== 可下载的代码块 ====
  
-When you use the ''%%<code>%%'' or ''%%<file>%%'' syntax as above, you might want to make the shown code available for download as well. You can to this by specifying a file name after language code like this:+当你使用上面的''%%<code>%%'' 或者 ''%%<file>%%'' 的时候,你可能想让显示的代码也可以被下载。您可以通过在语言代码后面指定一个文件名来实现这:
  
 <code> <code>
Line 378: Line 379:
 </file> </file>
  
-If you don't want any highlighting but want a downloadable file, specify a dash (''-''as the language code: ''%%<code - myfile.foo>%%''.+如果您不想要任何高亮,但想要一个可下载的文件,指定破折号(''-''作为语言代码:''%%<code - myfile.foo>%%''。 
 +===== 内嵌 HTML 和 PHP =====
  
 +您可以嵌入原始HTML或PHP代码到文件中,通过使用 ''%%<html>%%'' 或者 ''%%<php>%%'' 标签。(如果您需要包围块级元素,使用大写字母的标签。)
  
-===== Embedding HTML and PHP ===== +HTML 例子:
- +
-You can embed raw HTML or PHP code into your documents by using the ''%%<html>%%'' or ''%%<php>%%'' tags. (Use uppercase tags if you need to enclose block level elements.) +
- +
-HTML example:+
  
 <code> <code>
 <html> <html>
-This is some <span style="color:red;font-size:150%;">inline HTML</span>+这是一些 <span style="color:red;font-size:150%;">内联 HTML</span>
 </html> </html>
 <HTML> <HTML>
-<p style="border:2px dashed red;">And this is some block HTML</p>+<p style="border:2px dashed red;">而这是一个块级元素 block HTML</p>
 </HTML> </HTML>
 </code> </code>
  
 <html> <html>
-This is some <span style="color:red;font-size:150%;">inline HTML</span>+这是一些 <span style="color:red;font-size:150%;">内联 HTML</span>
 </html> </html>
 <HTML> <HTML>
-<p style="border:2px dashed red;">And this is some block HTML</p>+<p style="border:2px dashed red;">而这是一个块级元素 block HTML</p>
 </HTML> </HTML>
- +PHP 例子:
-PHP example:+
  
 <code> <code>
 <php> <php>
-echo 'A logo generated by PHP:';+echo 'PHP 生成的logo:';
 echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />';
-echo '(generated inline HTML)';+echo '(生成内联 html)';
 </php> </php>
 <PHP> <PHP>
-echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';+echo '<table class="inline"><tr><td>和上面一样,但是在块级元素内部:</td>';
 echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>';
 echo '</tr></table>'; echo '</tr></table>';
Line 419: Line 417:
  
 <php> <php>
-echo 'A logo generated by PHP:';+echo 'PHP 生成的logo:';
 echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />';
-echo '(inline HTML)';+echo '(生成内联 html)';
 </php> </php>
 <PHP> <PHP>
-echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>';+echo '<table class="inline"><tr><td>和上面一样,但是在块级元素内部:</td>';
 echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>';
 echo '</tr></table>'; echo '</tr></table>';
 </PHP> </PHP>
  
-**Please Note**HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed.+**注意**HTML 和 PHP 在配置中默认是禁用的。如果禁用了,就会显示它们代码,而不会执行它们。 
 + 
 +===== RSS/ATOM Feed 聚合 ===== 
 +所有的能够被SimplePie理解的格式都可以在DokuWiki中使用。您可以通过多个参数来改变渲染,参数之间用空格隔开: 
 + 
 + 
 +[[DokuWiki]] 能够从外部的XML feed中聚合数据。用[[http://simplepie.org/|SimplePie]] 解析这些XML feed。 所有 SimplePie 支持的格式都可以在DokuWiki中使用。 您可以通过多个参数来改变其显示,参数之间用空格隔开:
  
-===== RSS/ATOM Feed Aggregation ===== +^ 参数  ^ 描述 ^ 
-[[DokuWiki]] can integrate data from external XML feeds. For parsing the XML feeds, [[http://simplepie.org/|SimplePie]] is used. All formats understood by SimplePie can be used in DokuWiki as well. You can influence the rendering by multiple additional space separated parameters:+| any number | 最多显示多少内容项;默认是8 | 
 +| reverse    | 将最新条目显示在前面 | 
 +| author     | 显示条目的作者名 | 
 +| date       | 显示条目日期 | 
 +| description| 显示条目的描述;如果 [[doku>config:htmlok|HTML]] HTML被禁用,所有的标签将被过滤掉 | 
 +//n//[dhm| 刷新周期,其中,d=天,h=小时,m=分。例如,12h=12个小时。|
  
-^ Parameter  ^ Description ^ +刷新周期默认是4小时。小于或者等于10分钟均视为10分钟。[[wiki:DokuWiki]] 通常会提供页面的缓存版,显然,这种做法不适用于包含动态外部内容的页面。上面的参数告诉 [[wiki:DokuWiki]] 如果离上次重新解释的时间已经超出了 //刷新周期//,则重新解释页面。
-| any number | will be used as maximum number items to show, defaults to 8 | +
-| reverse    | display the last items in the feed first | +
-| author     | show item authors names | +
-| date       | show item dates | +
-| description| show the item description. If [[doku>config:htmlok|HTML]] is disabled all tags will be stripped | +
-//n//[dhm] | refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours). |+
  
-The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. [[wiki:DokuWiki]] will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells [[wiki:DokuWiki]] to re-render the page if it is more than //refresh period// since the page was last rendered. 
  
-**Example:**+**举例:**
  
   {{rss>http://slashdot.org/index.rss 5 author date 1h }}   {{rss>http://slashdot.org/index.rss 5 author date 1h }}