创客百科

姿势共享,有节操无门槛参与的创客百科,创客动力之源 \ (^_^) /

用户工具

站点工具


wiki:syntax

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

后一修订版
前一修订版
wiki:syntax [2017/03/20 11:39]
127.0.0.1 外部编辑
wiki:syntax [2017/04/29 18:59] (当前版本)
行 1: 行 1:
-====== ​Formatting Syntax ​======+====== ​Wiki格式语法说明 ​======
  
-[[doku>​DokuWiki]] supports some simple markup languagewhich tries to make the datafiles to be as readable as possible. This page contains all possible syntax you may use when editing the pages. Simply have a look at the source of this page by pressing "Edit this page". If you want to try something, just use the [[playground:​playground|playground]] page. The simpler markup is easily accessible via [[doku>​toolbar|quickbuttons]],​ too.+[[wiki:Wiki]] 支持一些简单的标记语言以尽最大可能使文档看上去更友好。本页面包含了所有你在编辑页面时可能用到的语法的说明。如果需要查看本页源码,只需要点击页面顶部或者底部的 //​编辑本页//​ 按钮即可。\\ 
 +如果您是初尝Wiki,那么可以使用 ​[[playground:​playground|Wiki砂箱]] 来尽情挥洒。
  
-===== Basic Text Formatting ​=====+===== 基本文本格式 ​=====
  
-DokuWiki supports ​**bold**//italic//, __underlined__ and ''​monospaced'' ​texts. Of course you can **__//''​combine''//​__** ​all these.+Wiki支持 ​**粗体**, //斜体//, __下划线__ 以及 ​''​等宽体'' ​等格式。当然,您也可以 ​**__//''​混合使用''//​__** ​所有这些格式。
  
-  ​DokuWiki supports ​**bold**//italic//, __underlined__ ​and ''​monospaced'' ​texts. +  ​Wiki支持 ​**粗体**, //斜体//, __下划线__ ​and ''​等宽体'' ​等格式。 
-  ​Of course you can **__//''​combine''//​__** ​all these.+  ​当然,您也可以 ​**__//''​混合使用''//​__** ​所有这些格式。
  
-You can use <sub>subscript</​sub> ​and <sup>superscript</​sup>​, too.+可以使用 ​<sub>下标</​sub> ​和 <sup>上标</​sup>​
  
-  ​You can use <sub>subscript</​sub> ​and <sup>superscript</​sup>​, too.+  ​可以使用 ​<sub>下标</​sub> ​和 <sup>上标</​sup>​
  
-You can mark something as <del>deleted</​del> ​as well.+您也可以使用 ​<del>删除线</​del> ​标记某些信息。
  
-  ​You can mark something as <del>deleted</​del> ​as well.+  ​您也可以使用 ​<del>删除线</​del> ​标记某些信息。
  
-**Paragraphs** are created from blank lines. If you want to **force a newline** without a paragraph, you can use two backslashes followed by a whitespace or the end of line.+**段落** 是由空行所建立的。如果您想 ​**强制建立新行** 而不建立段落,您可以使用两个连续的反斜杠+空格或是回车作为标记。请看样例:
  
-This is some text with some linebreaks\\ Note that the +这是一些有着换行标记的文字。\\ 请注意 
-two backslashes are only recognized at the end of a line\\ +反斜杠只在回车符之前\\ 
-or followed by\\ a whitespace ​\\this happens without it.+或者在\\ 一个空格之前的时候才有效。 ​\\而这样就并不起作用。
  
-  ​This is some text with some linebreaks\\ Note that the +  ​这是一些有着换行标记的文字。\\ 请注意 
-  ​two backslashes are only recognized at the end of a line\\ +  ​反斜杠只在回车符之前\\ 
-  ​or followed by\\ a whitespace ​\\this happens without it.+  ​或者在\\ 一个空格之前的时候才有效。 ​\\而这样就并不起作用。
  
-You should use forced newlines only if really needed.+请只在必须的时候才使用强制的换行标记。
  
-===== Links =====+===== 链接 ​=====
  
-DokuWiki supports multiple ways of creating links.+Wiki支持多种形式的链接。
  
-==== External ​====+==== 外部链接 ​====
  
-External links are recognized automagically: ​http://​www.google.com ​or simply ​www.google.com - You can set the link text as well: [[http://​www.google.com|This Link points to google]]. ​Email addresses like this one: <​andi@splitbrain.org> ​are recognized, too.+外部链接会被自动地识别: ​http://​www.google.com ​或者简单地写作 ​www.google.com - 当然您也可以为链接设置名字: ​[[http://​www.google.com|链接到google]]. ​类似这样的电子邮件地址: ​<​andi@splitbrain.org> ​也可以被识别。
  
-  ​DokuWiki supports multiple ways of creating links. External links are recognized +  ​Wiki支持多种形式的链接。外部链接会被自动地识别: 
-  ​automagically: ​http://​www.google.com ​or simply ​www.google.com ​- You can set +  http://​www.google.com ​或者简单地写作 ​www.google.com 
-  ​link text as well: [[http://​www.google.com|This Link points to google]]. Email +  ​- 当然您也可以为链接设置名字: ​[[http://​www.google.com|链接到google]] 
-  ​addresses like this one: <​andi@splitbrain.org> ​are recognized, too.+  ​类似这样的电子邮件地址: ​<​andi@splitbrain.org> ​也可以被识别。
  
-==== Internal ​====+==== 内部链接 ​====
  
-Internal links are created by using square brackets. You can either just give a [[pagename]] ​or use an additional ​[[pagename|link text]].+内部链接可以用方括号创建。您可以只给出链接的地址:[[wiki:pagename]],也可以附加上链接的名字:[[wiki:pagename|我的链接]]。Wiki的页面名字将会被自动地识别为小写字母,并且不允许使用特殊字符。
  
-  ​Internal links are created by using square brackets. You can either just give +  ​内部链接可以用方括号创建。您可以只给出链接的地址:[[pagename]], 
-  a [[pagename]] ​or use an additional ​[[pagename|link text]].+  也可以附加上链接的名字:[[pagename|我的链接]]。 
 +  Wiki的页面名字将会被自动地识别为小写字母,并且不允许使用特殊字符。
  
-[[doku>​pagename|Wiki pagenames]] are converted to lowercase automatically,​ special characters are not allowed.+您可以通过在页面名中使用冒号的方式来使用 ​[[wiki:​namespaces|命名空间]]
  
-You can use [[some:​namespaces]] ​by using a colon in the pagename.+  您可以通过在页面名中使用冒号的方式来使用 ​[[wiki:namespaces|命名空间]]
  
-  You can use [[some:​namespaces]] ​by using a colon in the pagename.+如果您需要关于**命名空间(namespaces)**的更详细的信息,请参见 ​[[wiki:​namespaces]]
  
-For details about namespaces see [[doku>​namespaces]].+您也可以链接到一个网页内部的某一节,只需要将该节书签的名称以一个#​号分隔加在网页的地址后面即可。这是一个连向 ​[[syntax#​internal|本节]] 的链接。
  
-Linking to a specific section is possible, too. Just add the section name behind a hash character as known from HTML. This links to [[syntax#​internal|this Section]].+  这是一个连向 ​[[syntax#​internal|本节]] 的链接。
  
-  This links to [[syntax#​internal|this Section]].+注:
  
-Notes:+  * 到 [[wiki:syntax|已存在页面]] 的链接和到 [[wiki:​nonexisting|未存在页面]] 的链接,其外观是不同的。 
 +  * 默认情况下,Wiki不使用 [[wp>​CamelCase]] 来自动建立链接,(CamelCase类似于PmWiki中的WikiWord)。但是也可以在 [[config|设置文件]] 中启用它。 Hint: If Wiki is a link, then it's enabled. 
 +  * 当一节的标题改变时,该节的书签也会改变,因此,请不要太依靠网页内的链接。
  
-  * Links to [[syntax|existing pages]] are shown in a different style from [[nonexisting]] ones. +==== Wiki间链接 ====
-  * DokuWiki does not use [[wp>​CamelCase]] to automatically create links by default, but this behavior can be enabled in the [[doku>​config]] file. Hint: If DokuWiki is a link, then it's enabled. +
-  * When a section'​s heading is changed, its bookmark changes, too. So don't rely on section linking too much.+
  
-==== Interwiki ====+Wiki支持 [[wiki:​interwiki|Wiki间链接]] ,即到其他wiki的链接。例如,这是一个到Wikipedia上关于Wiki的一个页面的的链接: [[wp>​Wiki]]
  
-DokuWiki supports ​[[doku>​Interwiki]] links. These are quick links to other Wikis. For example this is a link to Wikipedia's page about Wikis: ​[[wp>​Wiki]].+  Wiki支持 ​[[interwiki|Wiki间链接]] ,即到其他wiki的链接。 
 +  例如,这是一个到Wikipedia上关于Wiki的一个页面的的链接: ​[[wp>​Wiki]] ​
  
-  DokuWiki supports [[doku>​Interwiki]] links. These are quick links to other Wikis. +==== Windows共享文件夹 ====
-  For example this is a link to Wikipedia'​s page about Wikis: [[wp>​Wiki]].+
  
-==== Windows ​Shares ====+Windows共享文件夹,例如 [[\\server\share|this]] 也可以被识别。请注意,这只在内部 [[wp>​Intranet|局域网]] 等环境中才可能被成功访问。
  
-Windows ​shares like [[\\server\share|this]] ​are recognized, too. Please note that these only make sense in a homogeneous user group like a corporate [[wp>​Intranet]].+  ​Windows共享文件夹,例如 ​[[\\server\share|this]] ​也可以被识别。
  
-  Windows Shares like [[\\server\share|this]] are recognized, too.+注:
  
-Notes:+  * 出于安全原因,只有在微软IE浏览器上才能够直接访问Windows共享文件夹。
  
-  * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone"​). 
-  * For Mozilla and Firefox it can be enabled through different workaround mentioned in the [[http://​kb.mozillazine.org/​Links_to_local_pages_do_not_work|Mozilla Knowledge Base]]. However, there will still be a JavaScript warning about trying to open a Windows Share. To remove this warning (for all users), put the following line in ''​conf/​lang/​en/​lang.php''​ (more details at [[doku>​localization#​changing_some_localized_texts_and_strings_in_your_installation|localization]]):​ <code - conf/​lang/​en/​lang.php>​ 
-<?php 
-/** 
- * Customization of the english language file 
- * Copy only the strings that needs to be modified 
- */ 
-$lang['​js'​]['​nosmblinks'​] = '';​ 
-</​code>​ 
- 
-==== Image Links ==== 
  
-You can also use an image to link to another internal or external page by combining the syntax for links and [[#​images_and_other_files|images]] (see below) like this:+==== 图像链接 ====
  
-  [[http://​php.net|{{wiki:​dokuwiki-128.png}}]]+您也可以用图像来作为一个内部或者外部的链接,只需同时使用链接和图像的语法,如下所示:
  
-[[http://​php.net|{{wiki:​dokuwiki-128.png}}]]+  ​[[http://www.php.net|{{wiki:​dokuwiki-128.png}}]]
  
-Please noteThe image formatting is the only formatting syntax accepted in link names.+[[http://www.php.net|{{wiki:​dokuwiki-128.png}}]]
  
-The whole [[#​images_and_other_files|image]] and [[#​links|link]] syntax is supported (including image resizing, internal and external images and URLs and interwiki links).+请注意:在链接名中使用语法,只有显示图像的语法会被识别,请不要使用其它语法。
  
-===== Footnotes ​=====+===== 脚注 ​=====
  
-You can add footnotes ​((This is a footnote)) by using double parentheses.+您可以使用两个连续小括号来添加脚注((看这里,这是一个脚注))
  
-  ​You can add footnotes ​((This is a footnote)) by using double parentheses.+  ​您可以使用两个连续小括号来添加脚注((看这里,这是一个脚注))。 
 +   
 +  
 +syntax的管理员,请检查脚注确实为<​sup>​1)</​sup>​,而不是为<​sup>​1</​sup>​
  
-===== Sectioning ​=====+===== 标题段落 ​=====
  
-You can use up to five different levels of headlines to structure your content. If you have more than three headlines, a table of contents is generated automatically -- this can be disabled by including the string ​''<​nowiki>​~~NOTOC~~</​nowiki>'' ​in the document.+您可以使用最多达5层的标题来使您的页面更富结构性。如果您使用了三个以上的标题,那么Wiki会自动在页面上生成一个名为“本页目录”的标题列表。当然,您也可以关闭这项特性,只需在编辑时在页面里加入 ​''<​nowiki>​~~NOTOC~~</​nowiki>'' ​字样即可。
  
-==== Headline Level 3 ==== +==== H3标题 ​==== 
-=== Headline Level 4 === +=== H4标题 ​=== 
-== Headline Level 5 ==+== H5标题 ​==
  
-  ==== Headline Level 3 ==== +  ==== H3标题 ​==== 
-  === Headline Level 4 === +  === H4标题 ​=== 
-  == Headline Level 5 ==+  == H5标题 ​==
  
-By using four or more dashes, you can make a horizontal line:+您可以通过连续的4个以上“-”号来创建一条水平分割线:
  
 ---- ----
  
-===== Media Files ===== 
  
-You can include external and internal [[doku>​images|images,​ videos and audio files]] with curly brackets. Optionally you can specify the size of them.+===== 图像和其它文件 =====
  
-Real size:                        {{wiki:​dokuwiki-128.png}}+您可以使用双大括号来在页面中加入 [[images|图像]] 。您还可以选择是否指定图像的显示大小。
  
-Resize to given width: ​           ​{{wiki:​dokuwiki-128.png?50}}+原始大小: ​                       ​{{wiki:​dokuwiki-128.png}}
  
-Resize to given width and height((when the aspect ratio of the given width and height doesn'​t match that of the image, it will be cropped to the new ratio before resizing)): ​{{wiki:​dokuwiki-128.png?​200x50}}+指定宽度: ​                       ​{{wiki:​dokuwiki-128.png?​50}}
  
-Resized external image: ​          {{http://​php.net/​images/​php.gif?200x50}}+指定宽度和高度: ​                 ​{{wiki:dokuwiki-128.png?200x50}}
  
-  Real size:                        {{wiki:​dokuwiki-128.png}} +重新指定宽度和高度的外部图像: ​   ​{{http://de3.php.net/​images/​php.gif?​200x50}}
-  Resize to given width: ​           {{wiki:​dokuwiki-128.png?​50}} +
-  Resize to given width and height: {{wiki:​dokuwiki-128.png?​200x50}} +
-  Resized external image: ​          {{http://​php.net/​images/​php.gif?​200x50}}+
  
 +  原始大小: ​                       {{wiki:​dokuwiki-128.png}}
 +  指定宽度: ​                       {{wiki:​dokuwiki-128.png?​50}}
 +  指定宽度和高度: ​                 {{wiki:​dokuwiki-128.png?​200*50}}
 +  重新指定宽度和高度的外部图像: ​   {{http://​de3.php.net/​images/​php.gif?​200x50}}
  
-By using left or right whitespaces you can choose the alignment.+使用左方或者右方的空格,您可以选择对齐方式:
  
 {{ wiki:​dokuwiki-128.png}} {{ wiki:​dokuwiki-128.png}}
行 157: 行 151:
   {{ wiki:​dokuwiki-128.png }}   {{ wiki:​dokuwiki-128.png }}
  
-Of course, you can add a title (displayed as a tooltip by most browsers), too.+当然,您也可以指定一个图像的名字,将鼠标移到图像上可以看到效果。
  
-{{ wiki:​dokuwiki-128.png |This is the caption}}+{{ wiki:​dokuwiki-128.png |这是图像的名字}}
  
-  {{ wiki:​dokuwiki-128.png |This is the caption}}+  {{ wiki:​dokuwiki-128.png |这是图像的名字}}
  
-For linking an image to another page see [[#Image Links]] above.+如果您指定的文件名(无论是外部的还是内部的)不是一个图像(''​gif,​jpeg,​png''​),那么它将被显示为一个链接。
  
-==== Supported Media Formats ​====+===== 列表 =====
  
-DokuWiki can embed the following media formats directly.+Dokuwiki支持带编号或不带编号的列表。要使用列表,在文字前加入两个空格,然后使用''​*''​标志不带编号的列表,用''​-''​标志带编号的列表。
  
-| Image | ''​gif'',​ ''​jpg'',​ ''​png'' ​ | +  * 列表 
-| Video | ''​webm'',​ ''​ogv'',​ ''​mp4''​ | +  * 第二项 
-| Audio | ''​ogg'',​ ''​mp3'',​ ''​wav'' ​ +    * 下一层 
-| Flash | ''​swf'' ​                   |+  ​* 第三项
  
-If you specify a filename that is not a supported media format, then it will be displayed as a link instead. +  ​带编号的列表 
- +  - 第二项 
-By adding ''?​linkonly''​ you provide a link to the media without displaying it inline +    - 用缩进表示更深的层 
- +  - 完了
-  {{wiki:​dokuwiki-128.png?​linkonly}} +
- +
-{{wiki:​dokuwiki-128.png?​linkonly}} This is just a link to the image. +
- +
-==== Fallback Formats ==== +
- +
-Unfortunately not all browsers understand all video and audio formats. To mitigate the problem, you can upload your file in different formats for maximum browser compatibility. +
- +
-For example consider this embedded mp4 video: +
- +
-  {{video.mp4|A funny video}} +
- +
-When you upload a ''​video.webm''​ and ''​video.ogv''​ next to the referenced ''​video.mp4'',​ DokuWiki will automatically add them as alternatives so that one of the three files is understood by your browser. +
- +
-Additionally DokuWiki supports a "​poster"​ image which will be shown before the video has started. That image needs to have the same filename as the video and be either a jpg or png file. In the example above a ''​video.jpg''​ file would work. +
- +
-===== Lists ===== +
- +
-Dokuwiki supports ordered and unordered lists. To create a list item, indent your text by two spaces and use a ''​*''​ for unordered lists or a ''​-''​ for ordered ones. +
- +
-  * This is a list +
-  * The second item +
-    * You may have different levels +
-  * Another item +
- +
-  ​The same list but ordered +
-  - Another item +
-    - Just use indention for deeper levels +
-  - That's it+
  
 <​code>​ <​code>​
-  * This is a list +  * 列表 
-  * The second item +  * 第二项 
-    * You may have different levels +    * 下一层 
-  * Another item+  * 第三项
  
-  - The same list but ordered +  - 带编号的列表 
-  - Another item +  - 第二项 
-    - Just use indention for deeper levels +    - 用缩进表示更深的层 
-  - That's it+  - 完了
 </​code>​ </​code>​
  
-Also take a look at the [[doku>​faq:​lists|FAQ on list items]]. +===== 表情符号 ​=====
- +
-===== Text Conversions ​===== +
- +
-DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML. +
- +
-The text to image conversion is mainly done for smileys. And the text to HTML conversion is used for typography replacements,​ but can be configured to use other HTML as well. +
- +
-==== Text to Image Conversions ​====+
  
-DokuWiki converts commonly used [[wp>​emoticon]]s to their graphical equivalentsThose [[doku>​Smileys]] and other images can be configured and extended. Here is an overview of Smileys included in DokuWiki:+Wiki会将一些常用的  ​[[wp>​emoticon|表情符号]] 转换为图像。除了默认的表情符号以外,您也可以在 ''​smiley''​ 文件夹中放入更多的表情图,然后在 ''​conf/​smileys.conf''​ 中设置它们即可。下面是Dokuwiki包含了的表情图像:
  
   * 8-) %%  8-)  %%   * 8-) %%  8-)  %%
行 253: 行 210:
   * DELETEME %% DELETEME %%   * DELETEME %% DELETEME %%
  
-==== Text to HTML Conversions ​====+===== 印刷样式 =====
  
-Typography: ​[[DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters.+[[Wiki]]可以将特定字符转换为印刷时所用的样式。下面是可以识别的这类字符的列表:
  
 -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r)
行 265: 行 222:
 </​code>​ </​code>​
  
-The same can be done to produce any kind of HTML, it just needs to be added to the [[doku>​entities|pattern file]].+请注意:在配置文件中可以禁用这类自动转换。
  
-There are three exceptions which do not come from that pattern file: multiplication entity (640x480), '​single'​ and "​double quotes"​. They can be turned off through a [[doku>​config:​typography|config option]].+===== 表格 =====
  
-===== Quoting =====+Wiki可以用简单的语法创建表格。 ​
  
-Some times you want to mark some text to show it's a reply or comment. You can use the following syntax:+^ 标题1 ​       ^ 标题2 ​        ^ 标题3 ​      ^ 
 +| (1,1)        | (1,2)         | (1,3)       | 
 +| (2,1)        | 展宽的单元格 ​              || 
 +| (3,1)        | (3,2)         | (3,3)       |
  
-<​code>​ +表格的每一行都以分隔符 ''​|''​ (普通行)或者 ''​^''​ (标题行)作为开头和结束。
-I think we should do it+
  
-> No we shouldn'​t+  ^ 标题1 ​       ^ 标题2 ​        ^ 标题3 ​      ^ 
 +  | (1,1)        | (1,2)         | (1,3)       | 
 +  | (2,1)        | 展宽的单元格 ​              || 
 +  | (3,1)        | (3,2)         | (3,3)       |
  
->> Well, I say we should+要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符!
  
-> Really?+竖直的标题列也是可以实现的:
  
->> Yes!+|          ^ 标题1 ​         ^ 标题2 ​         ^ 
 +^ 标题3 ​   | (1,2)          | (1,3)          | 
 +^ 标题4 ​   | 不再合并单元格 |                | 
 +^ 标题5 ​   | (2,2)          | (2,3)          |
  
->>>​ Then lets do it! +可以看到,单元格前面的分隔符决定了单元格的格式。
-</​code>​+
  
-I think we should do it+  |          ^ 标题1 ​         ^ 标题2 ​         ^ 
 +  ^ 标题3 ​   | (1,2)          | (1,3)          | 
 +  ^ 标题4 ​   | 不再合并单元格 |                | 
 +  ^ 标题5 ​   | (2,2)          | (2,3)          |
  
-> No we shouldn'​t+注:垂直合并单元格尚未实现。
  
->> Well, I say we should+您可以对齐表格的文字。只需要添加多余两个的空格在您需要对齐的方向的反向即可:如果需要右对齐,在左边添加两个空格;反之,则在右边添加。在两边均添加空格可以实现中间对齐。
  
-> Really? +          有对齐的表格 ​                  ^^^ 
- +|        ​右对齐|     居中 ​    |左对齐 ​       | 
->> Yes! +|左对齐 ​       ​| ​       ​右对齐    居中 ​    |
- +
->>>​ Then lets do it! +
- +
-===== Tables ===== +
- +
-DokuWiki supports a simple syntax to create tables. +
- +
-Heading 1      ​Heading 2       Heading 3          ​+
-Row 1 Col 1    | Row 1 Col 2     | Row 1 Col 3        | +
-| Row 2 Col 1    | some colspan (note the double pipe) || +
-| Row 3 Col 1    | Row 3 Col 2     ​| Row 3 Col 3        | +
- +
-Table rows have to start and end with a ''​|''​ for normal rows or a ''​^''​ for headers. +
- +
-  ^ Heading 1      ^ Heading 2       ^ Heading 3          ^ +
-  | Row 1 Col 1    | Row 1 Col 2     | Row 1 Col 3        | +
-  Row 2 Col 1    | some colspan (note the double pipe) || +
-  | Row 3 Col 1    | Row 3 Col 2     | Row 3 Col 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          ^ +
-^ Heading 3    | Row 1 Col 2          | Row 1 Col 3        | +
-^ Heading 4    | no colspan this time |                    | +
-^ Heading 5    | Row 2 Col 2          | Row 2 Col 3        | +
- +
-As you can see, it's the cell separator before a cell which decides about the formatting:​ +
- +
-  |              ^ Heading 1            ^ Heading 2          ^ +
-  ^ Heading 3    | Row 1 Col 2          | Row 1 Col 3        | +
-  ^ Heading 4    | no colspan this time |                    | +
-  ^ Heading 5    | Row 2 Col 2          | Row 2 Col 3        | +
- +
-You can have rowspans (vertically connected cells) by adding ''​%%:::​%%''​ into the cells below the one to which they should connect. +
- +
-^ Heading 1      ^ Heading 2                  ^ Heading 3          ^ +
-| Row 1 Col 1    | this cell spans vertically | Row 1 Col 3        | +
-| Row 2 Col 1    | :::                        | Row 2 Col 3        | +
-| Row 3 Col 1    | :::                        | Row 2 Col 3        | +
- +
-Apart from the rowspan syntax those cells should not contain anything else. +
- +
-  ^ Heading 1      ^ Heading 2                  ^ Heading 3          ^ +
-  | Row 1 Col 1    | this cell spans vertically | Row 1 Col 3        | +
-  | Row 2 Col 1    | :::                        | Row 2 Col 3        | +
-  | Row 3 Col 1    | :::                        | Row 2 Col 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 ===== +您可以在文章中插入无格式区块,在这些区块中Wiki语法将不起作用。可以有三种方法:在行前加两个以上的空格(前面做样例时用的方法),或者可以使用 ​''​Code'' ​或 ''​file'' ​标记。
- +
-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>​ +
-This is some text which contains addresses like this: http://​www.splitbrain.org and **formatting**,​ but nothing is done with it. +
-</​nowiki>​ +
-The same is true for %%//​__this__ text// with a smiley ;-)%%. +
- +
-  <​nowiki>​ +
-  This is some text which contains addresses like this: http://​www.splitbrain.org and **formatting**,​ but nothing is done with it. +
-  </​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>%%''​+
- +
-  This is text is indented by two spaces.+
  
 <​code>​ <​code>​
-This is preformatted ​code all spaces are preserved: like              <-this+这是一段被code包围的区块,其中的空格都被保留了:像 ​             <-这样
 </​code>​ </​code>​
  
 <​file>​ <​file>​
-This is pretty much the same, but you could use it to show that you quoted a file.+和code是类似的。不过您可以用这个来表示您引用了一个文件的内容。  ​
 </​file>​ </​file>​
  
-Those blocks were created by this source:+要让Wiki语法解释完全失效,可以用 ''​nowiki''​ 标签包围整个区块,或者也可以简单地使用双百分号标记 ''<​nowiki>​%%</​nowiki>''​。
  
-    This is text is indented by two spaces.+<​nowiki>​ 
 +这是一段完全没有Wiki语法解释的文字,例如:http://​www.splitbrain.org , **粗体**,虽然按照语法书写,但是它们并没有被解释。 
 +</​nowiki>​
  
-  <​code>​ +如何使用这些标记,请查看这一段的源文件。
-  This is preformatted code all spaces are preserved: like              <-this +
-  </​code>​+
  
-  <​file>​ 
-  This is pretty much the same, but you could use it to show that you quoted a 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 uses the same code and file blocks described in the previous section, but this time the name of the language syntax to be highlighted is included inside the tag, e.g. ''<​nowiki><​code java></​nowiki>'' ​or ''<​nowiki><​file java></​nowiki>''​.+[[Wiki]] 可以将源代码作语法高亮以增加可读性。它使用称作 ​[[http://​qbnz.com/​highlighter/​|GeSHi]] ​的通用语法高亮工具(Generic Syntax Highlighter)——所有被GeSHi支持的语言都可以在Wiki中得到高亮。使用code标记的方法和上面是类似的,不过需要指定使用的语言,例如: ​''<​nowiki><​code java></​nowiki>''​
  
 <code java> <code java>
-/**+/** 
  * The HelloWorldApp class implements an application that  * The HelloWorldApp class implements an application that
  * simply displays "Hello World!"​ to the standard output.  * simply displays "Hello World!"​ to the standard output.
行 417: 行 309:
 </​code>​ </​code>​
  
-The following language strings are currently recognized: ​//4cs, 6502acme, 6502kickass,​ 6502tasm, 68000devpac,​ abap, actionscript-french, actionscript,​ actionscript3, ada, algol68, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4glbf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, ​diff, div, dos, dot, e, epc, ecmascript, eiffel, email, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, go, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, html5, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas,​ lotusscript,​ lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml-brief,​ ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender,​ pli, plsql, postgresql, povray, powerbuilder,​ powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, 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, uscript, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog,​ whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic//+现在,Wiki可以支持的语言有: ​//​actionscript,​ ada, apache, asm, asp, bash, caddclcadlisp, c, c_mac, cpp, csharp, css, delphi, ​html4strict, java, javascript, lisp, lua, nsis, objc, oobas, pascal, perl, php-brief, php, python, qbasic, smarty, sql, vb, vbnet, visualfoxpro,​ xml//
  
-==== 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 do this by specifying a file name after language code like this: 
  
 +===== 嵌入评论框 =====
 +
 +您可以将以下标记加入到词条的末尾,这样可以允许其他人可以对这个词条进行评论。例如:
 <​code>​ <​code>​
-<file php myexample.php>​ +===== 评论 ===== 
-<?php echo "hello world!";​ ?> +[duoshuo]
-</​file>​+
 </​code>​ </​code>​
  
-<file php myexample.php>​ +===== 嵌入HTMLPHP =====
-<?php echo "hello world!";​ ?> +
-</​file>​ +
- +
-If you don't want any highlighting but want a downloadable file, specify a dash (''​-''​) as the language code: ''​%%<​code - myfile.foo>​%%''​. +
- +
- +
-===== Embedding ​HTML and PHP ===== +
- +
-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:+
  
 +您可以使用 ''​html''​ 或者 ''​php''​标记在文档中嵌入HTML或PHP的代码。例如:
 <​code>​ <​code>​
 <​html>​ <​html>​
-This is some <span style="color:red;font-size:150%;">inline ​HTML</span>+这是 ​<font color="red" ​size="+1">​HTML</​font代码。
 </​html>​ </​html>​
-<​HTML>​ 
-<p style="​border:​2px dashed red;">​And this is some block HTML</​p>​ 
-</​HTML>​ 
 </​code>​ </​code>​
  
 <​html>​ <​html>​
-This is some <span style="color:red;font-size:150%;">inline ​HTML</span>+这是 ​<font color="red" ​size="+1">​HTML</​font代码。
 </​html>​ </​html>​
-<​HTML>​ 
-<p style="​border:​2px dashed red;">​And this is some block HTML</​p>​ 
-</​HTML>​ 
- 
-PHP example: 
  
 <​code>​ <​code>​
 <php> <php>
-echo 'The PHP version: ​'+echo 'PHP生成的logo:'; 
-echo phpversion()+echo '<img src="'​ . $_SERVER['​PHP_SELF'​] . '?​='​ . php_logo_guid() . '"​ alt="​PHP Logo !" />';
-echo ' (generated inline HTML)';+
 </​php>​ </​php>​
-<PHP> 
-echo '<​table class="​inline"><​tr><​td>​The same, but inside a block level element:</​td>';​ 
-echo '<​td>'​.phpversion().'</​td>';​ 
-echo '</​tr></​table>';​ 
-</​PHP>​ 
 </​code>​ </​code>​
  
 <php> <php>
-echo 'The PHP version: ​'+echo 'PHP生成的logo:'; 
-echo phpversion()+echo '<img src="'​ . $_SERVER['​PHP_SELF'​] . '?​='​ . php_logo_guid() . '"​ alt="​PHP Logo !" />';
-echo ' (inline HTML)';+
 </​php>​ </​php>​
-<PHP> 
-echo '<​table class="​inline"><​tr><​td>​The same, but inside a block level element:</​td>';​ 
-echo '<​td>'​.phpversion().'</​td>';​ 
-echo '</​tr></​table>';​ 
-</​PHP>​ 
- 
-**Please Note**: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed. 
- 
-===== 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: 
- 
-^ Parameter ​ ^ Description ^ 
-| 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 | 
-| nosort ​    | do not sort the items in the feed | 
-| //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. 
- 
-By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the ''​reverse''​ parameter, or display the feed as is with ''​nosort''​. 
- 
-**Example:​** 
- 
-  {{rss>​http://​slashdot.org/​index.rss 5 author date 1h }} 
- 
-{{rss>​http://​slashdot.org/​index.rss 5 author date 1h }} 
- 
- 
-===== Control Macros ===== 
- 
-Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble: 
- 
-^ Macro           ^ Description | 
-| %%~~NOTOC~~%% ​  | If this macro is found on the page, no table of contents will be created | 
-| %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the %%<​php>​%% syntax above is used), adding this macro will force DokuWiki to rerender a page on every call | 
- 
-===== Syntax Plugins ===== 
- 
-DokuWiki'​s syntax can be extended by [[doku>​plugins|Plugins]]. How the installed plugins are used is described on their appropriate description pages. The following syntax plugins are available in this particular DokuWiki installation:​ 
- 
-~~INFO:​syntaxplugins~~ 
  
 +**请注意**: HTML和PHP嵌入的功能默认情况下是被禁用的,因此,您可能无法看到上面的代码运行的结果而只能够看见源代码,这取决于Wiki站点的设置。(?​)
wiki/syntax.1489981180.txt.gz · 最后更改: 2017/03/20 11:39 由 127.0.0.1