用户工具

站点工具


wiki:syntax

差别

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

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
wiki:syntax [2023/07/06 12:17] – 外部编辑 127.0.0.1wiki:syntax [2023/08/04 14:46] (当前版本) – 已恢复为旧版 (2023/07/06 06:52) 弘毅
行 1: 行 1:
-====== Formatting Syntax ======+====== WIKI语法手册 ======
  
-[[doku>DokuWiki]] supports some simple markup language, which 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.+[[doku>DokuWiki]] 支持一些简单的标记语言,它试图使数据文件尽可能地易读。 此页面包含您在编辑页面时可能使用的所有语法。只需按“编辑此页面”即可查看此页面的来源。 更简单的标记也可以通过quickbuttons轻松访问。
  
-===== Basic Text Formatting =====+===== 基本文本格式 =====
  
-DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' textsOf course you can **__//''combine''//__** all these.+DokuWiki 支持 **粗体**, //斜体//, __下划线__ 与 ''等宽'' 文本当然 **__//''混合体''//__** 你也可以使用.
  
-  DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' texts+  DokuWiki 支持 **粗体**, //斜体//, __下划线__ 与 ''等宽'' 文本
-  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 支持多种创建链接的方式。
  
-DokuWiki supports multiple ways of creating links.+==== 外部链接 ====
  
-==== External ====+外部链接会自动识别:http://www.google.com 或简写 www.google.com
  
-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|此链接指向google]]. 
  
-  DokuWiki supports multiple ways of creating links. External links are recognized +像这样的电子邮件地址也可以识别: <andi@splitbrain.org>.
-  automagically: http://www.google.com or simply www.google.com - You can set +
-  link text as well: [[http://www.google.com|This Link points to google]]. Email +
-  addresses like this one: <andi@splitbrain.org> are recognized, too.+
  
-==== Internal ====+  DokuWiki 支持多种创建链接的方式.  
 +  外部链接会自动识别:http://www.google.com 或简写 www.google.com  
 +  您也可以设置链接文本: [[http://www.google.com|此链接指向google]].  
 +  像这样的电子邮件地址也可以识别: <andi@splitbrain.org>.
  
-Internal links are created by using square brackets. You can either just give a [[pagename]] or use an additional [[pagename|link text]].+==== 内部链接 ====
  
-  Internal links are created by using square brackets. You can either just give +内部链接是使用方括号创建的。你可以只给出一个 [[页面名称]] 或使用其他的 [[页面名称|链接文本]]
-  a [[pagename]] or use an additional [[pagename|link text]].+
  
-[[doku>pagename|Wiki pagenames]] are converted to lowercase automatically, special characters are not allowed.+  内部链接是使用方括号创建的。 
 +  你可以只给出一个 [[页面名称]] 或使用其他的 [[页面名称|链接文本]]
  
-You can use [[some:namespaces]] by using a colon in the pagename.+[[doku>pagename|Wiki 页面]] 名称会自动转换为小写,不允许使用特殊字符(比如中文)。
  
-  You can use [[some:namespaces]] by using a colon in the pagename.+你可以通过冒号(:)来使用 [[some:命名空间]]
  
-For details about namespaces see [[doku>namespaces]].+  你可以通过冒号(:)来使用 [[some:命名空间]]
  
-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]].+查看更多关于 [[doku>namespaces|命名空间]]
  
-  This links to [[syntax#internal|this Section]].+通过井号(#)后添加锚点可实现链接至页面的 [[syntax#internal|特定区域]]
  
-Notes:+  链接至页面的 [[syntax#internal|特定区域]]。
  
-  * Links to [[syntax|existing pages]] are shown in a different style from [[nonexisting]] ones. +注意:
-  * 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 ====+  * [[syntax|有效页面]] 与 [[nonexisting|失效页面]] 的显示样式不同。 
 +  * DokuWiki 并不自动使用 [[wp>CamelCase|驼峰命名法]],但在 [[doku>config|配置文件]] 中 DokuWiki 会使用。提示:假如 DokuWiki 是一个有效的页面,它仍可被链接。 
 +  * 请勿过度使用特定区域,因为当文档标题改变时它并不会同步改变。
  
-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]].+==== 内部维基 ====
  
-  DokuWiki supports [[doku>Interwiki]] links. These are quick links to other Wikis. +DokuWiki 支持 [[doku>Interwiki|内部维基]]。内部维基可以快速地链接至 [[wp>Wiki|其他维基页面]]。 
-  For example this is a link to Wikipedia's page about Wikis: [[wp>Wiki]].+ 
 +  DokuWiki 支持 [[doku>Interwiki|内部维基]]。内部维基可以快速地链接至 [[wp>Wiki|其他维基页面]]
  
 ==== Windows Shares ==== ==== Windows Shares ====
  
-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]].+DokuWiki 同样支持 [[\\server\share|Windows shares]]。此特性仅支持 [[wp>Intranet|同网络]] 下的用户使用。
  
-  Windows Shares like [[\\server\share|this]] are recognized, too.+  DokuWiki 同样支持 [[\\server\share|Windows shares]]
  
-Notes:+注意:
  
-  * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone"). +  * 为了安全,此功能默认只会在同网络下的 IE 浏览器中被启用。 
-  * 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>+  * [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|此文档]] 告诉你如何在火狐浏览器启用该功能。不幸的是 Javascript 仍会产生警告。在 ''conf/lang/en/lang.php'' 中追加以下代码可完美解决此问题(详见 [[doku>localization#changing_some_localized_texts_and_strings_in_your_installation|此页]]):<code - conf/lang/en/lang.php>
 <?php <?php
 /** /**
行 93: 行 94:
 </code> </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}}]]
行 101: 行 103:
 [[http://php.net|{{wiki:dokuwiki-128.png}}]] [[http://php.net|{{wiki:dokuwiki-128.png}}]]
  
-Please note: The image formatting is the only formatting syntax accepted in link names.+请注意:此语法是唯一可被链接名称接受的变种语法。
  
-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).+[[#images_and_other_files|图片]] 与 [[#links|链接]] 的语法(包括调整图片大小、内外部图片、内部维基链接)已被 DokuWiki 完全支持。 
 +===== 脚注 =====
  
-===== 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.+===== 标题 =====
  
-===== Sectioning =====+DokuWiki 支持五种层级的标题。 倘若多于三个标题,DokuWiki 会自动生成一个表格,通过引用 ''<nowiki>~~NOTOC~~</nowiki>'' 来禁用此特性。
  
-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.+==== 三级标题 ==== 
 +=== 四级标题 === 
 +== 五级标题 ==
  
-==== Headline Level 3 ==== +  ==== 三级标题 ==== 
-=== Headline Level 4 === +  === 四级标题 === 
-== Headline Level 5 ==+  == 五级标题 ==
  
-  ==== Headline Level ==== +使用大于 个的连续横杠(-)可产生一条分割线:
-  === Headline Level 4 === +
-  == Headline Level 5 == +
- +
-By using four or more dashes, you can make a horizontal line:+
  
 ---- ----
- 
 ===== Media Files ===== ===== 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.+通过花括号来引用 [[doku>images|图片、视频和文件]],并且可以重新定义它们的尺寸。 
 +原始尺寸:{{wiki:dokuwiki-128.png}}
  
-Real size:                        {{wiki:dokuwiki-128.png}}+给定宽度:{{wiki:dokuwiki-128.png?50}}
  
-Resize to given width:            {{wiki:dokuwiki-128.png?50}}+给定宽度与高度 ((当给定的长宽比与原始的不匹配时,DokuWiki 会先裁剪图片,再调整图片大小)):{{wiki:dokuwiki-128.png?200x50}}
  
-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}}+外部图片:{{https://secure.php.net/images/php.gif?200x50}}
  
-Resized external image          {{https://secure.php.net/images/php.gif?200x50}}+  原始尺寸:{{wiki:dokuwiki-128.png}} 
 +  给定宽度:{{wiki:dokuwiki-128.png?50}} 
 +  给定宽度与高度:{{wiki:dokuwiki-128.png?200x50}} 
 +  外部图片:{{https://secure.php.net/images/php.gif?200x50}}
  
-  Real size:                        {{wiki:dokuwiki-128.png}} 
-  Resize to given width:            {{wiki:dokuwiki-128.png?50}} 
-  Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}} 
-  Resized external image:           {{https://secure.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: 行 156:
   {{ 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 |This is the caption}}
行 163: 行 162:
   {{ wiki:dokuwiki-128.png |This is the caption}}   {{ wiki:dokuwiki-128.png |This is the caption}}
  
-For linking an image to another page see [[#Image Links]] above.+如果想通过图片来链接一个网页请看[[#Image|这里]]
  
-==== Supported Media Formats ====+==== 支持的媒体 ====
  
-DokuWiki can embed the following media formats directly.+DokuWiki 可以直接引用以下类型的媒体:
  
-Image | ''gif'', ''jpg'', ''png'' +图片 | ''gif'', ''jpg'', ''png'' 
-Video | ''webm'', ''ogv'', ''mp4''+视频 | ''webm'', ''ogv'', ''mp4''
-Audio | ''ogg'', ''mp3'', ''wav''  |+音频 | ''ogg'', ''mp3'', ''wav''  |
 | Flash | ''swf''                    | | Flash | ''swf''                    |
  
-If you specify a filename that is not a supported media format, then it will be displayed as a link instead.+倘若引用不被支持的类型,DokuWiki 会直接显示原始链接。
  
-By adding ''?linkonly'' you provide a link to the media without displaying it inline+通过加入 ''?linkonly'' 后缀会直接显示原始链接。
  
   {{wiki:dokuwiki-128.png?linkonly}}   {{wiki:dokuwiki-128.png?linkonly}}
  
-{{wiki:dokuwiki-128.png?linkonly}} This is just a link to the image.+{{wiki:dokuwiki-128.png?linkonly}} 是图片的原始链接。
  
-==== 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}}   {{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.+那么倘若你上传了 ''video.webm'' 以及 ''video.ogv''DokuWiki 会根据不同的浏览器来选择到底用哪个。
  
-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.+假如你上传了与视频同名的图片 ''video.jpg'',DokuWiki 会在视频播放前显示它。
  
-===== 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.+Dokuwiki 支持有序列表与无序列表。 
 +在文本前加入两个空格和一个 ''*'' 以创建无序列表,用 ''-'' 的话便是有序列表。
  
-  * 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]].+你可以看看[[doku>faq:lists|这里]]来了解关于更多有关列表的内容。
  
-===== Text Conversions =====+===== 文本转化 =====
  
-DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML.+DokuWiki 可以转化一些特定的文本为别的一些内容。
  
-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.+一些文本会被转化成黄豆脸,一些文本会变成 HTML 中的特殊字符(可被用户自定义)。
  
 ==== Text to Image Conversions ==== ==== Text to Image Conversions ====
  
-DokuWiki converts commonly used [[wp>emoticon]]s to their graphical equivalents. Those [[doku>Smileys]] and other images can be configured and extended. Here is an overview of Smileys included in DokuWiki:+一般来说,DokuWiki 会用[[wp>表情]]来替换一些特定文本。用户可以扩展 DokuWiki 定义的[[doku>黄豆脸]]以及其他的图片。例如:
  
   * 8-) %%  8-)  %%   * 8-) %%  8-)  %%
行 254: 行 254:
   * DELETEME %% DELETEME %%   * DELETEME %% DELETEME %%
  
-==== Text to HTML Conversions ====+==== 特定文本转化为 HTML 字符 ====
  
-Typography: [[DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters.+例如:
  
 -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r)
-"He thought 'It's a man's world'..."+"他认为这是男人的世界……"
  
 <code> <code>
 -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r)
-"He thought 'It's a man's world'..."+"他认为这是男人的世界……"
 </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]].+通过配置 [[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]].+然而有三个例外:乘号 (640x480), '单引号' and "双引号"通过配置 [[doku>config:typography|config option]] 来关闭这个奇怪的特性。
  
-===== Quoting =====+===== 引用 =====
  
-Some times you want to mark some text to show it's a reply or comment. You can use the following syntax:+通过以下语法来引用对话以及注释:
  
 <code> <code>
-I think we should do it+我认为我可以干
  
-No we shouldn't+不,我们不能干
  
->> Well, I say we should+>> 好吧,我认为我们应该干
  
-Really?+讲真?
  
->> Yes!+>> 真!
  
->>> Then lets do it!+>>> 那我们干吧
 </code> </code>
  
-I think we should do it+我认为我可以干
  
-No we shouldn't+不,我们不能干
  
->> Well, I say we should+>> 好吧,我认为我们应该干
  
-Really?+讲真?
  
->> Yes!+>> 真!
  
->>> Then lets do it!+>>> 那我们干吧
  
-===== Tables =====+===== 表格 =====
  
-DokuWiki supports a simple syntax to create tables.+DokuWiki 支持使用简单的语法来创建表格。
  
-Heading 1      ^ Heading 2       Heading 3          ^+标题 1      ^ 标题 2       标题 3          ^
 | Row 1 Col 1    | Row 1 Col 2     | Row 1 Col 3        | | Row 1 Col 1    | Row 1 Col 2     | Row 1 Col 3        |
 | Row 2 Col 1    | some colspan (note the double pipe) || | Row 2 Col 1    | some colspan (note the double pipe) ||
 | Row 3 Col 1    | Row 3 Col 2     | Row 3 Col 3        | | 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          ^   ^ Heading 1      ^ Heading 2       ^ Heading 3          ^
行 316: 行 316:
   | Row 3 Col 1    | Row 3 Col 2     | Row 3 Col 3        |   | 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.+DokuWiki 同样支持垂直的标题:
  
 |              ^ Heading 1            ^ Heading 2          ^ |              ^ Heading 1            ^ Heading 2          ^
行 325: 行 325:
 ^ Heading 5    | Row 2 Col 2          | Row 2 Col 3        | ^ 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 1            ^ Heading 2          ^
行 332: 行 332:
   ^ Heading 5    | Row 2 Col 2          | Row 2 Col 3        |   ^ 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          ^ ^ Heading 1      ^ Heading 2                  ^ Heading 3          ^
行 339: 行 339:
 | Row 3 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          ^   ^ Heading 1      ^ Heading 2                  ^ Heading 3          ^
行 346: 行 346:
   | Row 3 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           ^^^ ^           Table with alignment           ^^^
行 353: 行 353:
 | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
  
-This is how it looks in the source:+看看源码长的样子:
  
   ^           Table with alignment           ^^^   ^           Table with alignment           ^^^
行 360: 行 360:
   | 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 和 **formatting**, 但没有对其进行任何操作。
 </nowiki> </nowiki>
-The same is true for %%//__this__ text// with a smiley ;-)%%.+对于带有笑脸的也是如此%%//__this__ text// with a smiley ;-)%%.
  
   <nowiki>   <nowiki>
行 376: 行 376:
   The same is true for %%//__this__ text// with a smiley ;-)%%.   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.   This is text is indented by two spaces.
行 390: 行 390:
 </file> </file>
  
-Those blocks were created by this source:+看看代码长的样子:
  
     This is text is indented by two spaces.     This is text is indented by two spaces.
行 402: 行 402:
   </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:DokuWiki]] 使用 [[http://qbnz.com/highlighter/|GeSHi]] 来高亮代码。在 ''<nowiki><code java></nowiki>'' 或 ''<nowiki><file java></nowiki>'' 标签中启用该功能。
  
 <code java> <code java>
行 418: 行 418:
 </code> </code>
  
-The following language strings are currently recognized: //4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 actionscript ada aimms algol68 apache applescript apt_sources arm asm asp asymptote autoconf autohotkey autoit avisynth awk bascomavr bash basic4gl batch bf biblatex bibtex blitzbasic bnf boo caddcl cadlisp ceylon cfdg cfm chaiscript chapel cil c_loadrunner clojure c_mac cmake cobol coffeescript c cpp cpp-qt cpp-winapi csharp css cuesheet c_winapi dart dcl dcpu16 dcs delphi diff div dos dot d ecmascript eiffel email epc e erlang euphoria ezt f1 falcon fo fortran freebasic freeswitch fsharp gambas gdb genero genie gettext glsl gml gnuplot go groovy gwbasic haskell haxe hicest hq9plus html html4strict html5 icon idl ini inno intercal io ispfpanel java5 java javascript jcl j jquery julia kixtart klonec klonecpp kotlin latex lb ldif lisp llvm locobasic logtalk lolcode lotusformulas lotusscript lscript lsl2 lua m68k magiksf make mapbasic mathematica matlab mercury metapost mirc mk-61 mmix modula2 modula3 mpasm mxml mysql nagios netrexx newlisp nginx nimrod nsis oberon2 objc objeck ocaml-brief ocaml octave oobas oorexx oracle11 oracle8 oxygene oz parasail parigp pascal pcre perl6 perl per pf phix php-brief php pic16 pike pixelbender pli plsql postgresql postscript povray powerbuilder powershell proftpd progress prolog properties providex purebasic pycon pys60 python qbasic qml q racket rails rbs rebol reg rexx robots roff rpmspec rsplus ruby rust sas sass scala scheme scilab scl sdlbasic smalltalk smarty spark sparql sql sshconfig standardml stonescript swift systemverilog tclegg tcl teraterm texgraph text thinbasic tsql twig typoscript unicon upc urbi uscript vala vbnet vb vbscript vedit verilog vhdl vim visualfoxpro visualprolog whitespace whois winbatch wolfram xbasic xml xojo xorg_conf xpp yaml z80 zxbasic//+以下的标识符会被识别为高亮: 4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 actionscript ada aimms algol68 apache applescript apt_sources arm asm asp asymptote autoconf autohotkey autoit avisynth awk bascomavr bash basic4gl batch bf biblatex bibtex blitzbasic bnf boo caddcl cadlisp ceylon cfd cfm chaiscript chapel cil c_loadrunner clojure c_mac cmake cobol coffeescript c cpp cpp-qt cpp-winapi csharp css cuesheet c_winapi dart dcl dcpu16 dcsDelphi diff div dos dot d ecmascript Eiffel email EPC e erlang Euphoria ezt F1 Falcon fo Fortran FreeBasic FreeSwitch Fsharp Gambas GDB Genero Genie Genie GetText GLSL GML gnuplot Go groovy GWbasic Haskell Haxe Hicest hq9plus HTML HTML4strict HTML5 icon idl ini inno intercal io ispfpanel Java5 Java JavaScript JCL j jquery julia kixtart klonec klonecpp kotlin latex lb ldif lisp llvm locobasic logtalk lolcode lotusformulas lotusscript lscript lsl2 lua m68k magiksf make mapbasic mathematicaMatLab Mercury Metapost Mirc MK-61 mmix modula2 modula3 mpasm mxml mysql nagios netrexx newlisp nginx nimrod nsis oberon2 objc objeck ocaml-brief ocaml octave oobas oorexx oracle11 oracle8 oxygene oz parasail parigp pascal pcre perl6 perl per pf phix php-brief php pic16 pike pixelbender pli plsql postgresql postscript povray Powerbuilder PowerShell proftPD Progress Prolog Properties ProvideX pureBasic Pycon PyS60 Python Qbasic QML Q Racket Rails RBS Rebol Reg Rexx Robots Roff rpmspec RSPLUS RubyRust sas sass scala scheme scilab scl sdlbasic smalltalk smarty spark sparql SQL sshconfig standardml stonescript swift systemverilog tclegg tcl teraterm texgraph text thinbasic tsql twig typoscript unicon upc urbi uscript vala vbnet vb vbscript vedit verilog vhdl vim visualfoxpro visualprolog whitespace whois winbatch wolfram xbasic xml xojo xorg_conf XPP YAML Z80 ZXBASIC
  
-There are additional [[doku>syntax_highlighting|advanced options]] available for syntax highlighting, such as highlighting lines or adding line numbers. 
  
-==== Downloadable Code Blocks ====+点击[[doku>syntax_highlighting|这里]]了解更多高级的内容。 
 +==== 可下载的代码块 ====
  
-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>%%'' 以及 ''%%<file>%%'' 语法,你可能想用户该如何下载引用的代码,很简单:
  
 <code> <code>
行 431: 行 431:
 </file> </file>
 </code> </code>
 +
  
 <file php myexample.php> <file php myexample.php>
行 436: 行 437:
 </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>%%''
  
-===== 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. All HTML 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.+===== 嵌入 HTML和PHP  =====
  
-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''.+通过使用 ''%%<html>%%'' or ''%%<php>%%'' 标签来嵌入原始 HTML 和 PHP 代码。(如果想要包含块级元素,请使用大写的标签)
  
-**Example:**+HTML 的例子: 
 + 
 +<code> 
 +<html> 
 +This is some <span style="color:red;font-size:150%;">inline HTML</span> 
 +</html> 
 +<HTML> 
 +<p style="border:2px dashed red;">And this is some block HTML</p> 
 +</HTML> 
 +</code> 
 + 
 +<html> 
 +This is some <span style="color:red;font-size:150%;">inline HTML</span> 
 +</html> 
 +<HTML> 
 +<p style="border:2px dashed red;">And this is some block HTML</p> 
 +</HTML> 
 + 
 +PHP 的例子: 
 + 
 +<code> 
 +<php> 
 +echo 'The PHP version: '; 
 +echo phpversion(); 
 +echo ' (generated inline HTML)'; 
 +</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> 
 + 
 +<php> 
 +echo 'The PHP version: '; 
 +echo phpversion(); 
 +echo ' (inline HTML)'; 
 +</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> 
 + 
 +**请注意**:嵌入的 HTML 与 PHP 默认只被显示源代码,并不被执行。 
 + 
 +===== RSS/ATOM源聚合 ===== 
 +[[DokuWiki]] 以集成来自外部XML源的数据。为了解析XML源,使用了[[http://simplepie.org/|SimplePie]] . SimplePie理解的所有格式也可以在DokuWiki中使用。您可以通过多个额外的空格分隔参数来影响渲染: 
 + 
 +^ 参数  ^ 描述 ^ 
 +| any number | 将用作要显示的最大项目数,默认为 8 | 
 +| reverse    | 首先显示feed中的最后一项 | 
 +| author     | 显示项目作者姓名 | 
 +| date       | 显示项目日期 | 
 +| description| 显示项目描述。如果HTML不可用,那么所有HTML标签都将被去除 | 
 +| nosort     | 不 Feed 中的项目进行排序 | 
 +| //n//[dhm] | 刷新周期,其中 d=天,h=小时,m=分钟。(例如 12 小时 = 12 小时). | 
 + 
 +刷新周期默认为 4 小时,任何低于 10 分钟的值都将被视为 10 分钟。 [[wiki:DokuWiki]] 常会尝试提供页面的缓存版本,显然当页面包含动态外部内容时,这是不合适的。该参数告诉 [[wiki:DokuWiki]] 如果渲染页面的时间超过了刷新周期,则会重新渲染页面。 
 +默认情况下,Feed 将按日期排序,最新项目排在最前面。 你可以使用''reverse''参数按照最旧排序或者使用''nosort''按原样显示。 
 + 
 +**例子:**
  
   {{rss>http://slashdot.org/index.rss 5 author date 1h }}   {{rss>http://slashdot.org/index.rss 5 author date 1h }}
行 461: 行 513:
  
  
-===== Control Macros ===== +===== 控制宏 =====
- +
-Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble:+
  
-^ Macro           ^ Description | +部分宏可以影响 DokuWiki 在页面中的渲染。例如:
-| %%~~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 =====+^ 宏           ^ 描述 | 
 +| %%~~NOTOC~~%%   | 禁用表格 | 
 +| %%~~NOCACHE~~%% | 默认 DokuWiki 会缓存所有的页面输出。但有时候你可能并不想要这个特性(例如使用了%%<php>%%语法),引用此宏可以强制让 DokuWiki 在每次被调用时重新渲染页面 |
  
-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:+===== 语法插件 =====
  
 +可以通过[[doku>plugins|插件]]来扩展 DokuWiki 的语法。你可以通过以下的链接来了解对应插件的用法:
 ~~INFO:syntaxplugins~~ ~~INFO:syntaxplugins~~
  
wiki/syntax.txt · 最后更改: 2023/08/04 14:46 由 弘毅