Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| zh-cn:wiki:syntax [2012/04/16 18:27] – [Text to HTML Conversions] haobug | zh-cn:wiki:syntax [2026/11/06 04:12] (current) – removed kevinbowen | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== 格式化语法 ====== | ||
| - | |||
| - | [[doku> | ||
| - | ===== 基本文字格式 ===== | ||
| - | DokuWiki支持**粗体**,// | ||
| - | |||
| - | DokuWiki支持**粗体**,// | ||
| - | |||
| - | 您也可以使用< | ||
| - | |||
| - | 您也可以使用< | ||
| - | |||
| - | 同时也可以使用< | ||
| - | |||
| - | 同时也可以使用< | ||
| - | |||
| - | **段落**是由空行所建立的。如果您想**强制换行**而不建立段落,您可以使用两个连续的反斜杠接空格或换行符作为标记。请看样例: | ||
| - | |||
| - | 这是一些有着换行标记的文字。\\ 请注意 | ||
| - | 双反斜杠只在回车符之前\\ | ||
| - | 或者接在\\ 一个空格之前的时候才有效。\\而这样就并不起作用。 | ||
| - | |||
| - | 这是一些有着换行标记的文字。\\ 请注意 | ||
| - | 双反斜杠只在回车符之前\\ | ||
| - | 或者接在\\ 一个空格之前的时候才有效。\\而这样就并不起作用。 | ||
| - | |||
| - | 请仅在必须的时候使用强制换行标记。 | ||
| - | ===== 链接 ===== | ||
| - | |||
| - | DokuWiki 支持以多种创建链接方法。 | ||
| - | |||
| - | ==== 外部链接 ==== | ||
| - | |||
| - | 外部链接会被自动地识别: http:// | ||
| - | |||
| - | DokuWiki 支持以多种创建链接方法。外部链接会被自动地识别: http:// | ||
| - | ==== 内部链接 ==== | ||
| - | |||
| - | 内部链接可以用方括号创建。您可以只给出[[页面名]],或附加[[页面名|链接文本]]。 | ||
| - | |||
| - | 内部链接可以用方括号创建。您可以只给出 | ||
| - | [[页面名]],或附加[[页面名|链接文本]]。 | ||
| - | |||
| - | [[doku> | ||
| - | |||
| - | 您可以通过在页面名中添加冒号的方式来使用[[某目录: | ||
| - | |||
| - | 您可以通过在页面名中添加冒号的方式来使用[[某目录: | ||
| - | |||
| - | 如果您需要更多有关“命名空间(namespaces)”的详细信息,请参见[[doku> | ||
| - | |||
| - | 链接到一个特定章节也是可能的。只需要在# | ||
| - | |||
| - | 这是一个指向[[syntax# | ||
| - | |||
| - | 注意: | ||
| - | * 指向[[syntax|已存在页面]]的和[[nonexisting|不存在页面]]的链接,其外观是不同的。 | ||
| - | * 默认情况下,DokuWiki不使用[[wp> | ||
| - | * 当一节的标题改变时,它的书签也会改变。因此,请不要过于依赖章节链接。 | ||
| - | ==== Wiki间链接 ==== | ||
| - | |||
| - | DokuWiki支持[[doku> | ||
| - | |||
| - | DokuWiki支持[[doku> | ||
| - | 例如,这是一个指向Wikipedia上Wiki条目的链接:[[wp> | ||
| - | |||
| - | ==== Windows 共享文件夹 ==== | ||
| - | |||
| - | Windows 共享文件夹,例如[[\\server\share|这个]]也可以被识别。请注意,这只在企业[[wp> | ||
| - | |||
| - | Windows共享文件夹,例如[[\\server\share|这个]]也可以被识别。 | ||
| - | |||
| - | 注意: | ||
| - | |||
| - | * 出于安全原因,只有在微软IE浏览器上才能够直接访问Windows共享文件夹(并且仅在“本地区域”)。 | ||
| - | * 对于Mozilla和Firefox可以通过[[http:// | ||
| - | |||
| - | $lang[' | ||
| - | |||
| - | ==== 图像链接 ==== | ||
| - | |||
| - | 您也可以通过结合链接和[[# | ||
| - | |||
| - | [[http:// | ||
| - | |||
| - | [[http:// | ||
| - | |||
| - | 请注意:图像的格式化语法是链接文本唯一接受的格式化语法。 | ||
| - | |||
| - | 所有的图像 [[# | ||
| - | |||
| - | ===== 脚注 ===== | ||
| - | |||
| - | 您可以使用两个连续小括号(英文)来添加脚注((这是一个脚注))。 | ||
| - | |||
| - | 您可以使用两个连续小括号(英文)来添加脚注((这是一个脚注))。 | ||
| - | |||
| - | ===== 分节 ===== | ||
| - | |||
| - | 您可以使用多达5层的标题来组织您的内容。如果您使用了三个以上的标题,将自动生成目录 -- 这可以通过在页面加入 ''< | ||
| - | |||
| - | ==== 3级标题 ==== | ||
| - | === 4级标题 === | ||
| - | == 5级标题 == | ||
| - | |||
| - | ==== 3级标题 ==== | ||
| - | === 4级标题 === | ||
| - | == 5级标题 == | ||
| - | |||
| - | 您可以通过4个以上连续的“-”号来创建一条水平分割线: | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ===== 图像和其它文件 ===== | ||
| - | |||
| - | 您可以用两个大括号在页面中加入外部或内部的 [[doku> | ||
| - | |||
| - | 实际大小: | ||
| - | |||
| - | 调整为指定宽度: | ||
| - | |||
| - | 调整为指定宽度和高度((当指定的长宽比与图像本身的长宽比不一致,在调整图像大小前,其将先被裁切到新的比例)):{{wiki: | ||
| - | |||
| - | 调整外部图像大小: | ||
| - | |||
| - | 实际大小: | ||
| - | 调整为指定宽度: | ||
| - | 调整为指定宽度和高度: | ||
| - | 调整外部图像大小: | ||
| - | |||
| - | |||
| - | 通过使用左空格或右空格,您可以选择对齐方式。 | ||
| - | |||
| - | {{ wiki: | ||
| - | |||
| - | {{wiki: | ||
| - | |||
| - | {{ wiki: | ||
| - | |||
| - | {{ wiki: | ||
| - | {{wiki: | ||
| - | {{ wiki: | ||
| - | |||
| - | 当然,您也可以指定一个标题(多数浏览器显示为提示文本)。 | ||
| - | |||
| - | {{ wiki: | ||
| - | |||
| - | {{ wiki: | ||
| - | |||
| - | 如果您指定的文件名(无论是外部的还是内部的)不是一个图像(gif, | ||
| - | |||
| - | 对于将图像链接到其他页面,参见上面的 [[# | ||
| - | |||
| - | ===== 列表 ===== | ||
| - | |||
| - | Dokuwiki 持带编号或不带编号的列表。 要创建列表,在文字前加入两个空格,然后使用 '' | ||
| - | |||
| - | * 这是一个列表 | ||
| - | * 第二项 | ||
| - | * 您可以有不同的层次 | ||
| - | * 另一项 | ||
| - | |||
| - | - 带编号的列表 | ||
| - | - 另一项 | ||
| - | - 用缩进表示更深的层 | ||
| - | - 就这样 | ||
| - | |||
| - | < | ||
| - | * 这是一个列表 | ||
| - | * 第二项 | ||
| - | * 您可以有不同的层次 | ||
| - | * 另一项 | ||
| - | |||
| - | - 带编号的列表 | ||
| - | - 另一项 | ||
| - | - 用缩进表示更深的层 | ||
| - | - 就这样 | ||
| - | </ | ||
| - | |||
| - | 请参看下 [[doku> | ||
| - | |||
| - | ===== 文本转换 ===== | ||
| - | |||
| - | DokuWiki 可以将预定义的字符或者字符串转换成图像、其他文本或HTML。 | ||
| - | |||
| - | 文本转换为图像主要用于表情符号。文本到HTML的转换用于排版的字符替换,但也可以配置为使用其他HTML。 | ||
| - | |||
| - | ==== 文本到图像的转换 ==== | ||
| - | |||
| - | DokuWiki 会将一些常用的 [[wp> | ||
| - | |||
| - | * 8-) %% 8-) %% | ||
| - | * 8-O %% 8-O %% | ||
| - | * :-( %% :-( %% | ||
| - | * :-) %% :-) %% | ||
| - | * =) %% =) %% | ||
| - | * :-/ %% :-/ %% | ||
| - | * :-\ %% :-\ %% | ||
| - | * :-? %% :-? %% | ||
| - | * :-D %% :-D %% | ||
| - | * :-P %% :-P %% | ||
| - | * :-O %% :-O %% | ||
| - | * :-X %% :-X %% | ||
| - | * :-| %% :-| %% | ||
| - | * ;-) %% ;-) %% | ||
| - | * ^_^ %% ^_^ %% | ||
| - | * :?: %% :?: %% | ||
| - | * :!: %% :!: %% | ||
| - | * LOL %% LOL %% | ||
| - | * FIXME %% FIXME %% | ||
| - | * DELETEME %% DELETEME %% | ||
| - | |||
| - | ==== 文本到HTML的转换 ==== | ||
| - | |||
| - | 印刷:[[DokuWiki]] 可以将特定字符转换为印刷时所用的样式。这是可识别的字符示例。 | ||
| - | |||
| - | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
| - | " | ||
| - | |||
| - | < | ||
| - | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
| - | " | ||
| - | </ | ||
| - | |||
| - | 同样的做法可以产生任何类型的HTML,只需要添加到 [[doku> | ||
| - | |||
| - | 有三个例外,它们并非来自模式文件:乘法(640×480)、' | ||
| - | |||
| - | ===== Quoting ===== | ||
| - | |||
| - | Some times you want to mark some text to show it's a reply or comment. You can use the following syntax: | ||
| - | |||
| - | I think we should do it | ||
| - | | ||
| - | > No we shouldn' | ||
| - | | ||
| - | >> 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 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 '' | ||
| - | |||
| - | ^ 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, | ||
| - | |||
| - | 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 '':::'' | ||
| - | |||
| - | ^ 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 | ||
| - | | | ||
| - | |left | | ||
| - | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
| - | |||
| - | This is how it looks in the source: | ||
| - | |||
| - | ^ Table with alignment | ||
| - | | | ||
| - | |left | | ||
| - | | 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), | ||
| - | |||
| - | < | ||
| - | This is some text which contains addresses like this: http:// | ||
| - | </ | ||
| - | The same is true for %%// | ||
| - | |||
| - | < | ||
| - | This is some text which contains addresses like this: http:// | ||
| - | </ | ||
| - | The same is true for %%// | ||
| - | |||
| - | ===== 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 '' | ||
| - | |||
| - | This is text is indented by two spaces. | ||
| - | |||
| - | < | ||
| - | This is preformatted code all spaces are preserved: like <-this | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | This is pretty much the same, but you could use it to show that you quoted a file. | ||
| - | </ | ||
| - | |||
| - | Those blocks were created by this source: | ||
| - | |||
| - | This is text is indented by two spaces. | ||
| - | |||
| - | < | ||
| - | This is preformatted code all spaces are preserved: like <-this | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | This is pretty much the same, but you could use it to show that you quoted a file. | ||
| - | </ | ||
| - | |||
| - | ==== Syntax Highlighting ==== | ||
| - | |||
| - | [[wiki: | ||
| - | |||
| - | <code java> | ||
| - | /** | ||
| - | * The HelloWorldApp class implements an application that | ||
| - | * simply displays "Hello World!" | ||
| - | */ | ||
| - | class HelloWorldApp { | ||
| - | public static void main(String[] args) { | ||
| - | System.out.println(" | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | The following language strings are currently recognized: //4cs, abap, actionscript-french, | ||
| - | |||
| - | ==== Downloadable Code Blocks ==== | ||
| - | |||
| - | When you use the '' | ||
| - | |||
| - | < | ||
| - | <file php myexample.php> | ||
| - | <?php echo "hello world!"; | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | <file php myexample.php> | ||
| - | <?php echo "hello world!"; | ||
| - | </ | ||
| - | |||
| - | If you don't want any highlighting but want a downloadable file, specify a dash ('' | ||
| - | |||
| - | |||
| - | ===== Embedding HTML and PHP ===== | ||
| - | |||
| - | You can embed raw HTML or PHP code into your documents by using the '' | ||
| - | |||
| - | HTML example: | ||
| - | |||
| - | < | ||
| - | < | ||
| - | This is some <span style=" | ||
| - | </ | ||
| - | < | ||
| - | <p style=" | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | This is some <span style=" | ||
| - | </ | ||
| - | < | ||
| - | <p style=" | ||
| - | </ | ||
| - | |||
| - | PHP example: | ||
| - | |||
| - | < | ||
| - | <php> | ||
| - | echo 'A logo generated by PHP:'; | ||
| - | echo '< | ||
| - | echo ' | ||
| - | </ | ||
| - | <PHP> | ||
| - | echo '< | ||
| - | echo '< | ||
| - | echo '</ | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | <php> | ||
| - | echo 'A logo generated by PHP:'; | ||
| - | echo '< | ||
| - | echo ' | ||
| - | </ | ||
| - | <PHP> | ||
| - | echo '< | ||
| - | echo '< | ||
| - | echo '</ | ||
| - | </ | ||
| - | |||
| - | **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:// | ||
| - | |||
| - | ^ Parameter | ||
| - | | any number | will be used as maximum number items to show, defaults to 8 | | ||
| - | | reverse | ||
| - | | author | ||
| - | | date | show item dates | | ||
| - | | description| show the item description. If [[doku> | ||
| - | | //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: | ||
| - | |||
| - | **Example: | ||
| - | |||
| - | {{rss> | ||
| - | |||
| - | |||
| - | ===== 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~~%% | ||
| - | | %%~~NOCACHE~~%% | DokuWiki caches all output by default. Sometimes this might not be wanted (eg. when the %%< | ||
| - | |||
| - | ===== Syntax Plugins ===== | ||
| - | |||
| - | DokuWiki' | ||
| - | |||
| - | ~~INFO: | ||