Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:syntax [2024/03/31 16:47] andiwiki:syntax [2026/07/26 22:17] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Formatting Syntax ======+###### Formatting Syntax
  
 [[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 "Edit this 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. [[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 "Edit this 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 =====+##### 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.
Line 9: Line 9:
   DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' texts.   DokuWiki supports **bold**, //italic//, __underlined__ and ''monospaced'' texts.
   Of course you can **__//''combine''//__** all these.   Of course you can **__//''combine''//__** all these.
 +
 +Note that the formatting markers have to directly enclose the text, so ''%%** bold **%%'' with spaces inside the markers will not be formatted.
  
 You can use <sub>subscript</sub> and <sup>superscript</sup>, too. You can use <sub>subscript</sub> and <sup>superscript</sup>, too.
Line 27: Line 29:
   two backslashes are only recognized at the end of a line\\   two backslashes are only recognized at the end of a line\\
   or followed by\\ a whitespace \\this happens without it.   or followed by\\ a whitespace \\this happens without it.
- 
  
 You should use forced newlines only if really needed. You should use forced newlines only if really needed.
  
- +##### Links
-===== Links =====+
  
 DokuWiki supports multiple ways of creating links. DokuWiki supports multiple ways of creating links.
  
-==== External ====+#### 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: <andi@splitbrain.org> are recognized, too. 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: <andi@splitbrain.org> are recognized, too.
Line 45: Line 45:
   addresses like this one: <andi@splitbrain.org> are recognized, too.   addresses like this one: <andi@splitbrain.org> are recognized, too.
  
- +#### Internal
-==== Internal ====+
  
 Internal links are created by using square brackets. You can either just give a [[pagename]] or use an additional [[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]].
Line 71: Line 70:
   * When a section's heading is changed, its bookmark changes, too. So don't rely on section linking too much.   * When a section's heading is changed, its bookmark changes, too. So don't rely on section linking too much.
  
- +#### Interwiki
-==== 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]].
Line 79: Line 77:
   For example this is a link to Wikipedia's page about Wikis: [[wp>Wiki]].   For example this is a link to Wikipedia's page about Wikis: [[wp>Wiki]].
  
-==== Windows Shares ====+#### 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. Please note that these only make sense in a homogeneous user group like a corporate [[wp>Intranet]].
Line 88: Line 86:
  
   * For security reasons direct browsing of windows shares only works in Microsoft Internet Explorer per default (and only in the "local zone").   * 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/lang/en/lang.php'' (more details at [[doku>localization#changing_some_localized_texts_and_strings_in_your_installation|localization]]):  +  * 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/lang/en/lang.php'' (more details at [[doku>localization#changing_some_localized_texts_and_strings_in_your_installation|localization]]): <code - conf/lang/en/lang.php>
- +
-<code - conf/lang/en/lang.php>+
 <?php <?php
 /** /**
Line 97: Line 93:
  */  */
 $lang['js']['nosmblinks'] = ''; $lang['js']['nosmblinks'] = '';
- 
 </code> </code>
  
- +#### Image Links
-==== 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: 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:
Line 113: Line 107:
 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). 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 =====+##### 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.
Line 119: Line 113:
   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 =====+##### 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 ''<nowiki>~~NOTOC~~</nowiki>'' in the document. 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 ''<nowiki>~~NOTOC~~</nowiki>'' in the document.
  
-== Headline Level 2 +#### Headline Level 3 
-=== Headline Level 3 +### Headline Level 4 
-==== Headline Level 4 +## Headline Level 5
-===== Headline Level 5+
  
-  == Headline Level 2 +  ==== Headline Level 3 ==== 
-  === Headline Level 3 +  === Headline Level 4 === 
-  ==== Headline Level 4 +  == Headline Level 5 ==
-  ===== Headline Level 5+
  
 By using four or more dashes, you can make a horizontal line: By using four or more dashes, you can make a horizontal line:
Line 137: Line 129:
 ---- ----
  
-===== Media Files =====+##### Media Files
  
 You can include external and internal [[doku>images|images, videos and audio files]] with curly brackets. Optionally you can specify the size of them. You can include external and internal [[doku>images|images, videos and audio files]] with curly brackets. Optionally you can specify the size of them.
Line 166: Line 158:
   {{wiki:dokuwiki-128.png }}   {{wiki:dokuwiki-128.png }}
   {{ wiki:dokuwiki-128.png }}   {{ wiki:dokuwiki-128.png }}
 +
 +You can also set the alignment explicitly with a ''?left'', ''?right'' or ''?center'' parameter. This takes precedence over the whitespace alignment above and can be combined with a size.
 +
 +{{wiki:dokuwiki-128.png?100&right}}
 +
 +  {{wiki:dokuwiki-128.png?100&right}}
  
 Of course, you can add a title (displayed as a tooltip by most browsers), too. Of course, you can add a title (displayed as a tooltip by most browsers), too.
Line 175: Line 173:
 For linking an image to another page see [[#Image Links]] above. For linking an image to another page see [[#Image Links]] above.
  
- +#### Supported Media Formats
-==== Supported Media Formats ====+
  
 DokuWiki can embed the following media formats directly. DokuWiki can embed the following media formats directly.
Line 183: Line 180:
 | Video | ''webm'', ''ogv'', ''mp4'' | | Video | ''webm'', ''ogv'', ''mp4'' |
 | Audio | ''ogg'', ''mp3'', ''wav''  | | Audio | ''ogg'', ''mp3'', ''wav''  |
 +| Flash | ''swf''                    |
  
 If you specify a filename that is not a supported media format, then it will be displayed as a link instead. If you specify a filename that is not a supported media format, then it will be displayed as a link instead.
Line 193: Line 190:
 {{wiki:dokuwiki-128.png?linkonly}} This is just a link to the image. {{wiki:dokuwiki-128.png?linkonly}} This is just a link to the image.
  
- +#### Fallback Formats
-==== Fallback Formats ====+
  
 Unfortunately not all browsers understand all video and audio formats. To mitigate the problem, you can upload your file in different formats for maximum browser compatibility. Unfortunately not all browsers understand all video and audio formats. To mitigate the problem, you can upload your file in different formats for maximum browser compatibility.
Line 206: Line 202:
 Additionally DokuWiki supports a "poster" image which will be shown before the video has started. That image needs to have the same filename as the video and be either a jpg or png file. In the example above a ''video.jpg'' file would work. Additionally DokuWiki supports a "poster" image which will be shown before the video has started. That image needs to have the same filename as the video and be either a jpg or png file. In the example above a ''video.jpg'' file would work.
  
- +##### Lists
-===== 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. 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.
Line 221: Line 216:
   - That's it   - That's it
  
-```+<code>
   * This is a list   * This is a list
   * The second item   * The second item
Line 231: Line 226:
     - Just use indention for deeper levels     - Just use indention for deeper levels
   - That's it   - That's it
-```+</code>
  
 Also take a look at the [[doku>faq:lists|FAQ on list items]]. Also take a look at the [[doku>faq:lists|FAQ on list items]].
  
- +##### Text Conversions
-===== Text Conversions =====+
  
 DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML. DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML.
Line 242: Line 236:
 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. 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 ====+#### 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: 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:
Line 268: Line 262:
   * DELETEME %% DELETEME %%   * DELETEME %% DELETEME %%
  
-==== Text to HTML Conversions ====+#### Text to HTML Conversions
  
 Typography: [[DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters. Typography: [[DokuWiki]] can convert simple text characters to their typographically correct entities. Here is an example of recognized characters.
Line 284: Line 278:
 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]]. 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 =====+##### Quoting
  
 Some times you want to mark some text to show it's a reply or comment. You can use the following syntax: Some times you want to mark some text to show it's a reply or comment. You can use the following syntax:
Line 314: Line 308:
 >>> Then lets do it! >>> Then lets do it!
  
-===== Tables =====+##### Tables
  
 DokuWiki supports a simple syntax to create tables. DokuWiki supports a simple syntax to create tables.
Line 376: Line 370:
 Note: Vertical alignment is not supported. Note: Vertical alignment is not supported.
  
-===== No Formatting =====+##### 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>''. 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>''.
Line 390: Line 384:
   The same is true for %%//__this__ text// with a smiley ;-)%%.   The same is true for %%//__this__ text// with a smiley ;-)%%.
  
-===== Code Blocks =====+##### 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>%%''. 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>%%''.
Line 416: Line 410:
   </file>   </file>
  
-==== Syntax Highlighting ====+#### 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 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>''. [[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>''.
Line 436: Line 430:
 There are additional [[doku>syntax_highlighting|advanced options]] available for syntax highlighting, such as highlighting lines or adding line numbers. There are additional [[doku>syntax_highlighting|advanced options]] available for syntax highlighting, such as highlighting lines or adding line numbers.
  
-==== Downloadable Code Blocks ====+#### Downloadable Code Blocks
  
 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: 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:
Line 452: Line 446:
 If you don't want any highlighting but want a downloadable file, specify a dash (''-'') as the language code: ''%%<code - myfile.foo>%%''. If you don't want any highlighting but want a downloadable file, specify a dash (''-'') as the language code: ''%%<code - myfile.foo>%%''.
  
-===== RSS/ATOM Feed Aggregation =====+##### 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: [[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:
  
Line 475: Line 469:
  
  
-===== Control Macros =====+##### Control Macros
  
 Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble: Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble:
Line 483: Line 477:
 | %%~~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 | | %%~~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
-===== 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: 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:
  • wiki/syntax.1711903646.txt.gz
  • Last modified: 2024/03/31 16:47
  • by andi