差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录前一修订版后一修订版 | 前一修订版 | ||
wiki:syntax [2013/11/29 17:05] – joyqi | wiki:syntax [2024/06/12 10:10] (当前版本) – 外部编辑 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ~~NOTOC~~ | + | ====== DokuWiki格式语法说明 ====== |
- | ====== Formatting Syntax ====== | + | [[wiki: |
+ | 如果您是初尝Wiki,那么可以使用 [[playground: | ||
+ | 通过[[doku> | ||
- | [[wiki: | + | ===== 基本文本格式 ===== |
- | ===== Basic text formatting ===== | + | DokuWiki支持 **粗体**, // |
- | DokuWiki | + | |
+ | 当然,您也可以 | ||
- | DokuWiki supports **bold**, | + | 可以使用 < |
- | Of course you can **__//'' | + | |
- | You can use <sub>subscript</ | + | 可以使用 |
- | You can use <sub>subscript</sub> and < | + | 您也可以使用 |
- | You can mark something as <del>deleted</ | + | 您也可以使用 |
- | You can mark something as < | + | **段落** 是由空行所建立的。如果您想 **强制建立新行** 而不建立段落,您可以使用两个连续的反斜杠+空格或是回车作为标记。请看样例: |
- | **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 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:// |
- | External links are recognized automagically: | + | DokuWiki支持多种形式的链接。外部链接会被自动地识别: |
+ | | ||
+ | | ||
+ | 类似这样的电子邮件地址: | ||
- | DokuWiki supports multiple ways of creating links. External links are recognized | + | ==== 内部链接 ==== |
- | automagically: | + | |
- | Linknames, too: [[http:// | + | |
- | addresses like this one: < | + | |
- | ==== Internal ==== | + | 内部链接可以用方括号创建。您可以只给出链接的地址:[[doku> |
- | Internal links are created by using square brackets. You can either just give a [[doku> | + | 内部链接可以用方括号创建。您可以只给出链接的地址:[[pagename]], |
+ | 也可以附加上链接的名字:[[pagename|我的链接]]。 | ||
+ | | ||
- | Internal links are created by using square brackets. You can either just give | + | 您可以通过在页面名中使用冒号的方式来使用 |
- | a [[pagename]] or use an additional [[pagename|Title Text]]. Wiki pagenames | + | |
- | are converted to lowercase automatically, | + | |
- | You can use [[wiki: | + | 您可以通过在页面名中使用冒号的方式来使用 |
- | You can use [[wiki: | + | 如果您需要关于**命名空间(namespaces)**的更详细的信息,请参见 |
- | For details about namespaces see [[doku> | + | 您也可以链接到一个网页内部的某一节,只需要将该节书签的名称以一个# |
- | 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# | + | 这是一个连向 |
- | This links to [[syntax# | + | 注: |
- | Notes: | + | * 到 [[wiki:syntax|已存在页面]] 的链接和到 [[wiki: |
+ | * 默认情况下,DokuWiki不使用 [[wp> | ||
+ | * 当一节的标题改变时,该节的书签也会改变,因此,请不要太依靠网页内的链接。 | ||
- | * Links to [[wiki: | + | ==== Wiki间链接 ==== |
- | * DokuWiki does not use [[wp> | + | |
- | * When a section' | + | |
- | ==== Interwiki ==== | + | DokuWiki支持 [[doku> |
- | DokuWiki | + | |
+ | 例如,这是一个到Wikipedia上关于Wiki的一个页面的的链接: | ||
- | DokuWiki supports [[doku> | + | ==== Windows共享文件夹 ==== |
- | For example this is a link to Wikipedia' | + | |
+ | Windows共享文件夹,例如 [[\\server\share|this]] 也可以被识别。请注意,这只在内部 [[wp> | ||
- | ==== Windows | + | |
- | Windows shares like [[\\server\share|this]] are recognized, too. Please note that these only make sense in a homogenous user group like a corporate [[wp> | + | 注: |
- | Windows | + | |
- | Notes: | ||
- | * 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 the config option [[http:// | + | |
- | * See [[dokubug> | + | |
- | ==== Image Links ==== | + | 您也可以用图像来作为一个内部或者外部的链接,只需同时使用链接和图像的语法,如下所示: |
- | + | ||
- | You can also use an image to link to another internal or external page by combining the syntax for links and [[# | + | |
[[http:// | [[http:// | ||
行 97: | 行 95: | ||
[[http:// | [[http:// | ||
- | Please note: The image formatting is the only formatting syntax accepted in link names. | + | 请注意:在链接名中使用语法,只有显示图像的语法会被识别,请不要使用其它语法。 |
- | + | ||
- | The whole [[# | + | |
- | ===== Footnotes | + | ===== 脚注 |
- | You can add footnotes | + | 您可以使用两个连续小括号来添加脚注((看这里,这是一个脚注))。 |
- | | + | |
- | ===== 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 | + | 您可以使用最多达5层的标题来使您的页面更富结构性。如果您使用了三个以上的标题,那么DokuWiki会自动在页面上生成一个名为“本页目录”的标题列表。当然,您也可以关闭这项特性,只需在编辑时在页面里加入 |
- | ==== 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个以上“-”号来创建一条水平分割线: |
---- | ---- | ||
- | ===== Images and other files ===== | ||
- | You can include external and internal [[doku> | + | ===== 图像和其它文件 ===== |
- | Real size: {{wiki: | + | 您可以使用双大括号来在页面中加入 [[doku> |
- | Resize to given width: | + | 原始大小: |
- | Resize to given width and height: | + | 指定宽度: |
- | Resized external image: | + | 指定宽度和高度: |
- | Real size: {{wiki: | + | 重新指定宽度和高度的外部图像: |
- | Resize to given width: | + | |
- | Resize to given width and height: {{wiki: | + | |
- | Resized external image: | + | |
+ | 原始大小: | ||
+ | 指定宽度: | ||
+ | 指定宽度和高度: | ||
+ | 重新指定宽度和高度的外部图像: | ||
- | By using left or right whitespaces you can choose the alignment. | + | 使用左方或者右方的空格,您可以选择对齐方式: |
{{ wiki: | {{ wiki: | ||
行 153: | 行 149: | ||
{{ wiki: | {{ wiki: | ||
- | Of course, you can add a title (displayed as a tooltip by most browsers), too. | + | 当然,您也可以指定一个图像的名字,将鼠标移到图像上可以看到效果。 |
- | {{ wiki: | + | {{ wiki: |
- | {{ wiki: | + | {{ wiki: |
- | If you specify a filename (external or internal) that is not an image ('' | + | 如果您指定的文件名(无论是外部的还是内部的)不是一个图像('' |
- | For linking an image to another page see [[#Image Links]] above. | + | ===== 列表 ===== |
- | ===== Lists ===== | + | Dokuwiki支持带编号或不带编号的列表。要使用列表,在文字前加入两个空格,然后使用'' |
- | Dokuwiki supports ordered and unordered lists. To create a list item, indent your text by two spaces and use a '' | + | |
+ | * 第二项 | ||
+ | * 下一层 | ||
+ | * 第三项 | ||
- | | + | - 带编号的列表 |
- | * The second item | + | - 第二项 |
- | * You may have different levels | + | - 用缩进表示更深的层 |
- | * Another item | + | - 完了 |
- | + | ||
- | | + | |
- | - Another item | + | |
- | - Just use indention for deeper levels | + | |
- | - That's it | + | |
< | < | ||
- | * This is a list | + | * 列表 |
- | * The second item | + | * 第二项 |
- | | + | * 下一层 |
- | * Another item | + | * 第三项 |
- | - The same list but ordered | + | - 带编号的列表 |
- | - Another item | + | - 第二项 |
- | - Just use indention for deeper levels | + | - 用缩进表示更深的层 |
- | - That's it | + | - 完了 |
</ | </ | ||
- | ===== Smileys | + | ===== 表情符号 |
- | DokuWiki | + | DokuWiki会将一些常用的 |
* 8-) %% 8-) %% | * 8-) %% 8-) %% | ||
行 214: | 行 208: | ||
* DELETEME %% DELETEME %% | * DELETEME %% DELETEME %% | ||
- | ===== Typography | + | ===== 印刷样式 |
- | [[DokuWiki]] | + | [[DokuWiki]]可以将特定字符转换为印刷时所用的样式。下面是可以识别的这类字符的列表: |
-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
行 226: | 行 220: | ||
</ | </ | ||
- | Please note: These conversions can be turned off through a [[doku> | + | 请注意:在配置文件中可以禁用这类自动转换。 |
- | ===== Quoting | + | ===== 表格 |
- | Some times you want to mark some text to show it's a reply or comment. You can use the following syntax: | + | DokuWiki可以用简单的语法创建表格。 |
- | I think we should do it | + | ^ 标题1 ^ 标题2 |
- | + | | (1,1) | |
- | > No we shouldn' | + | | (2,1) | 展宽的单元格 |
- | + | | (3,1) | |
- | >> Well, I say we should | + | |
- | + | ||
- | > Really? | + | |
- | + | ||
- | >> Yes! | + | |
- | + | ||
- | >>> | + | |
- | + | ||
- | I think we should do it | + | |
- | + | ||
- | > No we shouldn' | + | |
- | + | ||
- | >> Well, I say we should | + | |
- | + | ||
- | > Really? | + | |
- | + | ||
- | >> Yes! | + | |
- | + | ||
- | >>> | + | |
- | + | ||
- | ===== Tables ===== | + | |
- | + | ||
- | DokuWiki supports a simple syntax to create tables. | + | |
- | + | ||
- | ^ Heading | + | |
- | | Row 1 Col 1 | Row 1 Col 2 | + | |
- | | Row 2 Col 1 | some colspan (note the double pipe) || | + | |
- | | Row 3 Col 1 | Row 2 Col 2 | Row 2 Col 3 | | + | |
- | Table rows have to start and end with a '' | + | 表格的每一行都以分隔符 |
- | ^ 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 2 Col 2 | Row 2 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! | + | ^ 标题1 |
+ | | (1,1) | (1,2) | (1,3) | | ||
+ | | (2,1) | 展宽的单元格 | ||
+ | | (3,1) | (3,2) | (3,3) | | ||
+ | 要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符! | ||
- | Vertical tableheaders are possible, too. | + | 竖直的标题列也是可以实现的: |
- | | ^ Heading | + | | ^ 标题1 ^ 标题2 ^ |
- | ^ Heading | + | ^ 标题3 | (1,2) |
- | ^ Heading | + | ^ 标题4 | 不再合并单元格 |
- | ^ Heading | + | ^ 标题5 | (2,2) |
- | As you can see, it's the cell separator before a cell which decides about the formatting: | + | 可以看到,单元格前面的分隔符决定了单元格的格式。 |
- | | ^ Heading | + | | ^ 标题1 ^ 标题2 ^ |
- | ^ Heading | + | ^ 标题3 | (1,2) |
- | ^ Heading | + | ^ 标题4 | 不再合并单元格 |
- | ^ Heading | + | ^ 标题5 | (2,2) |
- | Note: Vertical spans (rowspan) are not possible. | + | 注:垂直合并单元格尚未实现。 |
- | 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| | + | | |
- | |left | + | |左对齐 |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | This is how it looks in the source: | + | 下面是源文件中的格式: |
- | ^ Table with alignment | + | ^ 有对齐的表格 |
- | | right| | + | | |
- | |left | + | |左对齐 |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | ===== Non-parsed Blocks | + | ===== 无格式区块 |
- | You can include non-parsed blocks into your documents by either indenting them by at least two spaces | + | 在一段文字的最前面加上 2 个空白,来直接作为「文本框」不对它做加工处理(就像前面那些说明一样)。或者也可以用 |
< | < | ||
- | This is preformatted | + | 这段是用 <code> 产生的,所有空格及所有原始格式都会照样显示,还其本色。 |
+ | | ||
+ | |||
+ | 或者 | ||
+ | 方与圆 | ||
+ | 圆契合于方 | ||
+ | 方契合于圆 | ||
+ | 两心同一点 | ||
</ | </ | ||
< | < | ||
- | This is pretty much the same, but you could use it to show that you quoted a file. | + | 这段跟上段很像,但是改用 < |
+ | |||
+ | remember, information | ||
+ | knowledge is not wisdom | ||
+ | wisdom is not truth | ||
+ | truth is not beauty | ||
+ | beauty is not love | ||
+ | love is not music | ||
+ | music is the best | ||
+ | |||
+ | -- frank zappa | ||
</ | </ | ||
- | To let the parser ignore an area completely (ie. do no formatting on it), enclose the area either with '' | + | 若要略过某段内含 WIKI 语法,不对该段文字作任何处理, |
+ | 可以使用 | ||
+ | |||
+ | '' | ||
+ | 或是''< | ||
< | < | ||
- | This is some text which contains addresses like this: http:// | + | 这一段包含一些原本会在 WIKI 内有特殊处理,像是 |
</ | </ | ||
- | See the source of this page to see how to use these blocks. | + | 您可以看本页的原始写法来察看这一段是怎么写的。 |
- | ===== Syntax Highlighting | + | ===== 语法的高亮度显示 |
- | [[DokuWiki]] | + | [[DokuWiki]] |
+ | 它采用的是 | ||
+ | |||
+ | 用法就类似前例的 %%<code>%% ,但要在标签(tag)内指定该原始码所使用的语言。比如 | ||
+ | 举例: | ||
+ | <code java> | ||
- | <code java> | ||
/** | /** | ||
* The HelloWorldApp class implements an application that | * The HelloWorldApp class implements an application that | ||
* simply displays "Hello World!" | * simply displays "Hello World!" | ||
*/ | */ | ||
+ | |||
class HelloWorldApp { | class HelloWorldApp { | ||
+ | |||
public static void main(String[] args) { | public static void main(String[] args) { | ||
System.out.println(" | System.out.println(" | ||
行 340: | 行 333: | ||
</ | </ | ||
- | The following language strings are currently recognized: //actionscript-french, | + | 目前支持的语言有: // |
+ | ==== 可下载的代码块 ==== | ||
- | ===== RSS/ATOM Feed Aggregation ===== | + | 若您使用上述的「%%< |
- | [[DokuWiki]] can integrate data from external XML feeds. For parsing the XML feeds, [[http:// | + | |
- | ^ Parameter | + | < |
- | | any number | will be used as maximum number items to show, defaults to 8 | | + | <file php myexample.php> |
- | | reverse | + | <?php echo "hello world!"; |
- | | author | + | </file> |
- | | date | show item dates | | + | </code> |
- | | description| show the item description. If [[doku>wiki: | + | |
- | | //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. [[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 [[DokuWiki]] to re-render the page if it is more than //refresh period// since the page was last rendered. | + | <file php myexample.php> |
+ | <?php echo "hello world!"; | ||
+ | </file> | ||
- | **Example: | + | 若您不想把语法高亮显示出,但想方便浏览者下载,您可以用链接号「-」作语言代码。例如:「%%< |
- | {{rss> | + | ===== RSS/ATOM Feed聚合 ===== |
- | {{rss>http://slashdot.org/index.rss 5 author date 1h }} | + | DokuWiki能從外部XML feed中聚合數據。爲分析這些XML feed,DokuWiki使用了[[http://simplepie.org/|SimplePie]]。凡是SimplePie能理解的格式,都可用於DokuWiki中。您可以更改不同的參數,以改變其渲染。參數之間請用空格隔開: |
- | ===== Embedding | + | ^ 參數 |
+ | | any number | 最多顯示多少項內容;預設值是8。 | | ||
+ | | reverse | ||
+ | | author | ||
+ | | date | 顯示條目數據。 | | ||
+ | | description| 顯示條目的描述;如果[[doku> | ||
+ | | //n//[dhm] | 刷新周期,其中,d=日數,h=小時數,m=分。例如,12h=12小時。 | | ||
- | You can embed raw HTML or PHP code into your documents by using the '' | + | 預設的刷新周期是4小時。小於10分鐘者亦視爲10分鐘。DokuWiki通常會提供頁面的暫存版,但這做法不適用於包含動態外部內容的頁面。上面的參數則告訴DokuWiki:若對上一次渲染時間已經過了//刷新周期// |
- | < | + | |
- | < | + | |
- | This is some <font color=" | + | |
- | </html> | + | |
- | </code> | + | |
- | < | + | **範例:** |
- | This is some <font color=" | + | |
- | </ | + | |
- | <code> | + | {{rss>http://slashdot.org/index.rss 5 author date 1h }} |
- | < | + | |
- | echo 'A logo generated by PHP:'; | + | |
- | echo '< | + | |
- | </php> | + | |
- | </code> | + | |
- | <php> | + | {{rss>http://slashdot.org/index.rss 5 author date 1h }} |
- | echo 'A logo generated by PHP:'; | + | |
- | echo '< | + | |
- | </ | + | |
- | **Please Note**: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed. | + | ===== 控制巨集 ===== |
- | ===== Syntax Plugins ===== | + | 有些語法會影響DokuWiki對頁面的渲染,而自身不輸出任何內容。可用的控制巨集如下: |
- | DokuWiki's syntax can be extended by [[doku>wiki: | + | ^ 巨集 |
+ | | %%~~NOTOC~~%% | ||
+ | | %%~~NOCACHE~~%% | DokuWiki預設會緩存所有的輸出。有時您並不希望這樣(例如您使用了上述的%%< | ||
- | ~~INFO:syntaxplugins~~ | + | ===== 語法附加元件 ===== |
+ | |||
+ | 運用[[doku> | ||
+ | ~~INFO: |