====== 基本语法 ====== DokuWiki支持一些简单的标记语言, 以尽可能使文档看上去更友好。本页面包含了您在编辑页面时所有可能用到的语法的说明。如果需要查看本页源码,只需要点击页面顶部或者底部的//编辑本页//按钮。 ===== 基本文本格式 ===== DokuWiki支持**粗体**,//斜体//,__下划线__以及''等宽体''等格式。当然,您也可以**__//''混合使用''//__**所有这些格式。 DokuWiki支持**粗体**,//斜体//,__下划线__以及''等宽体''等格式。 当然,您也可以**__//''混合使用''//__**所有这些格式。 也可以使用下标上标。 也可以使用下标上标。 您也可以使用删除线标记某些信息。 您也可以使用删除线标记某些信息。 **段落**是由空行所建立的。如果您想**强制建立新行**而不建立段落,您可以使用两个连续的反斜杠+空格或是回车作为标记。请看样例: 这是一些有着换行标记的文字。\\ 请注意 反斜杠只在回车符之前\\ 或者在\\ 一个空格之前的时候才有效。\\而这样就并不起作用。 这是一些有着换行标记的文字。\\ 请注意 反斜杠只在回车符之前\\ 或者在\\ 一个空格之前的时候才有效。\\而这样就并不起作用。 请仅在必须的时候使用强制换行标记。 ===== 链接 ===== DokuWiki 持多种形式的链接。 ==== 外部链接 ==== 外部链接会被自动地识别:http://www.google.com或者简单地写作www.google.com-您也可以设置链接文本:[[http://www.google.com|链接到google]]。类似这样的电子邮件地址:也可以被识别。 DokuWiki支持多种形式的链接。外部链接会被自动地识别: http://www.google.com或者简单地写作www.google.com -您也可以设置链接文本:[[http://www.google.com|链接到google]]。 类似这样的电子邮件地址:也可以被识别。 ==== 内部链接 ==== 内部链接可以用方括号创建。您可以只给出链接的地址:[[doku>pagename]],或使用额外的链接文本:[[doku>pagename|我的链接]]。 内部链接可以用方括号创建。您可以只给出链接的地址:[[pagename]], 或使用额外的链接文本:[[pagename|我的链接]]。 Wiki的页面名字将会被自动地转换为小写字母,并且不允许使用特殊字符。 您可以通过在页面名中使用冒号的方式来使用[[some:namespaces|命名空间]]。 您可以通过在页面名中使用冒号的方式来使用[[some:namespaces|命名空间]]。 如果您需要关于**命名空间(namespaces)**的更详细的信息,请参见[[doku>namespaces]]。 链接到一个特定章节也是可能的。只需要在#号后面加上章节的名称。这是一个指向[[syntax#内部链接|本节]]的链接。 这是一个指向[[syntax#内部链接|本节]]的链接。 注: * 到[[syntax|已存在页面]]的链接和到[[wiki:nonexisting|未存在页面]]的链接,其外观是不同的。 * 默认情况下,DokuWiki不使用[[wp>CamelCase]]来自动建立链接((CamelCase类似于PmWiki中的WikiWord))。但这一行为可以在[[doku>config|配置文件]]中激活。提示:如果DokuWiki显示为链接,说明已激活。 * 当一节的标题改变时,它的书签也会改变。因此,请不要过于依赖章节链接。 ==== Wiki间链接 ==== DokuWiki支持[[doku>interwiki|Wiki间链接]]。它们是到其他wiki的快速链接。例如,这是一个到Wikipedia上关于Wiki的页面的链接:[[wp>Wiki]] DokuWiki支持[[doku>interwiki|Wiki间链接]]。它们是到其他wiki的快速链接。 例如,这是一个到Wikipedia上关于Wiki的页面的链接:[[wp>Wiki]] ==== Windows共享文件夹 ==== 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知识库]]中提到的不同解决方法启用。 ==== 图像链接 ==== 您也可以通过结合链接和[[#图像和其它文件|图像]](见下文)的语法,用图像来链接到一个内部或者外部的页面。如下所示: [[http://www.php.net|{{wiki:dokuwiki-128.png}}]] [[http://www.php.net|{{wiki:dokuwiki-128.png}}]] 请注意:图像的格式化语法是链接文本唯一接受的格式化语法。 所有的图像和链接语法都是支持的(包括图像大小调整、内部和外部的图像与链接以及wiki内链接)。 ===== 脚注 ===== 您可以使用两个连续小括号来添加脚注((这是一个脚注))。 您可以使用两个连续小括号来添加脚注((这是一个脚注))。 ===== 分节 ===== 您可以使用多达5层的标题来组织您的内容。如果您使用了三个以上的标题,将自动生成目录——这可以通过在页面加入''~~NOTOC~~''字样来禁用。 ==== H3标题 ==== === H4标题 === == H5标题 == ==== H3标题 ==== === H4标题 === == H5标题 == 您可以通过4个以上连续的“-”号来创建一条水平分割线: ---- ===== 图像和其它文件 ===== 您可以用两个大括号在页面中加入外部或内部的[[doku>images|图像]]。您还可以指定它们的大小。 原始大小: {{wiki:dokuwiki-128.png}} 指定宽度: {{wiki:dokuwiki-128.png?50}} 指定宽度和高度((当指定的长宽比与图像的不一致,在调整图像大小前,其将先被裁剪到新的比例)): {{wiki:dokuwiki-128.png?200x50}} 重新指定宽度和高度的外部图像: {{http://de3.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}} 通过使用左空格或右空格,您可以选择对齐方式。 {{ wiki:dokuwiki-128.png}} {{wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png}} {{wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png }} 当然,您也可以指定一个标题(多数浏览器显示为提示文本((鼠标悬停可以看到)))。 {{ wiki:dokuwiki-128.png |这是标题}} {{ wiki:dokuwiki-128.png |这是标题}} 如果您指定的文件名(无论是外部的还是内部的)不是一个图像(''gif,jpeg,png''),那么它将被显示为一个链接。 对于将图像链接到其他页面,参见上面的[[#图像链接]]。 ===== 列表 ===== DokuWiki支持带编号或不带编号的列表。要创建列表,在文字前加入两个空格,然后使用''*''标记不带编号的列表,用''-''标记带编号的列表。 * 这是一个列表 * 第二项 * 您可以有不同的层次 * 另一项 - 带编号的列表 - 另一项 - 用缩进表示更深的层 - 就这样 * 这是一个列表 * 第二项 * 您可以有不同的层次 * 另一项 - 带编号的列表 - 另一项 - 用缩进表示更深的层 - 就这样 ===== 文本转换 ===== DokuWiki可以将预定义的字符或者字符串转换成图像、其他文本或HTML。 文本转换为图像主要用于表情符号。文本到HTML的转换用于排版的字符替换,但也可以配置为使用其他HTML。 ==== 文本到图像的转换 ==== DokuWiki会将一些常用的 [[wp>emoticon|表情符号]]转换为相应图像。这些[[doku>Smileys|表情符号]]和其他图像可以被配置和扩展。这是DokuWiki中包含的表情符号的概况: * 8-) %% 8-) %% * 8-O %% 8-O %% * :-( %% :-( %% * :-) %% :-) %% * =) %% =) %% * :-/ %% :-/ %% * :-\ %% :-\ %% * :-? %% :-? %% * :-D %% :-D %% * :-P %% :-P %% * :-O %% :-O %% * :-X %% :-X %% * :-| %% :-| %% * ;-) %% ;-) %% * ^_^ %% ^_^ %% * :?: %% :?: %% * :!: %% :!: %% * LOL %% LOL %% * FIXME %% FIXME %% * DELETEME %% DELETEME %% ==== 文本到HTML的转换 ==== 印刷:[[wiki:DokuWiki]]可以将特定字符转换为印刷时所用的样式。这是可识别的字符示例。 -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) "He thought 'It's a man's world'..." -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) "He thought 'It's a man's world'..." 同样的做法可以产生任何类型的HTML,只需要添加到[[doku>entities|模式文件]] 这里有三个例外,它们并非来自模式文件:乘法(640x480)、'单引号'和"双引号"。它们可以通过[[doku>config:typography|配置选项]]关闭。 ===== 引用 ===== 有时您想将某些文本标记为回复或者评论。您可以使用下列语法: 我想我们应该做这件事 > 不,我们不应该 >> 好吧,我说我们应该 > 真的? >> 是! >>> 那来做吧! 我想我们应该做这件事 > 不,我们不应该 >> 好吧,我说我们应该 > 真的? >> 是! >>> 那来做吧! ===== 表格 ===== DokuWiki支持用简单的语法创建表格。 ^ 标题1 ^ 标题2 ^ 标题3 ^ | (1,1) | (1,2) | (1,3) | | (2,1) | 一些跨列合并(注意两条竖线) || | (3,1) | (3,2) | (3,3) | 表格的每一行都以分隔符 ''|'' (普通行)或者 ''^'' (标题行)作为开头和结束。 ^ 标题1 ^ 标题2 ^ 标题3 ^ | (1,1) | (1,2) | (1,3) | | (2,1) | 一些跨列合并(注意两条竖线) || | (3,1) | (3,2) | (3,3) | 要水平合并单元格,只需要将后一个单元格设置为空即可,如上面演示的一样。请确保每一行有相同数量的单元格分隔符! 竖直的标题列也是可以实现的: | ^ 标题1 ^ 标题2 ^ ^ 标题3 | (1,2) | (1,3) | ^ 标题4 | 不再合并单元格 | | ^ 标题5 | (2,2) | (2,3) | 可以看到,单元格前面的分隔符决定了单元格的格式。 | ^ 标题1 ^ 标题2 ^ ^ 标题3 | (1,2) | (1,3) | ^ 标题4 | 不再合并单元格 | | ^ 标题5 | (2,2) | (2,3) | 跨行合并单元格(垂直合并单元格)也是可以实现的,通过在下面的相邻单元格输入'':::''可以把两个相邻行的单元格合并。 ^ 标题1 ^ 标题 2 ^ 标题 3 ^ |(1,1)| 对该单元垂直合并 |(1,3)| |(2,1)| ::: |(2,3)| |(3,1)| ::: |(2,3)| 除跨行合并语法外,单元格中不能包含其他任何内容。 ^ 标题1 ^ 标题 2 ^ 标题 3 ^ |(1,1)| 对该单元垂直合并 |(1,3)| |(2,1)| ::: |(2,3)| |(3,1)| ::: |(2,3)| 您可以对齐表格的文字。只需在文本的相反方向添加至少两个空格:如果需要右对齐,在左边添加两个空格;反之,则在右边添加。在两边均添加空格可以实现居中对齐。 ^ 有对齐的表格 ^^^ | 右对齐| 居中 |左对齐 | |左对齐 | 右对齐| 居中 | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | 下面是源文件中的样子: ^ 有对齐的表格 ^^^ | 右对齐| 居中 |左对齐 | |左对齐 | 右对齐| 居中 | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | 注意:不支持垂直对齐。 ===== 无格式化 ===== 如果您需要文本完全显示为它键入的样子(没有任何格式化),用''%%%%''标签包围这个区域,或更简单地用两个百分号''%%''。 这是一些包含这样的地址:http://www.splitbrain.org,以及**格式**的文字,但它没有被解析。 对于带有表情符号的%%;-)的//__这段__文本//%%也一样。 这是一些包含这样的地址:http://www.splitbrain.org,以及**格式**的文字,但它没有被解析。 对于带有表情符号的%%;-)的//__这段__文本//%%也一样。 ===== 代码块 ===== 您可以将代码块包含到文档中,可以通过缩进两个空格(像前面例子中所用的)或者使用标签''%%%%''或''%%%%''。 这是缩进了两个空格的文本。 这是预格式化的代码,所有空格都被保留:像 <-这样 这非常相似,但您可以用它来表明您引用了一个文件。 这些区块由下面的源码创建: 这是缩进了两个空格的文本。 这是预格式化的代码,所有空格都被保留:像 <-这样 这非常相似,但您可以用它来表明您引用了一个文件。 ==== 语法高亮 ==== [[wiki:DokuWiki]] 可以高亮源代码,使它更容易阅读。它使用[[http://qbnz.com/highlighter/|GeSHi]]通用语法高亮器——因此支持任何GeSHi所支持的语言。语法和前面章节中代码与文件块的一样,但这时所用语言的名称被放入标签中。例如''''或者''''。 /** * The HelloWorldApp class implements an application that * simply displays "Hello World!" to the standard output. */ class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); //Display the string. } } 当前可以识别下列语言字符串://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// ==== 可下载的代码块 ==== 当您使用上面的''%%%%''或''%%%%''语法,您或许希望让显示的代码也可以被下载。您可以通过在语言代码后面指定一个文件名来实现: 如果您不想要任何高亮,但想要一个可下载的文件,指定破折号(''-'')作为语言代码:''%%%%''。 ===== 嵌入HTML和PHP ===== 您可以嵌入原始HTML或PHP代码到文件中,通过使用''%%%%''或''%%%%''标签。(如果您需要包围区块级别的元素,使用大写字母的标签。) HTML例子: 这是一些行内HTML

这是一些区块HTML

这是一些行内HTML

这是一些区块HTML

PHP例子: echo 'PHP生成的标志:'; echo 'PHP标志!'; echo '(生成行内HTML)'; echo ''; echo ''; echo '
同样,不过是区块级别的元素:PHP标志!
';
echo 'PHP生成的标志:'; echo 'PHP标志!'; echo '(生成行内HTML)'; echo ''; echo ''; echo '
同样,不过是区块级别的元素:PHP标志!
';
**请注意**:HTML和PHP嵌入默认在配置中被禁用。如果禁用,代码被显示出来而不是执行。 ===== RSS/ATOM Feed聚合===== [[wiki:DokuWiki]]能够从外部的XML feed中聚合数据。为了解析这些XML feed,使用了[[http://simplepie.org/|SimplePie]]。所有的能够被SimplePie理解的格式都可以在DokuWiki中使用。您可以通过多个参数来改变渲染,参数之间用空格隔开: ^ 参数 ^ 描述 ^ | any number | 最多显示多少内容项;默认是8 | | reverse | 将最新条目显示在前面 | | author | 显示条目的作者名 | | date | 显示条目数据 | | description| 显示条目的描述;如果[[doku>config:htmlok|HTML]]被禁用,所有的标签将被过滤掉 | | //n//[dhm] | 刷新周期,其中,d=天数,h=小时数,m=分。例如,12h=12个小时。 | 刷新周期默认是4小时。小于或者等于10分钟均视为10分钟。[[wiki:DokuWiki]]通常会提供页面的缓存版,显然,这种做法不适用于包含动态外部内容的页面。上面的参数告诉[[wiki:DokuWiki]],如果离上次重新解释的时间已经超出了//刷新周期//,则重新解释页面。 **范例:** {{rss>http://slashdot.org/index.rss 5 author date 1h }} {{rss>http://slashdot.org/index.rss 5 author date 1h }} ===== 控制宏 ===== 一些语法会影响DokuWiki对页面的解释,而自身不输出任何内容。可用的控制宏如下: ^ 宏 ^ 描述| | %%~~NOTOC~~%% | 如果页面出现该控制宏,将不会创建目录| | %%~~NOCACHE~~%% | DokuWiki默认会缓存所有的输出。有时并不希望这样(例如,当使用了上面的%%%%语法),增加这个控制宏将强制DokuWiki在每次访问时重新解析页面| ===== 语法插件 ===== DokuWiki的语法可以通过[[doku>plugins|插件]]来扩充。如何使用已安装的插件在它们的描述页中有说明。本DokuWiki可用的语法插件如下: ~~INFO:syntaxplugins~~ ===== 翻译者 ===== [[http://zhoucaiqi.com|caii]]、[[jiayq84@gmail.com|jiayq84]]、[[lainme993@gmail.com|lainme]] [[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 the //Edit this page// button at the top or bottom of the 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 supports **bold**, //italic//, __underlined__ and ''monospaced'' texts. Of course you can **__//''combine''//__** all these. DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' texts. Of course you can **__//''combine''//__** all these. You can use subscript and superscript, too. You can use subscript and superscript, too. You can mark something as deleted as well. You can mark something as deleted 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. ===== Links ===== DokuWiki supports multiple ways of creating links. ==== External ==== 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: are recognized, too. 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: are recognized, too. ==== Internal ==== Internal links are created by using square brackets. You can either just give a [[wiki:pagename]] or use an additional [[wiki:pagename|link text]]. 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. You can use [[some:namespaces]] by using a colon in the pagename. For details about namespaces see [[doku>namespaces]]. 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]]. Notes: * Links to [[syntax|existing pages]] are shown in a different style from [[wiki: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. ==== Interwiki ==== 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]]. 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 ==== 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]]. Windows Shares like [[\\server\share|this]] are recognized, too. 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 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/local.protected.php'': $lang['js']['nosmblinks'] = ''; ==== 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://www.php.net|{{wiki:dokuwiki-128.png}}]] [[http://www.php.net|{{wiki:dokuwiki-128.png}}]] Please note: The image formatting is the only formatting syntax accepted in link names. 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 ===== 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 ''~~NOTOC~~'' in the document. ==== Headline Level 3 ==== === Headline Level 4 === == Headline Level 5 == ==== Headline Level 3 ==== === Headline Level 4 === == Headline Level 5 == By using four or more dashes, you can make a horizontal line: ---- ===== Images and Other Files ===== You can include external and internal [[doku>images]] with curly brackets. Optionally you can specify the size of them. Real size: {{wiki:dokuwiki-128.png}} Resize to given width: {{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}} Resized external image: {{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: {{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 }} {{ wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png}} {{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 |This is the caption}} {{ wiki:dokuwiki-128.png |This is the caption}} If you specify a filename (external or internal) that is not an image (''gif, jpeg, png''), then it will be displayed as a link instead. For linking an image to another page see [[#Image Links]] above. ===== 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 * 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 Also take a look at the [[doku>faq:lists|FAQ on list items]]. ===== Text Conversions ===== DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML. 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-O %% 8-O %% * :-( %% :-( %% * :-) %% :-) %% * =) %% =) %% * :-/ %% :-/ %% * :-\ %% :-\ %% * :-? %% :-? %% * :-D %% :-D %% * :-P %% :-P %% * :-O %% :-O %% * :-X %% :-X %% * :-| %% :-| %% * ;-) %% ;-) %% * ^_^ %% ^_^ %% * :?: %% :?: %% * :!: %% :!: %% * LOL %% LOL %% * FIXME %% FIXME %% * DELETEME %% DELETEME %% ==== Text to HTML Conversions ==== Typography: [[wiki:DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters. -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) "He thought 'It's a man's world'..." -> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) "He thought 'It's a man's world'..." The same can be done to produce any kind of HTML, it just needs to be added to the [[doku>entities|pattern file]]. 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: I think we should do it > No we shouldn't >> Well, I say we should > Really? >> Yes! >>> Then lets do it! 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. ^ 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 ''|'' for normal rows or a ''^'' for headers. ^ 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, 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 ^ ^ 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 '':::'' into the cells below the one to which they should connect. ^ 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 ^^^ | right| center |left | |left | right| center | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | This is how it looks in the source: ^ Table with alignment ^^^ | right| center |left | |left | right| center | | 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 ''%%%%'' tags or even simpler, with double percent signs ''%%''. This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. The same is true for %%//__this__ text// with a smiley ;-)%%. This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. 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 ''%%%%'' or ''%%%%''. 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: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 is the same like in the code and file blocks in the previous section, but this time the name of the used language is inserted inside the tag. Eg. '''' or ''''. /** * The HelloWorldApp class implements an application that * simply displays "Hello World!" to the standard output. */ class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); //Display the string. } } The following language strings are currently recognized: //4cs, abap, actionscript-french, actionscript, actionscript3, ada, apache, applescript, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, ecmascript, eiffel, email, erlang, fo, fortran, freebasic, fsharp, gambas, genero, genie, gdb, glsl, gml, gnuplot, groovy, gettext, gwbasic, haskell, hicest, hq9plus, html, icon, idl, ini, inno, intercal, io, j, java5, java, javascript, jquery, kixtart, klonec, klonecpp, latex, lisp, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, modula2, modula3, mmix, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle8, oracle11, oxygene, oz, pascal, pcre, perl, perl6, per, pf, php-brief, php, pike, pic16, pixelbender, plsql, postgresql, povray, powerbuilder, powershell, progress, prolog, properties, providex, purebasic, 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, vala, vbnet, vb, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, winbatch, whois, xbasic, xml, xorg_conf, xpp, z80// ==== Downloadable Code Blocks ==== When you use the ''%%%%'' or ''%%%%'' syntax as above, you might want to make the shown code available for download as well. You can to this by specifying a file name after language code like this: If you don't want any highlighting but want a downloadable file, specify a dash (''-'') as the language code: ''%%%%''. ===== Embedding HTML and PHP ===== You can embed raw HTML or PHP code into your documents by using the ''%%%%'' or ''%%%%'' tags. (Use uppercase tags if you need to enclose block level elements.) HTML example: This is some inline HTML

And this is some block HTML

This is some inline HTML

And this is some block HTML

PHP example: echo 'A logo generated by PHP:'; echo 'PHP Logo !'; echo '(generated inline HTML)'; echo ''; echo ''; echo '
The same, but inside a block level element:PHP Logo !
';
echo 'A logo generated by PHP:'; echo 'PHP Logo !'; echo '(inline HTML)'; echo ''; echo ''; echo '
The same, but inside a block level element:PHP Logo !
';
**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 ===== [[wiki: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 | | //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. **Example:** {{rss>http://slashdot.org/index.rss 5 author date 1h }} {{rss>http://slashdot.org/index.rss 5 author date 1h }} ===== 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 %%%% 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~~