1450848764 | current | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== 语法格式 ====== | + | ====== 格式化语法 ====== |
- | + | [[doku>DokuWiki]]**支持一些简单的标记语言**,以尽可能使文档的可读性更高。本页包含了您在编辑页面时可能用到所有语法的说明。如果需要查看本页源码,只需要点击页面顶部或者底部的//编辑本页//按钮。如果您想做一些尝试,那么可以使用[[playground:playground|Playground]]来尽情挥洒。通过[[doku>zh:toolbar|快捷按钮]],您可以更方便地使用这些标记。 | |
- | [[doku>DokuWiki]] 支持一些简单的标记语言, 以使得数据文件尽可能易读. 本页面包含了您在编辑页面时所可能用到的各种语法. 点击"编辑本页"按钮即可查看本页的源代码. 如果您想尝试一些新事物, 只需访问 [[playground:playground|playground]] 页面. 你也可以通过访问 [[doku>toolbar|quickbuttons]] 以更简单地使用标记. | + | |
===== 基本文字格式 ===== | ===== 基本文字格式 ===== | ||
+ | DokuWiki支持**粗体**,//斜体//,__下划线__以及''等宽体''等格式。当然,您可以**__//''混合使用''//__**这些格式。 | ||
- | DokuWiki 支持 **粗体**, //斜体//, __下划线__ 及 ''等宽'' 样式. 当然你也可以 **__//''混用''//__** 这些样式. | + | DokuWiki支持**粗体**,//斜体//,__下划线__以及''等宽体''等格式。 |
- | + | 当然,您可以**__//''混合使用''//__**这些格式。 | |
- | DokuWiki 支持 **粗体**, //斜体//, __下划线__ 及 ''等宽'' 样式. | + | |
- | 当然你也可以 **__//''混用''//__** 这些样式. | + | |
- | + | ||
- | 你也可以使用 <sub>下标</sub> 和 <sup>上标</sup> 样式. | + | |
- | 你也可以使用 <sub>下标</sub> 和 <sup>上标</sup> 样式. | + | 您也可以使用<sub>下标</sub>和<sup>上标</sup>。 |
- | 也可以将某些文字标记为 <del>已删除</del>. | + | 您也可以使用<sub>下标</sub>和<sup>上标</sup>。 |
- | 也可以将某些文字标记为 <del>已删除</del>. | + | 同时也可以使用<del>删除线</del>标记某些信息。 |
- | **段落** 可以通过空行创建出来. 如果你想要在不另起一段的情况下 **强制换行**, 可以使用两个反斜杠并后跟一个空格或者回车表示换行. | + | 同时也可以使用<del>删除线</del>标记某些信息。 |
- | 这是一段带有换行标记的文字\\ 请注意 | + | **段落**是由空行所建立的。如果您想**强制换行**而不建立段落,您可以使用两个连续的反斜杠接空格或回车作为标记。请看样例: |
- | 两个反斜杠必须位于行末\\ | + | |
- | 或者后跟\\ | + | |
- | 一个空格 \\否则就不会换行而是出现两个反斜杠. | + | |
- | 这是一段带有换行标记的文字\\ 请注意 | + | 这是一些有着换行标记的文字。\\ 请注意 |
- | 两个反斜杠必须位于行末\\ | + | 双反斜杠只在回车符之前\\ |
- | 或者后跟\\ | + | 或者接在\\ 一个空格之前的时候才有效。\\而这样就并不起作用。 |
- | 一个空格 \\否则就不会换行而是出现两个反斜杠. | + | |
- | 你应该只在必要的时候使用强制换行. | + | 这是一些有着换行标记的文字。\\ 请注意 |
+ | 双反斜杠只在回车符之前\\ | ||
+ | 或者接在\\ 一个空格之前的时候才有效。\\而这样就并不起作用。 | ||
+ | 请仅在必须的时候使用强制换行标记。 | ||
===== 链接 ===== | ===== 链接 ===== | ||
- | DokuWiki 支持多种方式创建链接. | + | DokuWiki支持以多种形式创建链接。 |
==== 外部链接 ==== | ==== 外部链接 ==== | ||
- | 外部链接会被自动识别, 例如 http://www.google.com 或简单地写作 www.google.com. 你也可以设置链接文本: [[http://www.google.com|这个链接指向 Google]]. 电子邮件地址, 例如 <andi@splitbrain.org>, 也能够被识别. | + | 外部链接会被自动地识别:http://www.google.com,或者简单地写作www.google.com——您也可以设置链接文本:[[http://www.google.com|此链接指向google]]。类似这样的电子邮件地址:<andi@splitbrain.org>也可以被识别。 |
- | DokuWiki 支持多种方式创建链接. 外部链接会被自动识别, | + | DokuWiki支持以多种形式创建链接。外部链接会被自动地识别: |
- | 例如 http://www.google.com 或简单地写作 www.google.com. | + | http://www.google.com,或者简单地写作www.google.com |
- | 你也可以设置链接文本: [[http://www.google.com|这个链接指向 Google]]. | + | ——您也可以设置链接文本:[[http://www.google.com|此链接指向google]]。 |
- | 电子邮件地址, 例如 <andi@splitbrain.org>, 也能够被识别. | + | 类似这样的电子邮件地址:<andi@splitbrain.org>也可以被识别。 |
==== 内部链接 ==== | ==== 内部链接 ==== | ||
- | 使用方括号创建内部链接. 你可以只给出一个 [[页面名]] 或加上一个 [[页面名|链接文本]]. | + | 内部链接可以用方括号创建。您可以只给出[[页面名]],或附加[[页面名|链接文本]]。 |
- | 使用方括号创建内部链接. 你可以只给出一个 [[页面名]] | + | 内部链接可以用方括号创建。您可以只给出 |
- | 或加上一个 [[页面名|链接文本]]. | + | [[页面名]],或附加[[页面名|链接文本]]。 |
- | [[doku>pagename|Wiki 的页面名]] 会被自动转成小写, 且不允许使用特殊字符. | + | [[doku>pagename|Wiki的页面名]]会被自动地转换为小写字母,并且不允许使用特殊字符。 |
- | 你可以通过在页面名中使用冒号使用 [[某目录:命名空间]]. | + | 您可以通过在页面名中添加冒号的方式来使用[[某目录:命名空间]]。 |
- | 你可以通过在页面名中使用冒号使用 [[某目录:命名空间]]. | + | 您可以通过在页面名中添加冒号的方式来使用[[某目录:命名空间]]。 |
- | 更多关于命名空间的详细信息, 参阅 [[doku>namespaces]]. | + | 如果您需要更多有关“命名空间(namespaces)”的详细信息,请参见[[doku>namespaces]]。 |
- | 还可以链接到页面中的特定部分. 与 HTML 语法一样, 只需在页面名后加上 # 号并在 # 号后面加上章节名称. 例如 [[syntax#内部链接|本节]]. | + | 链接到一个特定章节也是可能的。只需要在#号后面加上章节的名称。这是一个指向[[syntax#外部链接|本节]]的链接。 |
- | 例如 [[syntax#内部链接|本节]]. | + | 这是一个指向[[syntax#内部链接|本节]]的链接。 |
- | 注意: | + | 注意: |
+ | * 指向[[syntax|已存在页面]]的和[[nonexisting|不存在页面]]的链接,其外观是不同的。 | ||
+ | * 默认情况下,DokuWiki不使用[[wp>CamelCase]]来自动建立链接。但这一设定可以在[[doku>config|配置文件]]中激活。提示:如果DokuWiki显示为链接,则说明已激活。 | ||
+ | * 当一节的标题改变时,它的书签也会改变。因此,请不要过于依赖章节链接。 | ||
- | * 指向 [[syntax|已存在的页面]] 和 [[不存在的页面]] 的链接有着不同的外观. | + | ==== Wiki间链接 ==== |
- | * DokuWiki 默认不使用 [[wp>CamelCase]] 自动创建链接, 但是这一特性可以在 [[doku>config|配置文件]] 中开启. 提示, 如果 DokuWiki 显示为链接, 则表明这一特性已被开启. | + | |
- | * 当章节标题被改变时, 它的书签也就被改变了. 所以, 不要过分依赖章节链接. | + | |
- | ==== 跨 Wiki 链接 ==== | + | DokuWiki支持[[doku>Interwiki]](Wiki间链接)。他们是到其他Wiki的快速链接。例如,这是一个指向Wikipedia上Wiki条目的链接:[[wp>Wiki]]。 |
- | DokuWiki 支持 [[doku>Interwiki|Wiki 间链接]]. 这是一些通往其他 Wiki 的快速链接. 例如 [[wp>Wiki]] 是一个通往维基百科页面的链接. | + | DokuWiki支持[[doku>Interwiki]](Wiki间链接)。他们是到其他Wiki的快速链接。 |
+ | 例如,这是一个指向Wikipedia上Wiki条目的链接:[[wp>Wiki]] | ||
+ | ==== Windows共享文件夹 ==== | ||
- | DokuWiki 支持 [[doku>Interwiki|Wiki 间链接]]. 这是一些通往其他 Wiki 的快速链接. | + | Windows共享文件夹,例如[[\\server\share|这个]]也可以被识别。请注意,这只在企业[[wp>Intranet|内部网]]等局域网环境中才有意义。 |
- | 例如 [[wp>Wiki]] 是一个通往维基百科页面的链接. | + | |
- | ==== Windows 共享文件夹 ==== | + | Windows共享文件夹,例如[[\\server\share|这个]]也可以被识别。 |
- | Windows 共享文件夹, 例如 [[\\server\share|这个]] 也可以被识别. 请注意这只在企业 [[wp>Intranet|内部网]] 等局域网环境中才能生效. | + | 注: |
- | Windows 共享文件夹, 例如 [[\\server\share|这个]] 也可以被识别. | + | * 出于安全原因,只有在微软IE浏览器上才能够直接访问Windows共享文件夹(并且仅在“本地区域”)。 |
- | + | * 对于Mozilla和Firefox可以通过[[http://kb.mozillazine.org/Firefox_:_Issues_:_Links_to_Local_Pages_Don%27t_Work|Mozilla知识库]]中提到的不同解决方法启用。但是,打开一个windows共享文件夹时仍然会有一个JavaScript告警。要去除这个警告(为所有用户),把下面一行放入"conf/userscript.js"中; | |
- | 注意: | + | |
- | + | ||
- | * 出于安全性考虑只有在微软 IE 浏览器上才能够直接访问共享文件夹且只能访问"本地区域". | + | |
- | * 对于 Mozilla 和 Firefox 可以通过 [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|Mozilla 知识库]] 中提到的不同解决方法启用. 但是, 打开一个windows共享文件夹时仍然会有一个 JavaScript 警告. 要为所有用户去除这个警告, 请把下面一行放入“conf/userscript.js”中: | + | |
- | + | ||
- | <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> | + | |
+ | LANG.nosmblinks = ''; | ||
==== 图像链接 ==== | ==== 图像链接 ==== | ||
- | 你还可以使用图片链接到一个内部或外部页面. 语法为 [[#图像和其他文件|图片]]. 例如: | + | 您也可以通过结合链接和[[#图像和其它文件|图像]](见下文)的语法,用图像来链接到一个内部或者外部的页面。如下所示: |
[[http://www.php.net|{{wiki:dokuwiki-128.png}}]] | [[http://www.php.net|{{wiki:dokuwiki-128.png}}]] | ||
Line 105: | Line 90: | ||
[[http://www.php.net|{{wiki:dokuwiki-128.png}}]] | [[http://www.php.net|{{wiki:dokuwiki-128.png}}]] | ||
- | 请注意: 图像的格式化语法是链接文本唯一接受的格式化语法. | + | 请注意:图像的格式化语法是链接文本唯一接受的格式化语法。 |
- | 所有的 [[##images_and_other_files|图像]] 和 [[#links|链接]] 语法都是支持的(包括图像缩放, 内部和外部的图片与链接以及跨 Wiki 链接). | + | 所有的图像和链接语法都是支持的(包括图像大小调整、内部和外部的图像与链接以及wiki内链接)。 |
===== 脚注 ===== | ===== 脚注 ===== | ||
- | 你可以通过使用两个括号添加脚注((这是一个脚注)). | + | 您可以使用两个连续小括号来添加脚注((这是一个脚注))。 |
- | 你可以通过使用两个括号添加脚注((这是一个脚注)). | + | 您可以使用两个连续小括号来添加脚注((这是一个脚注))。 |
===== 分节 ===== | ===== 分节 ===== | ||
- | 你可以使用最多五个不同等级的标题组织你的内容. 如果使用了超过三个标题会自动生成一个目录, 目录可以通过在页面中加入 ''<nowiki>~~NOTOC~~</nowiki>'' 以禁用. | + | 您可以使用多达5层的标题来组织您的内容。如果您使用了三个以上的标题,将自动生成目录——这可以通过在页面加入''<nowiki>~~NOTOC~~</nowiki>''字样来禁用。 |
- | ==== 等级 3 标题 ==== | + | ==== H3标题 ==== |
- | === 等级 4 标题 === | + | === H4标题 === |
- | == 等级 5 标题 == | + | == H5标题 == |
- | ==== 等级 3 标题 ==== | + | ==== H3标题 ==== |
- | === 等级 4 标题 === | + | === H4标题 === |
- | == 等级 5 标题 == | + | == H5标题 == |
- | 通过使用四个以上的短横线, 你可以创建一条水平分割线. | + | 您可以通过4个以上连续的“-”号来创建一条水平分割线: |
---- | ---- | ||
- | ===== 多媒体文件 ===== | ||
- | 你可以用两个大括号在页面中加入内部和外部的 [[doku>images|图片, 视频和音频]]. 你还可以指定其大小. | + | ===== 图像和其它文件 ===== |
+ | |||
+ | 您可以用两个大括号在页面中加入外部或内部的[[doku>images|图像]]。您还可以指定它们的大小。 | ||
+ | |||
+ | 原始大小: {{wiki:dokuwiki-128.png}} | ||
- | 实际大小: {{wiki:dokuwiki-128.png}} | ||
- | 缩放到指定大小: {{wiki:dokuwiki-128.png?50}} | + | 指定宽度: {{wiki:dokuwiki-128.png?50}} |
- | 缩放到指定大小:((当给定的长宽比与图片不符时, 在缩放前图片会先被修剪到指定的长宽比)) {{wiki:dokuwiki-128.png?200x50}} | + | 指定宽度和高度((当指定的长宽比与图像的不一致,在调整图像大小前,其将先被裁剪到新的比例)): {{wiki:dokuwiki-128.png?200x50}} |
- | 缩放后的外部图片: {{http://de3.php.net/images/php.gif?200x50}} | + | 重新指定宽度和高度的外部图像: {{http://de3.php.net/images/php.gif?200x50}} |
- | 实际大小: {{wiki:dokuwiki-128.png}} | + | 原始大小: {{wiki:dokuwiki-128.png}} |
- | 缩放到指定大小: {{wiki:dokuwiki-128.png?50}} | + | 指定宽度: {{wiki:dokuwiki-128.png?50}} |
- | 缩放到指定大小: {{wiki:dokuwiki-128.png?200x50}} | + | 指定宽度和高度((当指定的长宽比与图像的不一致,在调整图像大小前,其将先被裁剪到新的比例)): {{wiki:dokuwiki-128.png?200*50}} |
- | 缩放后的外部图片: {{http://de3.php.net/images/php.gif?200x50}} | + | 重新指定宽度和高度的外部图像: {{http://de3.php.net/images/php.gif?200x50}} |
- | 通过使用左右空格你可以指定图片的对齐方式. | + | 通过使用左空格或右空格,您可以选择对齐方式。 |
{{ wiki:dokuwiki-128.png}} | {{ wiki:dokuwiki-128.png}} | ||
Line 160: | Line 147: | ||
{{ wiki:dokuwiki-128.png }} | {{ wiki:dokuwiki-128.png }} | ||
- | 当然你也可以给图片加上标题(大部分浏览器会将其显示为提示文本). | + | 当然,您也可以指定一个标题(多数浏览器显示为提示文本((鼠标悬停可以看到)))。 |
{{ wiki:dokuwiki-128.png |这是标题}} | {{ wiki:dokuwiki-128.png |这是标题}} | ||
Line 166: | Line 153: | ||
{{ wiki:dokuwiki-128.png |这是标题}} | {{ wiki:dokuwiki-128.png |这是标题}} | ||
- | 要将图片作为链接指向另一个网页, 参见 [[#图像链接]]. | + | 如果您指定的文件名(无论是外部的还是内部的)不是一个图像(''gif,jpeg,png''),那么它将被显示为一个链接。 |
- | + | ||
- | ==== 支持的媒体格式 ==== | + | |
- | + | ||
- | DokuWiki 允许直接嵌入以下格式的媒体文件. | + | |
- | + | ||
- | | 图片 | ''gif'', ''jpg'', ''png'' | | + | |
- | | 视频 | ''webm'', ''ogv'', ''mp4'' | | + | |
- | | 音频 | ''ogg'', ''mp3'', ''wav'' | | + | |
- | | Flash | ''swf'' | | + | |
- | + | ||
- | 如果你指定的文件格式不是支持的媒体格式, 则它会显示为链接. | + | |
- | + | ||
- | 使用 ''?linkonly'' 会使你插入的媒体文件只显示为链接而不显示媒体文件. | + | |
- | + | ||
- | {{wiki:dokuwiki-128.png?linkonly}} | + | |
- | + | ||
- | {{wiki:dokuwiki-128.png?linkonly}} 这只是一个指向图片的链接. | + | |
- | + | ||
- | ==== 回退格式 ==== | + | |
- | + | ||
- | 并非所有的浏览器都能支持所有的音视频格式. 为了缓解这一问题, 你可以上传一个不同格式的文件以尽可能地与浏览器兼容. | + | |
- | + | ||
- | 例如, 你可以插入一个 mp4 视频文件: | + | |
- | + | ||
- | {{video.mp4|一段有趣的视频}} | + | |
- | + | ||
- | 当你紧接 ''video.mp4'' 上传 ''video.webm'' 与 ''video.ogv'' 时, DokuWiki 会自动将其它两个识别为备用项以保证其中某个文件能被浏览器识别. | + | |
- | + | ||
- | 此外, DokuWiki 还支持上传"封面"图. 封面图会在视频开始前显示, 必须拥有和视频文件相同的文件名且必须为 jpg 或 png 格式. 在上面的例子中可以是 ''video.jpg''. | + | |
+ | 对于将图像链接到其他页面,参见上面的[[#图像链接]]。 | ||
===== 列表 ===== | ===== 列表 ===== | ||
- | DokuWiki 支持有序与无序列表. 要创建一个列表项, 你必须用两个空格缩进, 如果是无序列表, 则使用 ''*'' 作为前缀, 如果是有序列表, 则使用 ''-'' 作为前缀. | + | DokuWiki支持带编号或不带编号的列表。要创建列表,在文字前加入两个空格,然后使用''*''标记不带编号的列表,用''-''标记带编号的列表。 |
* 这是一个列表 | * 这是一个列表 | ||
* 第二项 | * 第二项 | ||
- | * 你可以通过缩进拥有不同的层级 | + | * 您可以有不同的层次 |
* 另一项 | * 另一项 | ||
- | - 有序列表 | + | - 带编号的列表 |
- 另一项 | - 另一项 | ||
- | - 使用缩进可以改变层级深度 | + | - 用缩进表示更深的层 |
- | - 就是这样 | + | - 就这样 |
<code> | <code> | ||
* 这是一个列表 | * 这是一个列表 | ||
* 第二项 | * 第二项 | ||
- | * 你可以通过缩进拥有不同的层级 | + | * 您可以有不同的层次 |
* 另一项 | * 另一项 | ||
- | - 有序列表 | + | - 带编号的列表 |
- 另一项 | - 另一项 | ||
- | - 使用缩进可以改变层级深度 | + | - 用缩进表示更深的层 |
- | - 就是这样 | + | - 就这样 |
</code> | </code> | ||
- | |||
- | 参见 [[doku>faq:lists|关于列表项的 FAQ]]. | ||
===== 文本转换 ===== | ===== 文本转换 ===== | ||
- | DokuWiki 可以将一些预定义的字符或短语转换为图片或其它文本或 HTML 记号. | + | DokuWiki可以将预定义的字符或者字符串转换成图像、其他文本或HTML。 |
- | 文本转换为图像主要用于表情符号. 文本到HTML的转换用于排版的字符替换, 但也可以配置为使用其他HTML. | + | 文本转换为图像主要用于表情符号。文本到HTML的转换用于排版的字符替换,但也可以配置为使用其他HTML。 |
+ | ==== 文本到图像的转换 ==== | ||
- | ==== 文本到图片 ==== | + | DokuWiki会将一些常用的 [[wp>emoticon|表情符号]]转换为相应图像。这些[[doku>Smileys|表情符号]]和其他图像可以被配置和扩展。这是DokuWiki中包含的表情符号的概况: |
- | + | ||
- | DokuWiki会将一些常用的 [[wp->emoticon|表情符号]] 转换为相应的图像. 这些 [[doku>Smileys|笑容符号]] 和其它图片可以被配置和扩展. 以下是一些 DokuWiki 支持的表情符号. | + | |
- | 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-) %% | ||
Line 257: | Line 212: | ||
* DELETEME %% DELETEME %% | * DELETEME %% DELETEME %% | ||
- | ==== 文本到 HTML ==== | ||
- | 排版: [[DokuWiki]] 可以将简单的文字转换为印刷所用的样式. 以下是一些可被识别的字符的示例. | + | ==== 文本到HTML的转换 ==== |
+ | |||
+ | 印刷:[[DokuWiki]]可以将特定字符转换为印刷时所用的样式。这是可识别的字符示例。 | ||
-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
Line 269: | Line 225: | ||
</code> | </code> | ||
- | 同样的做法可以做出任何形式的 HTML, 只需将其加入 [[doku>entities|模式文件]]. | + | 同样的做法可以产生任何类型的HTML,只需要添加到[[doku>entities|模式文件]] |
- | 有三个不是来自模式文件的特殊符号: 乘号(640x480), '单引号' 和 "双引号". 这一转换可以通过 [[doku>config:typography|配置选项]] 关闭. | + | 这里有三个例外,它们并非来自模式文件:乘号(640x480)、'单引号'和"双引号"。它们可以通过[[doku>config:typography|配置选项]]关闭。 |
- | There are three exceptions which do not come from that pattern file: multiplication entity (640x480), 'single' and "double quotes". They can be turned off through a [[doku>config:typography|config option]]. | + | |
- | ===== Quoting ===== | + | ===== 引用 ===== |
- | 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 | | + | | (1,1) | (1,2) | (1,3) | |
- | | Row 2 Col 1 | some colspan (note the double pipe) || | + | | (2,1) | 一些跨列合并(注意两条竖线) || |
- | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | + | | (3,1) | (3,2) | (3,3) | |
- | Table rows have to start and end with a ''|'' for normal rows or a ''^'' for headers. | + | 表格的每一行都以分隔符 ''|'' (普通行)或者 ''^'' (标题行)作为开头和结束。 |
- | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | + | ^ 标题1 ^ 标题2 ^ 标题3 ^ |
- | | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | + | | (1,1) | (1,2) | (1,3) | |
- | | Row 2 Col 1 | some colspan (note the double pipe) || | + | | (2,1) | 一些跨列合并(注意两条竖线) || |
- | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | + | | (3,1) | (3,2) | (3,3) | |
- | To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators! | + | 要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符! |
- | Vertical tableheaders are possible, too. | + | 竖直的标题列也是可以实现的: |
- | | ^ Heading 1 ^ Heading 2 ^ | + | | ^ 标题1 ^ 标题2 ^ |
- | ^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | | + | ^ 标题3 | (1,2) | (1,3) | |
- | ^ Heading 4 | no colspan this time | | | + | ^ 标题4 | 不再合并单元格 | | |
- | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | | + | ^ 标题5 | (2,2) | (2,3) | |
- | As you can see, it's the cell separator before a cell which decides about the formatting: | + | 可以看到,单元格前面的分隔符决定了单元格的格式。 |
- | | ^ Heading 1 ^ Heading 2 ^ | + | | ^ 标题1 ^ 标题2 ^ |
- | ^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | | + | ^ 标题3 | (1,2) | (1,3) | |
- | ^ Heading 4 | no colspan this time | | | + | ^ 标题4 | 不再合并单元格 | | |
- | ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | | + | ^ 标题5 | (2,2) | (2,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 ^ | + | ^ 标题1 ^ 标题 2 ^ 标题 3 ^ |
- | | Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 | | + | |(1,1)| 对该单元垂直合并 |(1,3)| |
- | | Row 2 Col 1 | ::: | Row 2 Col 3 | | + | |(2,1)| ::: |(2,3)| |
- | | Row 3 Col 1 | ::: | Row 2 Col 3 | | + | |(3,1)| ::: |(2,3)| |
- | Apart from the rowspan syntax those cells should not contain anything else. | + | 除跨行合并语法外,单元格中不能包含其他任何内容。 |
- | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | + | ^ 标题1 ^ 标题 2 ^ 标题 3 ^ |
- | | Row 1 Col 1 | this cell spans vertically | Row 1 Col 3 | | + | |(1,1)| 对该单元垂直合并 |(1,3)| |
- | | Row 2 Col 1 | ::: | Row 2 Col 3 | | + | |(2,1)| ::: |(2,3)| |
- | | Row 3 Col 1 | ::: | Row 2 Col 3 | | + | |(3,1)| ::: |(2,3)| |
- | You can align the table contents, too. Just add at least two whitespaces at the opposite end of your text: Add two spaces on the left to align right, two spaces on the right to align left and two spaces at least at both ends for centered text. | ||
- | ^ Table with alignment ^^^ | + | 您可以对齐表格的文字。只需在文本的相反方向添加至少两个空格:如果需要右对齐,在左边添加两个空格;反之,则在右边添加。在两边均添加空格可以实现居中对齐。 |
- | | right| center |left | | + | |
- | |left | right| center | | + | ^ 有对齐的表格 ^^^ |
+ | | 右对齐| 居中 |左对齐 | | ||
+ | |左对齐 | 右对齐| 居中 | | ||
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | This is how it looks in the source: | + | 下面是源文件中的样子: |
- | ^ Table with alignment ^^^ | + | ^ 有对齐的表格 ^^^ |
- | | right| center |left | | + | | 右对齐| 居中 |左对齐 | |
- | |left | right| center | | + | |左对齐 | 右对齐| 居中 | |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | Note: Vertical alignment is not supported. | + | 注意:不支持垂直对齐。 |
- | ===== No Formatting ===== | + | ===== 无格式化 ===== |
- | 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,以及**格式**的文字,但它没有被解析。 |
</nowiki> | </nowiki> | ||
- | The same is true for %%//__this__ text// with a smiley ;-)%%. | + | 对于带有表情符号的%%;-)的//__这段__文本//%%也一样。 |
<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,以及**格式**的文字,但它没有被解析。 |
</nowiki> | </nowiki> | ||
- | The same is true for %%//__this__ text// with a smiley ;-)%%. | + | 对于带有表情符号的%%;-)的//__这段__文本//%%也一样。 |
- | ===== Code Blocks ===== | + | ===== 代码块 ===== |
- | You can include code blocks into your documents by either indenting them by at least two spaces (like used for the previous examples) or by using the tags ''%%<code>%%'' or ''%%<file>%%''. | + | 您可以将代码块包含到文档中,可以通过缩进两个空格(像前面例子中所用的)或者使用标签''%%<code>%%''或''%%<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> | ||
+ | |||
+ | ==== 语法高亮 ==== | ||
- | ==== Syntax Highlighting ==== | + | [[wiki:DokuWiki]] 可以高亮源代码,使它更容易阅读。它使用[[http://qbnz.com/highlighter/|GeSHi]]通用语法高亮器——因此支持任何GeSHi所支持的语言。语法和前面章节中代码与文件块的一样,但这时所用语言的名称被放入标签中。例如''<nowiki><code java></nowiki>''或者''<nowiki><file java></nowiki>''。 |
- | + | ||
- | [[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> | ||
Line 422: | Line 378: | ||
</code> | </code> | ||
- | The following language strings are currently recognized: //4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript-french, actionscript, actionscript3, ada, algol68, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, epc, ecmascript, eiffel, email, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, go, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, html5, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml-brief, ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic// | + | 当前可以识别下列语言字符串://4cs, abap, actionscript-french, actionscript, actionscript3, ada, apache, applescript, asm, asp, autohotkey, autoit, avisynth, awk, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, cil, clojure, cmake, cobol, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, fsharp, gambas, genero, gdb, glsl, gml, gnuplot, groovy, gettext, haskell, hq9plus, html, idl, ini, inno, intercal, io, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lisp, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, mapbasic, matlab, mirc, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle8, oracle11, pascal, perl, perl6, per, php-brief, php, pike, pic16, pixelbender, plsql, povray, powerbuilder, powershell, progress, prolog, properties, providex, purebasic, python, qbasic, rails, rebol, reg, robots, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xml, xorg_conf, xpp, z80// |
- | ==== Downloadable Code Blocks ==== | + | ==== 可下载的代码块 ==== |
+ | |||
+ | 当您使用上面的''%%<code>%%''或''%%<file>%%''语法,您或许希望让显示的代码也可以被下载。您可以通过在语言代码后面指定一个文件名来实现: | ||
- | 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> | ||
Line 438: | Line 395: | ||
</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>%%''。 |
- | ===== Embedding HTML and PHP ===== | + | ===== 嵌入HTML和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或PHP代码到文件中,通过使用''%%<html>%%''或''%%<php>%%''标签。(如果您需要包围区块级别的元素,使用大写字母的标签。) |
- | HTML example: | + | HTML例子: |
<code> | <code> | ||
<html> | <html> | ||
- | This is some <span style="color:red;font-size:150%;">inline HTML</span> | + | 这是一些<span style="color:red;font-size:150%;">行内HTML</span> |
</html> | </html> | ||
<HTML> | <HTML> | ||
- | <p style="border:2px dashed red;">And this is some block HTML</p> | + | <p style="border:2px dashed red;">这是一些区块HTML</p> |
</HTML> | </HTML> | ||
</code> | </code> | ||
<html> | <html> | ||
- | This is some <span style="color:red;font-size:150%;">inline HTML</span> | + | 这是一些<span style="color:red;font-size:150%;">行内HTML</span> |
</html> | </html> | ||
<HTML> | <HTML> | ||
- | <p style="border:2px dashed red;">And this is some block HTML</p> | + | <p style="border:2px dashed red;">这是一些区块HTML</p> |
</HTML> | </HTML> | ||
- | PHP example: | + | PHP例子: |
<code> | <code> | ||
<php> | <php> | ||
- | echo 'The PHP version: '; | + | echo 'PHP生成的标志:'; |
- | echo phpversion(); | + | echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP标志!" />'; |
- | echo ' (generated inline HTML)'; | + | echo '(生成行内HTML)'; |
</php> | </php> | ||
<PHP> | <PHP> | ||
- | echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; | + | echo '<table class="inline"><tr><td>同样,不过是区块级别的元素:</td>'; |
- | echo '<td>'.phpversion().'</td>'; | + | echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP标志!" /></td>'; |
echo '</tr></table>'; | echo '</tr></table>'; | ||
</PHP> | </PHP> | ||
Line 479: | Line 435: | ||
<php> | <php> | ||
- | echo 'The PHP version: '; | + | echo 'PHP生成的标志:'; |
- | echo phpversion(); | + | echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP标志!" />'; |
- | echo ' (inline HTML)'; | + | echo '(生成行内HTML)'; |
</php> | </php> | ||
<PHP> | <PHP> | ||
- | echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; | + | echo '<table class="inline"><tr><td>同样,不过是区块级别的元素:</td>'; |
- | echo '<td>'.phpversion().'</td>'; | + | echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP标志!" /></td>'; |
echo '</tr></table>'; | echo '</tr></table>'; | ||
</PHP> | </PHP> | ||
- | **Please Note**: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed. | + | **请注意**:HTML和PHP嵌入默认在配置中被禁用。如果禁用,代码被显示出来而不是执行。 |
- | ===== RSS/ATOM Feed Aggregation ===== | + | ===== RSS/ATOM Feed聚合===== |
- | [[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 ^ | + | [[DokuWiki]]能够从外部的XML feed中聚合数据。为了解析这些XML feed,使用了[[http://simplepie.org/|SimplePie]]。所有的能够被SimplePie理解的格式都可以在DokuWiki中使用。您可以通过多个参数来改变渲染,参数之间用空格隔开: |
- | | 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. | + | ^ 参数 ^ 描述 ^ |
+ | | any number | 最多显示多少内容项;默认是8 | | ||
+ | | reverse | 将最新条目显示在前面 | | ||
+ | | author | 显示条目的作者名 | | ||
+ | | date | 显示条目日期 | | ||
+ | | description| 显示条目的描述;如果[[doku>config:htmlok|HTML]]被禁用,所有的标签将被过滤掉 | | ||
+ | | //n//[dhm] | 刷新周期,其中,d=天数,h=小时数,m=分。例如,12h=12个小时。 | | ||
- | 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''. | + | 刷新周期默认是4小时。小于或者等于10分钟均视为10分钟。[[wiki:DokuWiki]]通常会提供页面的缓存版,显然,这种做法不适用于包含动态外部内容的页面。上面的参数告诉[[wiki:DokuWiki]],如果离上次重新解释的时间已经超出了//刷新周期//,则重新解释页面。 |
- | **Example:** | + | **范例:** |
{{rss>http://slashdot.org/index.rss 5 author date 1h }} | {{rss>http://slashdot.org/index.rss 5 author date 1h }} | ||
Line 513: | Line 467: | ||
{{rss>http://slashdot.org/index.rss 5 author date 1h }} | {{rss>http://slashdot.org/index.rss 5 author date 1h }} | ||
+ | ===== 控制宏 ===== | ||
- | ===== Control Macros ===== | + | 一些语法会影响DokuWiki对页面的解释,而自身不输出任何内容。可用的控制宏如下: |
- | + | ||
- | 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在每次访问时重新解析页面| | ||
+ | ===== 语法插件 ===== | ||
↧
zh:wiki:syntax - 已恢复为旧版 (2015-11-22 19:37)
↧