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:10] – [列表] haobug | zh-cn:wiki:syntax [2013/05/25 07:02] (current) – [图像链接] bnw.h | ||
---|---|---|---|
Line 44: | Line 44: | ||
[[doku> | [[doku> | ||
- | 您可以通过在页面名中添加冒号的方式来使用[[某目录: | + | 您可以通过在页面名中添加半角英文冒号的方式来使用[[某目录: |
- | 您可以通过在页面名中添加冒号的方式来使用[[某目录: | + | 您可以通过在页面名中添加半角英文冒号的方式来使用[[某目录: |
如果您需要更多有关“命名空间(namespaces)”的详细信息,请参见[[doku> | 如果您需要更多有关“命名空间(namespaces)”的详细信息,请参见[[doku> | ||
Line 80: | Line 80: | ||
==== 图像链接 ==== | ==== 图像链接 ==== | ||
- | 您也可以通过结合链接和[[# | + | 您也可以通过结合[[#链接|链接]]和[[# |
- | [[http:// | + | [[http:// |
- | [[http:// | + | [[http:// |
请注意:图像的格式化语法是链接文本唯一接受的格式化语法。 | 请注意:图像的格式化语法是链接文本唯一接受的格式化语法。 | ||
- | 所有的图像 | + | 所有的图像和语法都是支持的(包括图像大小调整、内部和外部的图像与链接以及维基内链接)。 |
===== 脚注 ===== | ===== 脚注 ===== | ||
Line 114: | Line 113: | ||
===== 图像和其它文件 ===== | ===== 图像和其它文件 ===== | ||
- | 您可以用两个大括号在页面中加入外部或内部的 [[doku> | + | 您可以用两个大括号在页面中加入外部或内部的[[doku> |
实际大小: | 实际大小: | ||
Line 142: | Line 141: | ||
{{ wiki: | {{ wiki: | ||
- | 当然,您也可以指定一个标题(多数浏览器显示为提示文本)。 | + | 当然,您也可以指定图像链接失效时的替换文本。 |
- | {{ wiki: | + | {{ wiki: |
- | {{ wiki: | + | {{ wiki: |
如果您指定的文件名(无论是外部的还是内部的)不是一个图像(gif, | 如果您指定的文件名(无论是外部的还是内部的)不是一个图像(gif, | ||
- | 对于将图像链接到其他页面,参见上面的 [[# | + | 对于将图像链接到其他页面,参见上面的[[# |
===== 列表 ===== | ===== 列表 ===== | ||
Line 180: | Line 179: | ||
请参看下 [[doku> | 请参看下 [[doku> | ||
- | ===== Text Conversions | + | ===== 文本转换 |
- | DokuWiki | + | DokuWiki |
- | The text to image conversion is mainly done for smileys. And the text to HTML conversion is used for typography replacements, | + | 文本转换为图像主要用于表情符号。文本到HTML的转换用于排版的字符替换,但也可以配置为使用其他HTML。 |
- | ==== Text to Image Conversions | + | ==== 文本到图像的转换 |
- | DokuWiki | + | DokuWiki |
* 8-) %% 8-) %% | * 8-) %% 8-) %% | ||
Line 211: | Line 210: | ||
* DELETEME %% DELETEME %% | * DELETEME %% DELETEME %% | ||
- | ==== Text to HTML Conversions | + | ==== 文本到HTML的转换 |
- | Typography: | + | 印刷:[[DokuWiki]] |
-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
- | "He thought | + | "他想 |
< | < | ||
-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) | ||
- | "He thought | + | "他想 |
</ | </ | ||
- | The same can be done to produce any kind of HTML, it just needs to be added to the [[doku> | + | 同样的做法可以产生任何类型的HTML,只需要添加到 |
- | There are three exceptions which do not come from that pattern file: multiplication entity | + | 有三个例外,它们并非来自模式文件:乘法(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: | + | 有时您想将某些文本标记为回复或者评论。您可以使用下列语法: |
- | | + | |
- | + | > 不,我们不应该 | |
- | > No we shouldn' | + | >> |
- | | + | > 真的? |
- | >> | + | >> |
- | | + | >>> |
- | > Really? | + | |
- | | + | |
- | >> | + | |
- | | + | |
- | >>> | + | |
- | I think we should do it | + | 我想我们应该做这件事 |
+ | > 不,我们不应该 | ||
+ | >> 好吧,我说我们应该 | ||
+ | > 真的? | ||
+ | >> 是! | ||
+ | >>> | ||
+ | ===== 表格 ===== | ||
- | > No we shouldn' | + | DokuWiki 支持用简单的语法创建表格。 |
- | >> Well, I say we should | + | ^ 标题 1 ^ 标题 2 ^ 标题 3 ^ |
+ | | 行 1 列 1 | 行 1 列 2 | 行 1 列 3 | | ||
+ | | 行 2 列 1 | 跨列合并(注意两条竖线) || | ||
+ | | 行 3 列 1 | 行 3 列 2 | 行 3 列 3 | | ||
- | > Really? | + | 表格的每一行都以分隔符 | (普通行)或者 ^ (标题行)作为开头和结束。 |
- | >> Yes! | + | ^ 标题 1 ^ 标题 2 ^ 标题 3 ^ |
+ | | 行 1 列 1 | 行 1 列 2 | 行 1 列 3 | | ||
+ | | 行 2 列 1 | 跨列合并(注意两条竖线) || | ||
+ | | 行 3 列 1 | 行 3 列 2 | 行 3 列 3 | | ||
- | >>> | + | 要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符! |
- | ===== Tables ===== | + | 竖直的标题列也是可以实现的: |
- | DokuWiki supports a simple syntax to create tables. | + | | ^ 标题 1 ^ 标题 2 ^ |
+ | ^ 标题 3 | 行 1 列 2 | 行 1 列 3 | | ||
+ | ^ 标题 4 | 没有跨列合并 | | | ||
+ | ^ 标题 5 | 行 2 列 2 | 行 2 列 3 | | ||
- | ^ 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 '' | + | |
+ | ^ 标题 3 | 行 1 列 2 | 行 1 列 3 | | ||
+ | ^ 标题 4 | 没有跨列合并 | | | ||
+ | ^ 标题 5 | 行 2 列 2 | 行 2 列 3 | | ||
- | ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ | + | 跨行合并单元格(垂直合并单元格)也是可以实现的,通过在下面的相邻单元格输入 '':::'' |
- | | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | | + | |
- | | Row 2 Col 1 | some colspan | + | |
- | | Row 3 Col 1 | Row 3 Col 2 | Row 3 Col 3 | | + | |
- | To connect cells horizontally, | + | ^ 标题 1 ^ 标题 2 ^ 标题 3 ^ |
+ | | 行 1 列 1 | 单元格垂直跨行 | 行 1 列 3 | | ||
+ | | 行 2 列 1 | ::: | 行 2 列 3 | | ||
+ | | 行 3 列 1 | ::: | 行 2 列 3 | | ||
- | Vertical tableheaders are possible, too. | + | 跨行合并单元格中不能包含语法外其他任何内容。 |
- | | | + | |
- | ^ Heading 3 | + | | 行 1 列 1 |
- | ^ Heading 4 | + | | 行 2 列 1 |
- | ^ Heading 5 | + | | 行 3 列 1 |
- | As you can see, it's the cell separator before a cell which decides about the formatting: | + | 您也可以设置表格内容的对齐方式。只需在文本的相反方向添加至少两个空格:如果需要右对齐,在左边添加两个空格;反之,则在右边添加。在两边均添加空格可以实现居中对齐。 |
- | | | + | ^ |
- | | + | | 右| 中 |左 |
- | ^ Heading 4 | + | |左 |
- | ^ 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 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 | | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | | ||
- | This is how it looks in the source: | + | 下面是源文件中的样子: |
- | ^ Table with alignment | + | ^ |
- | | right| | + | | 右| 中 |
- | |left | + | |左 |
| 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), | + | 如果您需要文本完全显示为它键入的样子(没有任何格式化), 用 '' |
< | < | ||
- | This is some text which contains addresses like this: http:// | + | 这是一些包含像这样的地址文字:http:// |
</ | </ | ||
- | The same is true for %%//__this__ text// with a smiley ;-)%%. | + | |
+ | 对于带有表情符号的 | ||
< | < | ||
- | | + | |
</ | </ | ||
- | 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 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: | + | 这些区块由下面的源码创建: |
- | | + | |
< | < | ||
- | | + | |
</ | </ | ||
< | < | ||
- | | + | |
</ | </ | ||
- | ==== Syntax Highlighting | + | ==== 语法高亮 |
- | [[wiki: | + | [[wiki: |
<code java> | <code java> | ||
/** | /** | ||
- | | + | * HelloWorldApp |
- | * simply displays | + | |
*/ | */ | ||
class HelloWorldApp { | class HelloWorldApp { | ||
public static void main(String[] args) { | public static void main(String[] args) { | ||
- | System.out.println(" | + | System.out.println(" |
} | } | ||
} | } | ||
</ | </ | ||
- | The following language strings are currently recognized: | + | 下列字符串为当前可以识别语言://4cs, abap, actionscript-french, |
- | ==== Downloadable Code Blocks | + | ==== 可下载的代码块 |
- | When you use the '' | + | 当你使用上面的'' |
< | < | ||
Line 389: | Line 378: | ||
</ | </ | ||
- | If you don't want any highlighting but want a downloadable file, specify a dash ('' | + | 如果您不想要任何高亮,但想要一个可下载的文件,指定破折号('' |
+ | ===== 内嵌 HTML 和 PHP ===== | ||
+ | 您可以嵌入原始HTML或PHP代码到文件中,通过使用 '' | ||
- | ===== Embedding | + | HTML 例子: |
- | + | ||
- | You can embed raw HTML or PHP code into your documents by using the '' | + | |
- | + | ||
- | HTML example: | + | |
< | < | ||
< | < | ||
- | This is some <span style=" | + | 这是一些 |
</ | </ | ||
< | < | ||
- | <p style=" | + | <p style=" |
</ | </ | ||
</ | </ | ||
< | < | ||
- | This is some <span style=" | + | 这是一些 |
</ | </ | ||
< | < | ||
- | <p style=" | + | <p style=" |
</ | </ | ||
- | + | PHP 例子: | |
- | PHP example: | + | |
< | < | ||
<php> | <php> | ||
- | echo 'A logo generated by PHP:'; | + | echo ' |
echo '< | echo '< | ||
- | echo '(generated inline HTML)'; | + | echo '(生成内联 html)'; |
</ | </ | ||
<PHP> | <PHP> | ||
- | echo '< | + | echo '< |
echo '< | echo '< | ||
echo '</ | echo '</ | ||
Line 430: | Line 416: | ||
<php> | <php> | ||
- | echo 'A logo generated by PHP:'; | + | echo ' |
echo '< | echo '< | ||
- | echo '(inline HTML)'; | + | echo '(生成内联 html)'; |
</ | </ | ||
<PHP> | <PHP> | ||
- | echo '< | + | echo '< |
echo '< | 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. | + | **注意**:HTML 和 PHP 在配置中默认是禁用的。如果禁用了,就会显示它们代码,而不会执行它们。 |
+ | |||
+ | ===== RSS/ATOM Feed 聚合 ===== | ||
+ | 所有的能够被SimplePie理解的格式都可以在DokuWiki中使用。您可以通过多个参数来改变渲染,参数之间用空格隔开: | ||
+ | |||
+ | |||
+ | [[DokuWiki]] 能够从外部的XML feed中聚合数据。用[[http:// | ||
- | ===== 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: | + | | 任何数字 | 最多显示多少内容项;默认是8 | |
+ | | reverse | ||
+ | | author | ||
+ | | date | 显示条目日期 | | ||
+ | | description| 显示条目的描述;如果 | ||
+ | | //n//[dhm] | 刷新周期,其中,d=天,h=小时,m=分。例如,12h=12个小时。| | ||
- | ^ Parameter | + | 刷新周期默认是4小时。小于或者等于10分钟均视为10分钟。[[wiki:DokuWiki]] 通常会提供页面的缓存版,显然,这种做法不适用于包含动态外部内容的页面。上面的参数告诉 [[wiki: |
- | | 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> | {{rss> | ||
- | ===== Control Macros | + | ===== 控制宏 |
- | Some syntax influences how DokuWiki | + | 一些语法会影响DokuWiki对页面的解释,而自身不输出任何内容。可用的控制宏如下: |
- | ^ Macro ^ Description | + | ^ 宏 ^ 描述 |
- | | %%~~NOTOC~~%% | + | | %%~~NOTOC~~%% |
- | | %%~~NOCACHE~~%% | DokuWiki | + | | %%~~NOCACHE~~%% | DokuWiki |
- | ===== Syntax Plugins | + | ===== 语法插件 |
- | DokuWiki's syntax can be extended by [[doku> | + | DokuWiki |
~~INFO: | ~~INFO: | ||