This part of instruction is still in English, would be translated into Chinese at a later time.
DokuWiki 支持使用简单、形象、可爱的语法来生成表格。
| 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 |
在源代码中,表格的表头以分“|”开头和结尾,而表头以下的行则用“^”开头和结尾。
^ 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 |
想要合并一行中的某几个单元格(列合并),只要把不想要用的单元格留空即可(如上面的代码所示,不写入包括空格在内的任何字符),注意无论怎么样,每一行的单元格分隔符“|”的数目总是一样的。
同理,我们可以按照下面的例子建立竖排的表头。
| 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 |
仔细观察源代码,你可以很容易发现,决定每个单元格格式的是处于它前面的单元格分隔符,如果它是以“^”开头,那么这个单元格就是表头格式,反之,如果它以“|”开头,就是一个普通格式的单元格。
| ^ 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 |
注意:由于种种不可告人的原因,很遗憾本程序暂时不支持单元格的竖向合并(行合并)。
你也可以对表格中的内容进行对齐排版。操作方法很简单,如果你想让内容居中对齐,就在你所写文字的两边都加两个以上的空格;如果你想让内容右对齐,就在文字的左边加两个空格;同理,只要在文本内容的右边加两个空格,就可以实现左对齐。注意,空格只要是两个以上即可,没有具体的数量规定,比如说在文本的左边加入3个空格,右边加入2个空格,仍然可以实现居中对齐效果。
| Table with alignment | ||
|---|---|---|
| right | center | left |
| left | right | center |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
源代码是这样的写的:
^ Table with alignment ^^^ | right| center |left | |left | right| center | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
你可以在你的文档中插入不会被解析的段落。这可以通过两种方式实现:前面空两个以上的空格(半角的哦)或者使用code或file标签。
这段文字中的空白被完整的保留了下来,象 <-这样
这段具有类似的效果,不过他同时说明了你引用了某段文件。
如果想要解析器完全无视所有标记(比如完全不做任何格式化),就使用nowiki标签把他们包起来,或者更简单的,使用成对儿的%%
这段文字包括url地址http://bitinn.net/和**formatting**,但是什么事情都没发生。
想知道怎么使用这些标签,请查看本页的源代码。
本站使用的DokuWiki 支持源代码高亮(假如你想在吐槽时使用的话). 这个功能使用了 GeSHi Generic Syntax Highlighter -- 所以任何被 GeSHi 支持的语言都是被支持的(显然不包括火星语). 这个标签的使用方法和前一段类似,但是此时你要把你用的语言放进标签里面. 例如. <code java>.
/** * 这是一条可爱的注释,下面的程序会输出一句HelloWorld出来 * The HelloWorldApp class implements an application that * simply displays "Hello World!" to the standard output. */ @Test("不知道作者是不是还生活在1.4的时代") class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); //Display the string. } }
目前系统支持的程序语言如下: abap actionscript-french, actionscript, ada, apache, applescript, asm, asp, autoit, bash, basic4gl, blitzbasic, bnf, caddcl, cadlisp, cfdg, cfm, c_mac, c, cpp, cpp-qt, csharp, css, delphi, diff, div, dos, dot, d, eiffel, fortran, freebasic, genero, gml, groovy, haskell, html, idl, ini, inno, io, java5, java, javascript, latex, lisp, lua, m68k, matlab, mirc, mpasm, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, perl, per, php-brief, php, plsql, python, qbasic, rails, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vbnet, vb, vhdl, visualfoxpro, winbatch, xml, xpp, z80
DokuWiki can integrate data from external XML feeds. For parsing the XML feeds, 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 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. 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.
Example:
{{rss>http://slashdot.org/index.rss 5 author date 1h }}
You can embed raw HTML or PHP code into your documents by using the html or php tags like this:
<html> This is some <span style="color:red;font-size:150%;">inline HTML</span> </html> <HTML> <p style="border:2px dashed red;">And this is some block HTML</p> </HTML>
This is some <span style="color:red;font-size:150%;">inline HTML</span>
<p style="border:2px dashed red;">And this is some block HTML</p>
<php> echo 'A logo generated by PHP:'; echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; echo '(generated inline HTML)'; </php> <PHP> echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; echo '</tr></table>'; </PHP>
echo 'A logo generated by PHP:';
echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />';
echo '(inline HTML)';
echo '<table class="inline"><tr><td>The same, but inside a block level element:</td>'; echo '<td><img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" /></td>'; echo '</tr></table>';
Please Note: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed.
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 |
DokuWiki's syntax can be extended by 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.