wiki:syntax

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 [2023/09/23 16:40] – [Basic Text Formatting] gabriek1wiki:syntax [2023/10/14 23:43] (current) – [Tables] gabriek1
Line 36: Line 36:
  
 You should use forced newlines only if really needed. You should use forced newlines only if really needed.
- 
  
 ===== Links ===== ===== Links =====
Line 70: Line 69:
 </code> </code>
  
-For details about namespaces see [[doku>www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/namespaces|namespaces]].+For details about namespaces see [[doku>www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/namespaces|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 [[:wiki:syntax#internal|this Section]]. Linking to a specific section is possible, too. Just add the section name behind a hash character as known from HTML. This links to [[:wiki:syntax#internal|this Section]].
Line 81: Line 80:
 Notes: Notes:
  
-* Links to [[:wiki:welcome|existing pages]] are shown in a different style from [[:wiki:nonexisting|]] ones. +* Links to [[:wiki:welcome|existing pages]] are shown in a different style from [[:wiki:nonexisting|]] ones. * 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 ====
  
-You can use[[doku>www.dokuwiki.org/Interwiki|Interwiki]] links. These are quick links to other Wikis. For example this is a link to Wikipedia's page about Wikis: [[wp>Wiki]].+You can use[[doku>www.dokuwiki.org/www.dokuwiki.org/Interwiki|Interwiki]] links. These are quick links to other Wikis. For example this is a link to Wikipedia's page about Wikis: [[wp>Wiki]].
 <code> <code>
  
Line 102: Line 100:
 Notes: Notes:
  
-* 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>www.dokuwiki.org/www.dokuwiki.org/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>www.dokuwiki.org/localization#changing_some_localized_texts_and_strings_in_your_installation|localization]]):+
  
 conf/lang/en/lang.php conf/lang/en/lang.php
Line 120: Line 117:
 ==== 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 (see below) like this: 
 <code> <code>
- +{{https://static.independent.co.uk/2023/08/21/18/newFile.jpg?width=400}}
-{{https://static.independent.co.uk/2023/08/21/18/newFile.jpg?width=1200}}+
  
 </code> </code>
  
-{{https://static.independent.co.uk/2023/08/21/18/newFile.jpg?direct&1200|newfile.jpg}}+{{https://static.independent.co.uk/2023/08/21/18/newFile.jpg?width=400}}
  
 Please note: The image formatting is the only formatting syntax accepted in link names. 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). 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 =====
Line 168: Line 166:
 ===== Media Files ===== ===== Media Files =====
  
-You can include external and internal [[doku>www.dokuwiki.org/images|images, videos and audio files]] with curly brackets. Optionally you can specify the size of them.+You can include external and internal images, videos and audio files with curly brackets. Optionally you can specify the size of them.
  
 Real size: {{:wiki:logo.png?200}} Real size: {{:wiki:logo.png?200}}
Line 176: Line 174:
 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:logo.png?200x50}} 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:logo.png?200x50}}
  
-Resized external image: {{https://secure.php.net/images/php.gif?direct&200x50}}+External image: {{https://static.independent.co.uk/2023/08/21/18/newFile.jpg?width=200}}
 <code> <code>
  
Line 182: Line 180:
 Resize to given width:            {{wiki:logo.png?50}} Resize to given width:            {{wiki:logo.png?50}}
 Resize to given width and height: {{wiki:logo.png?200x50}} Resize to given width and height: {{wiki:logo.png?200x50}}
-Resized external image:           {{https://secure.php.net/images/php.gif?200x50}}+External image:           {{https://static.independent.co.uk/2023/08/21/18/newFile.jpg?width=200}}
  
 </code> </code>
Line 229: Line 227:
  
 ---- ----
 +
 +----
 +
 +----
 +
 +----
 +
  
 ==== Supported Media Formats ==== ==== Supported Media Formats ====
Line 265: Line 270:
 You can create 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. You can create 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 +* This is a \list * The second \item * You may have different \levels * Another item
-* The second \item +
-* You may have different \levels +
-* Another item+
  
-- The same list but \ordered +- The same list but \ordered - Another \item - Just use indention for deeper \levels - That's it
-- Another \item +
-- Just use indention for deeper \levels +
-- That's it+
 <code> <code>
  
Line 289: Line 288:
 </code> </code>
  
-Also take a look at the [[doku>www.dokuwiki.org/faq:lists|FAQ on list items]].+Also take a look at the [[doku>www.dokuwiki.org/www.dokuwiki.org/faq:lists|FAQ on list items]].
  
 ===== Text Conversions ===== ===== Text Conversions =====
Line 324: Line 323:
 <code> <code>
  
-I think we should do it +I think we should do it> No we shouldn't
-> No we shouldn't+
  
 >> Well, I say we should >> Well, I say we should
Line 353: Line 351:
 DokuWiki supports a simple syntax to create tables. DokuWiki supports a simple syntax to create tables.
  
-^Heading 1  ^Heading 2  ^Heading 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  |+| 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. Table rows have to start and end with a | for normal rows or a ^ for headers.
Line 370: Line 370:
 Vertical tableheaders are possible, too. 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  |+| 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: As you can see, it's the cell separator before a cell which decides about the formatting:
Line 384: Line 387:
 You can have rowspans (vertically connected cells) by adding ''<nowiki>:::</nowiki>'' into the cells below the one to which they should connect. You can have rowspans (vertically connected cells) by adding ''<nowiki>:::</nowiki>'' into the cells below the one to which they should connect.
  
-^Heading 1  ^Heading 2  ^Heading 3  | | | | | | | | | +^ 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  |+| 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. Apart from the rowspan syntax those cells should not contain anything else.
Line 399: Line 404:
 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. 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  ^^| | | | | | | | | +          Table with alignment           ^^^ 
- right|  center  |left    |left   right|  center    |xxxxxxxxxxxx|xxxxxxxxxxxx|xxxxxxxxxxxx|+        right|    center    |left          | 
 +|left                  right|    center    | 
 +| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
  
 This is how it looks in the source: This is how it looks in the source:
Line 418: Line 425:
 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>''.
  
-<nowiki> This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. </nowiki> +<nowiki> This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. </nowiki> The same is true for <nowiki>//__this__ text// with a smiley ;-)</nowiki>.
-The same is true for <nowiki>//__this__ text// with a smiley ;-)</nowiki>.+
 <code> <code>
  
Line 436: Line 442:
  
 <code> <code>
-This is preformatted code all spaces are preserved: like  <-this\+This is preformatted code all spaces are preserved: like  <-this
  
  
Line 469: Line 475:
 ==== Syntax Highlighting ==== ==== Syntax Highlighting ====
  
-Sourcecode can be highlighted, 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>.+Sourcecode can be highlighted, 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>.
 <code java> <code java>
 /** /**
Line 484: Line 490:
 </code> </code>
  
-There are additional [[doku>www.dokuwiki.org/www.dokuwiki.org/syntax_highlighting|advanced options]] available for syntax highlighting, such as highlighting lines or adding line numbers.+There are additional [[doku>www.dokuwiki.org/www.dokuwiki.org/www.dokuwiki.org/syntax_highlighting|advanced options]] available for syntax highlighting, such as highlighting lines or adding line numbers.
  
 ===== Control Macros ===== ===== Control Macros =====
Line 492: Line 498:
 ^Macro  ^Description|   |<nowiki>~~NOTOC~~ </nowiki>  |If this macro is found on the page, no table of contents will be created|   |<nowiki>~~NOCACHE~~ </nowiki>|The wiki caches all output by default. Sometimes this might not be wanted (eg. when the <nowiki><php></nowiki> syntax above is used), adding this macro will force rerender a page on every call| ^Macro  ^Description|   |<nowiki>~~NOTOC~~ </nowiki>  |If this macro is found on the page, no table of contents will be created|   |<nowiki>~~NOCACHE~~ </nowiki>|The wiki caches all output by default. Sometimes this might not be wanted (eg. when the <nowiki><php></nowiki> syntax above is used), adding this macro will force rerender a page on every call|
  
-===== Syntax Plugins =====+===== Math =====
  
-DokuWiki'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:+There is support for math rendering using TeX syntax. You can use [[https://www.math.brown.edu/johsilve/ReferenceCards/TeXRefCard.v1.5.pdf|this]] reference card when trying to type mathematical expressions.
  
-~~INFO:syntaxplugins~~+You can create inline $f(x) = \frac{1}{2\pi} \int_{-\infty}^{\infty} e^{-\frac{x^2}{2}} dx$ notation 
 +<code> 
 + 
 +You can create inline $f(x) = \frac{1}{2\pi} \int_{-\infty}^{\infty} e^{-\frac{x^2}{2}} dx$ notation 
 + 
 +</code> 
 + 
 +And you can create block $$f(x) = \frac{1}{2\pi} \int_{-\infty}^{\infty} e^{-\frac{x^2}{2}} dx$$ notation. 
 + 
 +<code> 
 +And you can create block $$f(x) = \frac{1}{2\pi} \int_{-\infty}^{\infty} e^{-\frac{x^2}{2}} dx$$ notation. 
 + 
 +</code> 
 + 
 +----
  
 ---- ----