1====== Formatting Syntax ====== 2 3[[wiki: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>wiki:quickbuttons|quickbuttons]], too. 4 5===== Basic text formatting ===== 6 7DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' texts. Of course you can **__//''combine''//__** all these. 8 9 DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' texts. 10 Of course you can **__//''combine''//__** all these. 11 12You can use <sub>subscript</sub> and <sup>superscript</sup>, too. 13 14 You can use <sub>subscript</sub> and <sup>superscript</sup>, too. 15 16You can mark something as <del>deleted</del> as well. 17 18 You can mark something as <del>deleted</del> as well. 19 20**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. 21 22This is some text with some linebreaks\\ Note that the 23two backslashes are only recognized at the end of a line\\ 24or followed by\\ a whitespace \\this happens without it. 25 26 This is some text with some linebreaks\\ Note that the 27 two backslashes are only recognized at the end of a line\\ 28 or followed by\\ a whitespace \\this happens without it. 29 30You should use forced newlines only if really needed. 31 32===== Links ===== 33 34DokuWiki supports multiple ways of creating links. 35 36==== External ==== 37 38External links are recognized automagically: http://www.google.com or simply www.google.com - You can set Linknames, too: [[http://www.google.com|This Link points to google]]. Email addresses like this one: <andi@splitbrain.org> are recognized, too. 39 40 DokuWiki supports multiple ways of creating links. External links are recognized 41 automagically: http://www.google.com or simply www.google.com - You can set 42 Linknames, too: [[http://www.google.com|This Link points to google]]. Email 43 addresses like this one: <andi@splitbrain.org> are recognized, too. 44 45==== Internal ==== 46 47Internal links are created by using square brackets. You can either just give a [[doku>wiki:pagename]] or use an additional [[doku>wiki:pagename|Title Text]]. Wiki pagenames are converted to lowercase automatically, special characters are not allowed. 48 49 Internal links are created by using square brackets. You can either just give 50 a [[pagename]] or use an additional [[pagename|Title Text]]. Wiki pagenames 51 are converted to lowercase automatically, special chars are not allowed. 52 53You can use [[wiki:namespaces]] by using a colon in the pagename. 54 55 You can use [[wiki:namespaces]] by using a colon in the pagename. 56 57For details about namespaces see [[doku>wiki:namespaces]]. 58 59Linking 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]]. 60 61 This links to [[syntax#internal|this Section]]. 62 63Notes: 64 65 * Links to [[wiki:syntax|existing pages]] are shown in a different style from [[wiki:nonexisting]] ones. 66 * DokuWiki does not use [[wp>CamelCase]] to automatically create links by default, but this behaviour can be enabled in the [[doku>wiki:config]] file. Hint: If DokuWiki is a link, then it's enabled. 67 * When a section's heading is changed, its bookmark changes, too. So don't rely on section linking too much. 68 69==== Interwiki ==== 70 71DokuWiki supports [[doku>wiki:interwiki|Interwiki]] links. These are quick links to other Wikis. For example this is a link to Wikipedia's page about Wikis: [[wp>Wiki]]. 72 73 DokuWiki supports [[doku>wiki:interwiki|Interwiki]] links. These are quick links to other Wikis. 74 For example this is a link to Wikipedia's page about Wikis: [[wp>Wiki]]. 75 76 77==== Windows Shares ==== 78 79Windows shares like [[\\server\share|this]] are recognized, too. Please note that these only make sense in a homogenous user group like a corporate [[wp>Intranet]]. 80 81 Windows Shares like [[\\server\share|this]] are recognized, too. 82 83Notes: 84 85 * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone"). 86 * For Mozilla and Firefox it can be enabled through the config option [[http://www.mozilla.org/quality/networking/docs/netprefs.html#file|security.checkloaduri]] but this is not recommended. 87 * See [[dokubug>151]] for more info. 88 89==== Image Links ==== 90 91You 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: 92 93 [[http://www.php.net|{{wiki:dokuwiki-128.png}}]] 94 95[[http://www.php.net|{{wiki:dokuwiki-128.png}}]] 96 97Please note: The image formatting is the only formatting syntax accepted in link names. 98 99The whole [[#images_and_other_files|image]] and [[#links|link]] syntax is supported (including image resizing, internal and external images and URLs and interwiki links). 100 101===== Footnotes ===== 102 103You can add footnotes ((This is a footnote)) by using double parentheses. 104 105 You can add footnotes ((This is a footnote)) by using double parentheses. 106 107===== Sectioning ===== 108 109You 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 ''<nowiki>~~NOTOC~~</nowiki>'' in the document. 110 111==== Headline Level 3 ==== 112=== Headline Level 4 === 113== Headline Level 5 == 114 115 ==== Headline Level 3 ==== 116 === Headline Level 4 === 117 == Headline Level 5 == 118 119By using four or more dashes, you can make a horizontal line: 120 121---- 122 123===== Images and other files ===== 124 125You can include external and internal [[doku>wiki:images]] with curly brackets. Optionally you can specify the size of them. 126 127Real size: {{wiki:dokuwiki-128.png}} 128 129Resize to given width: {{wiki:dokuwiki-128.png?50}} 130 131Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}} 132 133Resized external image: {{http://de3.php.net/images/php.gif?200x50}} 134 135 Real size: {{wiki:dokuwiki-128.png}} 136 Resize to given width: {{wiki:dokuwiki-128.png?50}} 137 Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}} 138 Resized external image: {{http://de3.php.net/images/php.gif?200x50}} 139 140 141By using left or right whitespaces you can choose the alignment. 142 143{{ wiki:dokuwiki-128.png}} 144 145{{wiki:dokuwiki-128.png }} 146 147{{ wiki:dokuwiki-128.png }} 148 149 {{ wiki:dokuwiki-128.png}} 150 {{wiki:dokuwiki-128.png }} 151 {{ wiki:dokuwiki-128.png }} 152 153Of course, you can add a title (displayed as a tooltip by most browsers), too. 154 155{{ wiki:dokuwiki-128.png |This is the caption}} 156 157 {{ wiki:dokuwiki-128.png |This is the caption}} 158 159If you specify a filename (external or internal) that is not an image (''gif, jpeg, png''), then it will be displayed as a link instead. 160 161For linking an image to another page see [[#Image Links]] above. 162 163===== Lists ===== 164 165Dokuwiki 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. 166 167 * This is a list 168 * The second item 169 * You may have different levels 170 * Another item 171 172 - The same list but ordered 173 - Another item 174 - Just use indention for deeper levels 175 - That's it 176 177<code> 178 * This is a list 179 * The second item 180 * You may have different levels 181 * Another item 182 183 - The same list but ordered 184 - Another item 185 - Just use indention for deeper levels 186 - That's it 187</code> 188 189===== Smileys ===== 190 191DokuWiki converts commonly used [[wp>emoticon]]s to their graphical equivalents. More smileys can be placed in the ''smiley'' directory and configured in the ''conf/smileys.conf'' file. Here is an overview of Smileys included in DokuWiki. 192 193 * 8-) %% 8-) %% 194 * 8-O %% 8-O %% 195 * :-( %% :-( %% 196 * :-) %% :-) %% 197 * =) %% =) %% 198 * :-/ %% :-/ %% 199 * :-\ %% :-\ %% 200 * :-? %% :-? %% 201 * :-D %% :-D %% 202 * :-P %% :-P %% 203 * :-O %% :-O %% 204 * :-X %% :-X %% 205 * :-| %% :-| %% 206 * ;-) %% ;-) %% 207 * ^_^ %% ^_^ %% 208 * :?: %% :?: %% 209 * :!: %% :!: %% 210 * LOL %% LOL %% 211 * FIXME %% FIXME %% 212 * DELETEME %% DELETEME %% 213 214===== Typography ===== 215 216[[DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters. 217 218-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) 219"He thought 'It's a man's world'..." 220 221<code> 222-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) 223"He thought 'It's a man's world'..." 224</code> 225 226Please note: These conversions can be turned off through a [[doku>wiki:config#typography|config option]] and a [[doku>wiki:entities|pattern file]]. 227 228===== Quoting ===== 229 230Some times you want to mark some text to show it's a reply or comment. You can use the following syntax: 231 232 I think we should do it 233 234 > No we shouldn't 235 236 >> Well, I say we should 237 238 > Really? 239 240 >> Yes! 241 242 >>> Then lets do it! 243 244I think we should do it 245 246> No we shouldn't 247 248>> Well, I say we should 249 250> Really? 251 252>> Yes! 253 254>>> Then lets do it! 255 256===== Tables ===== 257 258DokuWiki supports a simple syntax to create tables. 259 260^ Heading 1 ^ Heading 2 ^ Heading 3 ^ 261| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | 262| Row 2 Col 1 | some colspan (note the double pipe) || 263| Row 3 Col 1 | Row 2 Col 2 | Row 2 Col 3 | 264 265Table rows have to start and end with a ''|'' for normal rows or a ''^'' for headers. 266 267 ^ Heading 1 ^ Heading 2 ^ Heading 3 ^ 268 | Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 | 269 | Row 2 Col 1 | some colspan (note the double pipe) || 270 | Row 3 Col 1 | Row 2 Col 2 | Row 2 Col 3 | 271 272To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators! 273 274Vertical tableheaders are possible, too. 275 276| ^ Heading 1 ^ Heading 2 ^ 277^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | 278^ Heading 4 | no colspan this time | | 279^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | 280 281As you can see, it's the cell separator before a cell which decides about the formatting: 282 283 | ^ Heading 1 ^ Heading 2 ^ 284 ^ Heading 3 | Row 1 Col 2 | Row 1 Col 3 | 285 ^ Heading 4 | no colspan this time | | 286 ^ Heading 5 | Row 2 Col 2 | Row 2 Col 3 | 287 288Note: Vertical spans (rowspan) are not possible. 289 290You 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. 291 292^ Table with alignment ^^^ 293| right| center |left | 294|left | right| center | 295| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | 296 297This is how it looks in the source: 298 299 ^ Table with alignment ^^^ 300 | right| center |left | 301 |left | right| center | 302 | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | 303 304===== Non-parsed Blocks ===== 305 306You can include non-parsed 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''. 307 308<code> 309This is preformatted code all spaces are preserved: like <-this 310</code> 311 312<file> 313This is pretty much the same, but you could use it to show that you quoted a file. 314</file> 315 316To let the parser ignore an area completely (ie. do no formatting on it), enclose the area either with ''nowiki'' tags or even simpler, with double percent signs ''<nowiki>%%</nowiki>''. 317 318<nowiki> 319This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. 320</nowiki> 321 322See the source of this page to see how to use these blocks. 323 324 325 326===== Syntax Highlighting ===== 327 328[[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 block in the previous section, but this time the name of the used language is inserted inside the tag. Eg. ''<nowiki><code java></nowiki>''. 329 330<code java> 331/** 332 * The HelloWorldApp class implements an application that 333 * simply displays "Hello World!" to the standard output. 334 */ 335class HelloWorldApp { 336 public static void main(String[] args) { 337 System.out.println("Hello World!"); //Display the string. 338 } 339} 340</code> 341 342The following language strings are currently recognized: //actionscript-french, actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, caddcl, cadlisp, cfdg, cfm, c_mac, c, cpp, cpp-qt, csharp, css, delphi, diff, div, dos, d, eiffel, fortran, freebasic, gml, groovy, html, idl, ini, inno, io, java5, java, javascript, latex, lisp, lua, matlab, mirc, mpasm, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, perl, php-brief, php, plsql, python, qbasic, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vbnet, vb, vhdl, visualfoxpro, winbatch, xml// 343 344===== Embedding HTML and PHP ===== 345 346You can embed raw HTML or PHP code into your documents by using the ''html'' or ''php'' tags like this: 347<code> 348<html> 349This is some <font color="red" size="+1">HTML</font> 350</html> 351</code> 352 353<html> 354This is some <font color="red" size="+1">HTML</font> 355</html> 356 357<code> 358<php> 359echo 'A logo generated by PHP:'; 360echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; 361</php> 362</code> 363 364<php> 365echo 'A logo generated by PHP:'; 366echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; 367</php> 368 369**Please Note**: HTML and PHP embedding is disabled by default in the configuration. If disabled, the code is displayed instead of executed. 370 371===== Syntax Plugins ===== 372 373DokuWiki's syntax can be extended by [[doku>wiki: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: 374 375~~INFO:syntaxplugins~~