wiki:syntax

差别

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

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
wiki:syntax [2024/05/02 21:10]
114.119.159.254 已恢复为旧版 (2024/04/14 15:24)
wiki:syntax [2024/05/02 21:22] (当前版本)
114.119.159.254 已恢复为旧版 (2024/03/30 00:03)
行 1: 行 1:
-====== 格式化语法 ====== +====== Formatting Syntax ======
-<WRAP center info 60%> +
-此条目引用自DokuWiki官方:[[doku>zh:syntax|格式化语法]]。 +
-</WRAP>+
  
-[[doku>DokuWiki]]支持一些简单的标记语言,以尽可能使文档的可读性更高。本页包含了您在编辑页面时可能用到所有语法的说明。如果需要查看本页源码, 只需要点击页面顶部或者底部的//编辑本页//按钮。如果您想做一些尝试,那么可以使用[[playground:playground|测试页]]来尽情挥洒。通过[[doku>zh:toolbar|快捷按钮]],您可以更方便地使用这些标记。+[[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.
  
-===== 基本文字格式 ===== +===== Basic Text Formatting =====
-DokuWiki支持**粗体**,//斜体//,__下划线__以及''等宽体''等格式。当然,您可以**__//''混合使用''//__**这些格式。+
  
-  DokuWiki支持**粗体**//斜体//,__下划线__以及''等宽体''等格式。 +DokuWiki supports **bold**//italic//, __underlined__ and ''monospaced'' texts. Of course you can **__//''combine''//__** all these.
-  当然,您可以**__//''混合使用''//__**这些格式。+
  
-您也可以使用<sub>下标</sub>和<sup>上标</sup>。+  DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' texts. 
 +  Of course you can **__//''combine''//__** all these.
  
-  您也可以使用<sub>下标</sub><sup>上标</sup>+You can use <sub>subscript</sub> and <sup>superscript</sup>, too.
  
-同时也可以使用<del>删除线</del>标记某些信息。+  You can use <sub>subscript</suband <sup>superscript</sup>, too.
  
-  同时也可以使用<del>删除线</del>标记某些信息。+You can mark something as <del>deleted</del> as well.
  
-**段落**是由空行所建立的。如果您想**强制换行**而不建立段落,您可以使用两个连续的反斜杠接空格或回车作为标记。请看样例:+  You can mark something as <del>deleted</del> as well.
  
-这是一些有着换行标记的文字。\\ 请注意 +**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.
  
-DokuWiki支持以多种形式创建链接。+===== Links =====
  
-==== 外部链接 ====+DokuWiki supports multiple ways of creating links.
  
-外部链接会被自动地识别:http://www.google.com,或者简单地写作www.google.com——您也可以设置链接文本:[[http://www.google.com|此链接指向google]]。类似这样的电子邮件地址:<andi@splitbrain.org>也可以被识别。+==== External ====
  
-  DokuWiki支持以多种形式创建链接。外部链接会被自动地识别: +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 
 +  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 ====
  
-  内部链接可以用方括号创建。您可以只给出 +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的页面名]]会被自动地转换为小写字母,并且不允许使用特殊字符。+  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.
  
-如果您需要更多有关“命名空间(namespaces)”的详细信息,请参见[[doku>namespaces]]+  You can use [[some:namespaces]] by using a colon in the pagename.
  
-链接到一个特定章节也是可能的。只需要在#号后面加上章节的名称。这是一个指向[[syntax#内部链接|本节]]的链接。+For details about namespaces see [[doku>namespaces]].
  
-  这是一个指向[[syntax#内部链接|本节]]的链接。+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]].
  
-注意: +  This links to [[syntax#internal|this Section]].
-  * 指向[[syntax|已存在页面]]的和[[nonexisting|不存在页面]]的链接,其外观是不同的。 +
-  * 默认情况下,DokuWiki不使用[[wp>CamelCase]]来自动建立链接。但这一设定可以在[[doku>config|配置文件]]中激活。提示:如果DokuWiki显示为链接,则说明已激活。 +
-  * 当一节的标题改变时,它的书签也会改变。因此,请不要过于依赖章节链接。+
  
-==== Wiki间链接 ====+Notes:
  
-DokuWiki支持[[doku>Interwiki]](Wiki间链接)。他们是到其他Wiki的快速链接。例如,这是一个指向Wikipedia上Wiki条目的链接:[[wp>Wiki]]+  * 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.
  
-  DokuWiki支持[[doku>Interwiki]](Wiki间链接)。他们是到其他Wiki的快速链接。 +==== Interwiki ====
-  例如,这是一个指向Wikipedia上Wiki条目的链接:[[wp>Wiki]] +
-==== Windows共享文件夹 ====+
  
-Windows共享文件夹,例如[[\\server\share|这个]]也可以被识别。请注意,这只在企业[[wp>Intranet|内部网]]等局域网环境中才有意义。+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]].
  
-  Windows共享文件夹,例如[[\\server\share|这个]]也可以被识别。+  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]].
  
-注:+==== Windows Shares ====
  
-  * 出于安全原因,只有在微软IE浏览器上才能够直接访问Windows共享文件夹(并且仅在“本地区域”)。 +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]].
-  * 对于Mozilla和Firefox可以通过[[http://kb.mozillazine.org/Firefox_:_Issues_:_Links_to_Local_Pages_Don%27t_Work|Mozilla知识库]]中提到的不同解决方法启用。但是,打开一个windows共享文件夹时仍然会有一个JavaScript告警。要去除这个警告(为所有用户),把下面一行放入"conf/userscript.js"中;+
  
-  LANG.nosmblinks = ''; +  Windows Shares like [[\\server\share|this]] are recognized, too.
-==== 图像链接 ====+
  
-您也可以通过结合链接和[[#图像和其它文件|图像]](见下文)的语法,用图像来链接到一个内部或者外部的页面。如下所示:+Notes:
  
-  [[http://www.php.net|{{wiki:dokuwiki-128.png}}]]+  * 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://www.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.
  
-所有的图像和链接语法都是支持的(包括图像大小调整、内部和外部的图像与链接以及wiki内链接)。+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.
  
-===== 分节 =====+===== Sectioning =====
  
-您可以使用多达5层的标题来组织您的内容。如果您使用了三个以上的标题,将自动生成目录——这可以通过在页面加入''<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.
  
-==== H3标题 ==== +==== Headline Level 3 ==== 
-=== H4标题 === +=== Headline Level 4 === 
-== H5标题 ==+== Headline Level 5 ==
  
-  ==== H3标题 ==== +  ==== Headline Level 3 ==== 
-  === H4标题 === +  === Headline Level 4 === 
-  == H5标题 ==+  == Headline Level 5 ==
  
-您可以通过4个以上连续的“-”号来创建一条水平分割线:+By using four or more dashes, you can make a horizontal line:
  
 ---- ----
  
 +===== 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|图像]]。您还可以指定它们的大小。+Real size:                        {{wiki:dokuwiki-128.png}}
  
-原始大小:                        {{wiki:dokuwiki-128.png}}+Resize to given width:            {{wiki:dokuwiki-128.png?50}}
  
-指定宽度:                        {{wiki:dokuwiki-128.png?50}}+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?200x50}}+Resized external image:           {{https://secure.php.net/images/php.gif?200x50}}
  
-重新指定宽度和高度的外部图像:    {{http://de3.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}}
  
-  原始大小:                        {{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}}
行 151: 行 157:
   {{ 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 |这是标题}}+{{ wiki:dokuwiki-128.png |This is the caption}}
  
-  {{ wiki:dokuwiki-128.png |这是标题}}+  {{ wiki:dokuwiki-128.png |This is the caption}}
  
-如果您指定的文件名(无论是外部的还是内部的)不是一个图像(''gif,jpeg,png''),那么它将被显示为一个链接。+For linking an image to another page see [[#Image Links]] above.
  
-对于将图像链接到其他页面,参见上面的[[#图像链接]]。 +==== Supported Media Formats ====
-===== 列表 =====+
  
-DokuWiki支持带编号或不带编号的列表。要创建列表,在文字前加入两个空格,然后使用''*''标记不带编号的列表,用''-''标记带编号的列表。+DokuWiki can embed the following media formats directly.
  
-  * 这是一个列表 +| 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]].
  
-DokuWiki可以将预定义的字符或者字符串转换成图像、其他文本或HTML。+===== Text Conversions =====
  
-文本转换为图像主要用于表情符号。文本到HTML的转换用于排版的字符替换,但也可以配置为使用其他HTML。 +DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML.
-==== 文本到图像的转换 ====+
  
-DokuWiki会将一些常用的 [[wp>emoticon|表情符号]]转换为相应图像。这些[[doku>Smileys|表情符号]]和其他图像可以被配置和扩展。这是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. 
 + 
 +==== 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:
  
   * 8-) %%  8-)  %%   * 8-) %%  8-)  %%
行 216: 行 253:
   * 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.
- +
-印刷:[[DokuWiki]]可以将特定字符转换为印刷时所用的样式。这是可识别的字符示例。+
  
 -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r)
行 229: 行 265:
 </code> </code>
  
-同样的做法可以产生任何类型的HTML,只需要添加到[[doku>entities|模式文件]]+The same can be done to produce any kind of HTML, it just needs to be added to the [[doku>entities|pattern file]].
  
-这里有三个例外,它们并非来自模式文件:乘号(640x480)'单引号'"双引号"。它们可以通过[[doku>config:typography|配置选项]]关闭。+There are three exceptions which do not come from that pattern file: multiplication entity (640x480)'singleand "double quotes". They can be turned off through a [[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支持用简单的语法创建表格。 +DokuWiki supports a simple syntax to create tables.
  
-标题   标题            标题   +Heading      Heading       Heading          
-(1,1)  (1,2)           (1,3)  +Row Col    Row Col     Row Col        
-(2,1)  | 一些跨列合并(注意两条竖线)          || +Row Col    | some colspan (note the double pipe) || 
-(3,1)  (3,2)           (3,3)  |+Row Col    Row Col     Row Col        |
  
-表格的每一行都以分隔符 ''|'' (普通行)或者 ''^'' (标题行)作为开头和结束。+Table rows have to start and end with a ''|'' for normal rows or a ''^'' for headers.
  
-  ^ 标题       标题        标题      +  ^ Heading      Heading       Heading          
-  | (1,1)        (1,2)         (1,3)       +  | Row Col    Row Col     Row Col        
-  | (2,1)        | 一些跨列合并(注意两条竖线)   || +  | Row Col    | some colspan (note the double pipe) || 
-  | (3,1)        (3,2)         (3,3)       |+  | Row Col    Row Col     Row Col        |
  
-要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符!+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.
  
-         标题         标题2          ^ +             Heading            Heading 2          ^ 
-标题3    | (1,2         (1,3)          +Heading 3    | Row Col 2          | Row Col        
-标题4    | 不再合并单元格                +Heading 4    | no colspan this time                    
-标题5    | (2,2         (2,3)          |+Heading 5    | Row Col 2          | Row Col        |
  
-可以看到,单元格前面的分隔符决定了单元格的格式。+As you can see, it's the cell separator before a cell which decides about the formatting:
  
-  |          标题         标题2          ^ +  |              Heading            Heading 2          ^ 
-  ^ 标题3    | (1,2         (1,3)          +  ^ Heading 3    | Row Col 2          | Row Col        
-  ^ 标题4    | 不再合并单元格                +  ^ Heading 4    | no colspan this time                    
-  ^ 标题5    | (2,2         (2,3)          |+  ^ Heading 5    | Row Col 2          | Row Col        |
  
-跨行合并单元格(垂直合并单元格)也是可以实现的,通过在下面的相邻单元格输入'':::''可以把两个相邻行的单元格合并。+You can have rowspans (vertically connected cellsby adding ''%%:::%%'' into the cells below the one to which they should connect.
  
-标题 标题               标题    +Heading      Heading                  Heading          
-|(1,1)对该单元垂直合并        |(1,3)+Row Col    this cell spans vertically Row Col        
-|(2,1)| :::                  |(2,3)+Row Col    | :::                        Row Col        
-|(3,1)| :::                  |(2,3)|+Row Col    | :::                        Row Col        |
  
-除跨行合并语法外,单元格中不能包含其他任何内容。+Apart from the rowspan syntax those cells should not contain anything else.
  
-  ^ 标题1 ^ 标题              标题  +  ^ Heading      Heading                  Heading          
-  |(1,1)对该单元垂直合并       |(1,3)+  | Row Col    this cell spans vertically Row Col        
-  |(2,1)| :::                  |(2,3)+  | Row Col    | :::                        Row Col        
-  |(3,1)| :::                  |(2,3)|+  | Row Col    | :::                        Row Col        |
  
 +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 |
  
-^  有对齐的表格                                     ||| +This is how it looks in the source:
-|           右对齐 |  居中           | 左对齐           | +
-| 左对齐                     右对齐 |  居中           | +
-| xxxxxxxxxxxx  | xxxxxxxxxxxx  | xxxxxxxxxxxx  |+
  
-下面是源文件中的样子: +  ^           Table with alignment           ^^^ 
- +  |         right   center    |left          
-  ^           有对齐的表格                   ^^^ +  |left                  right   center    |
-  |        右对齐    居中     |左对齐        +
-  |左对齐               右对齐    居中     |+
   | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |   | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
  
-注意:不支持垂直对齐。+Note: Vertical alignment is not supported.
  
-===== 无格式化 =====+===== No Formatting =====
  
-如果您需要文本完全显示为它键入的样子(没有任何格式化),用''%%<nowiki>%%''标签包围这个区域,或更简单地用两个百分号''<nowiki>%%</nowiki>''+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>
-这是一些包含这样的地址:http://www.splitbrain.org,以及**格式**的文字,但它没有被解析。+This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it.
 </nowiki> </nowiki>
-对于带有表情符号的%%;-)的//__这段__文本//%%也一样。+The same is true for %%//__this__ text// with a smiley ;-)%%.
  
   <nowiki>   <nowiki>
-  这是一些包含这样的地址:http://www.splitbrain.org,以及**格式**的文字,但它没有被解析。+  This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it.
   </nowiki>   </nowiki>
-  对于带有表情符号的%%;-)的//__这段__文本//%%也一样。+  The same is true for %%//__this__ text// with a smiley ;-)%%.
  
-===== 代码块 ===== +===== Code Blocks =====
-您可以将代码块包含到文档中,可以通过缩进两个空格(像前面例子中所用的)或者使用标签''%%<code>%%''或''%%<file>%%''+
  
-  这是缩进了两个空格的文本。+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>
  
 <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>
-   
-==== 语法高亮 ==== 
  
-[[wiki:DokuWiki]] 可以高亮源代码,使它更容易阅读。它使用[[http://qbnz.com/highlighter/|GeSHi]]通用语法高亮器——因此支持任何GeSHi所支持的语言。语法和前面章节中代码与文件块的一样,但这时所用语言的名称被放入标签中。例如''<nowiki><code java></nowiki>''或者''<nowiki><file java></nowiki>''+==== 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>''.
  
 <code java> <code java>
行 381: 行 417:
 </code> </code>
  
-当前可以识别下列语言字符串://4csabapactionscript-french, actionscript, actionscript3, adaapacheapplescriptasmaspautohotkeyautoitavisynthawkbashbasic4glbfbibtexblitzbasicbnfboo, c, c_mac, caddclcadlispcfdgcfmcilclojurecmakecobolcppcpp-qtcsharpcsscuesheet, d, dcsdelphidiffdivdosdoteiffelemailerlangfofortranfreebasicfsharpgambas, genero, gdbglslgmlgnuplotgroovy, gettext, haskellhq9plushtmlidliniinnointercaliojava5javajavascriptjquerykixtartklonecklonecpplatexlisplocobasiclogtalklolcodelotusformulaslotusscriptlscriptlsl2luam68kmakemapbasicmatlabmirc, modula3, mmixmpasmmxmlmysqlnewlispnsisoberon2objcocaml-briefocamloobas, oracle8, oracle11pascal, perl, perl6perphp-briefphp, pike, pic16pixelbenderplsqlpovraypowerbuilderpowershellprogressprologpropertiesprovidexpurebasicpythonqbasicrailsrebolregrobotsrsplusrubysasscalaschemescilabsdlbasicsmalltalksmartysqlsystemverilogtclteratermtextthinbasictsqltyposcriptvbnetvbverilogvhdlvimvisualfoxprovisualprologwhitespace, winbatch, whoisxmlxorg_confxppz80//+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//
  
-==== 可下载的代码块 ====+There are additional [[doku>syntax_highlighting|advanced options]] available for syntax highlighting, such as highlighting lines or adding line numbers.
  
-当您使用上面的''%%<code>%%''或''%%<file>%%''语法,您或许希望让显示的代码也可以被下载。您可以通过在语言代码后面指定一个文件名来实现:+==== 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>
行 398: 行 435:
 </file> </file>
  
-如果您不想要任何高亮,但想要一个可下载的文件,指定破折号(''-'')作为语言代码:''%%<code - myfile.foo>%%''+If you don't want any highlighting but want a downloadable file, specify a dash (''-''as the language code: ''%%<code - myfile.foo>%%''.
  
-===== 嵌入HTML和PHP ===== 
  
-您可以嵌入原始HTML代码到文件中,通过使用''%%<html>%%''标签。(如果您需要包围区块级别的元素,使用大写字母的标签。)+===== 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:
  
 <code> <code>
 <html> <html>
-这是一些<span style="color:red;font-size:150%;">行内HTML</span>+This is some <span style="color:red;font-size:150%;">inline HTML</span>
 </html> </html>
 <HTML> <HTML>
-<p style="border:2px dashed red;">这是一些区块HTML</p>+<p style="border:2px dashed red;">And this is some block HTML</p>
 </HTML> </HTML>
 </code> </code>
  
 <html> <html>
-这是一些<span style="color:red;font-size:150%;">行内HTML</span>+This is some <span style="color:red;font-size:150%;">inline HTML</span>
 </html> </html>
 <HTML> <HTML>
-<p style="border:2px dashed red;">这是一些区块HTML</p>+<p style="border:2px dashed red;">And this is some block HTML</p>
 </HTML> </HTML>
  
-===== RSS/ATOM Feed聚合=====+PHP example:
  
-[[DokuWiki]]能够从外部的XML feed中聚合数据。为了解析这些XML feed,使用了[[http://simplepie.org/|SimplePie]]。所有的能够被SimplePie理解的格式都可以在DokuWiki中使用。您可以通过多个参数来改变渲染,参数之间用空格隔开:+<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> 
-| any number   | 最多显示多少内容项;默认是8                                       | +echo 'The PHP version: '; 
-| reverse      | 将最新条目显示在前面                                           | +echo phpversion(); 
-| author       | 显示条目的作                                               | +echo ' (inline HTML)'; 
-| date         | 显示条目日期                                               | +</php> 
-| description  | 显示条目的描述;如果[[doku>config:htmlok|HTML]]被禁用,所有的标签将被过滤掉  | +<PHP> 
-//n//[dhm]   | 刷新周期,其中,d=天数,h=小时数,m=分。例如,12h=12个小时。                 |+echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; 
 +echo '<td>'.phpversion().'</td>'; 
 +echo '</tr></table>'; 
 +</PHP>
  
-刷新周期默认是4小时。小于或者等于10分钟均视为10分钟。[[wiki:DokuWiki]]通常会提供页面的缓存版,显然,这种做法不适用于包含动态外部内容的页面。上面的参数告诉[[wiki:DokuWiki]],如果离上次重新解释的时间已经超出了//刷新周期//,则重新解释页面。+**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 }}
行 442: 行 510:
 {{rss>http://slashdot.org/index.rss 5 author date 1h }} {{rss>http://slashdot.org/index.rss 5 author date 1h }}
  
-===== 控制宏 ===== 
  
-一些语法会影响DokuWiki对页面的解释,而自身不输出任何内容。可用的控制宏如下:+===== 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~~
-| %%~~NOTOC~~%%   | 如果页面出现该控制宏,将不会创建目录| +
-| %%~~NOCACHE~~%% | DokuWiki默认会缓存所有的输出。有时并不希望这样(例如,当使用了上面的%%<php>%%语法),增加这个控制宏将强制DokuWiki在每次访问时重新解析页面| +
-| %%~~DISCUSSION~~%%   | 显示讨论| +
-| %%~~DISCUSSION:off~~%%   | 隐藏讨论| +
-| %%~~DISCUSSION:close~~%%   | 关闭讨论| +
-===== 语法插件 =====+
  
  • wiki/syntax.txt
  • 最后更改: 2024/05/02 21:22
  • 目前已被下列人员锁定: