====== Syntax ======
[[doku>de:DokuWiki|DokuWiki]] is characterised by simple text formatting, among other things. This means that the files containing the content remain easy to read.
The possible formatting types that can be used within the editor are listed in the following sections. Some of the formatting presented here can also be accessed directly via the [[doku>de:toolbar|quick buttons]].
You can find a first example of how the structure of a page can look if you display this page in source code mode. To do this, click on the "Preview" button.
To try out or practise, you can use the [[intern:playground:playground|Playground]] can be used for testing or practising.
====== PC CADDIE as text in the wiki ======
Because we always want to have PC CADDIE in one line in the wiki, we write it as follows: Pcc \\
Please go to EDIT and have a look at it!!! Otherwise you won't see what is meant... :-)
====== 1 Texts ======
===== 1.1 Formatting =====
DokuWiki supports **bold**, //italics//, __underlined__ and ''bold'' ([[wpde>Dickte|Thick]]) text. Of course everything can be **__//''combined''//__** can be combined.
DokuWiki supports **bold**, //italics//, __underlined__ and ''bold'' text.
Of course, everything can also be **__//''combined''//__** can be combined.
There are also deep-set and superscript text.
There are also subscript and superscript text.
Text can be deleted((If you need the tag "inserted" (%%%%) can realise this via plugins. See below!)) can be marked as deleted.
Text can be marked as deleted can be marked as deleted.
===== 1.2 Paragraphs =====
A paragraph is created by an empty line. A new line (line break) can be created by two "backslashes" (backslashes inverted: %%\\%%) followed by a space.
This is an example text with some line breaks.\\ Note: The two backslashes
are only recognised if they are at the end of the line\\
or if they are followed by a\\ followed by a space.\\ This is how\\it looks without spaces.
This is an example text with some line breaks.\\ Note: The two backslashes
are only recognised if they are at the end of the line\\
or if they are followed by a\\ followed by a space.\\ This is how\\it looks without spaces.
Line breaks with two "backslashes" (backslashes inverted: %%\\%%) should only be used if they are absolutely necessary.
===== 1.3 Headings =====
The content of a page can be structured with five different levels, separated by headings.
The headings are framed with a maximum of six "=", depending on their size. H1 is the heading at the highest level. The easiest way to create headings is to use the toolbar. The headings are inserted using the buttons that display an "H".
It is __useful__if there is always a level 1 heading at the beginning of an article.
If there are more than three headings on a page, a table of contents is automatically created which lists all the headings.
If this table of contents is not to be created, the command: ''~~NOTOC~~'' must be included in the page.
====== Heading level 1 ======
===== Heading level 2 =====
==== Heading level 3 ====
=== Heading level 4 ===
== Heading level 5 ==
No further formatting can be carried out within headings by default! (s. [[faq:headerlinks|FAQ - Header links]])
===== 1.4 Unformatted sections =====
To display text as it was written, regardless of whether it contains DokuWiki formatting or other formatting, you can start each line with two spaces (as used in this page) or use one of the identifiers "code" or "file".
line with two spaces (as used in this page) or use one of the identifiers "code" or "file":
Mit "code": In diesem Text werden keine überflüssigen Leerzeichen entfernt: wie hier <-- zwischen
Mit dem Bezeichner "file" kann ein bestimmter Abschnitt als einzelner Bestandteil
auf einer Seite zum Download angeboten werden.
The syntax highlighting described in the section below can also be activated within "file". [[en:wiki:syntax#Syntax-Hervorhebung|syntax highlighting]] described in the section below.
#!/usr/bin/perl
print "Hello World!\n";
#!/usr/bin/perl
print "Hello World!\n";
To disable any conversion by DokuWiki, enclose the corresponding area with "nowiki" identifiers or shorter with double percent signs ''%%''.
This text contains links like: http://www.splitbrain.org and **formatting** but they are not converted and appear as normal text.
%%This text is now marked with %%''%%''%% and has the same effect as "nowiki".
"This text contains links like: http://www.splitbrain.org and **formatting** but they are not converted and appear as normal text."%%
Just look at the source code of this page (press the "Edit" button) to see how these blocks are applied.
===== 1.5 Syntax highlighting =====
[[DokuWiki]] recognises syntax highlighting for source code to increase its readability. For this purpose [[http://qbnz.com/highlighter/|GeSHi]] "**Ge**neric **S**yntax **Hi**ghlighter" is used. This means that every programming language known to GeSHi is supported.
The same identifier is used as in the previous section, except that it now also contains the name of the language:
'' Quelltext
''
/**
* 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 languages are supported: //actionscript, actionscript-french, ada, apache, applescript, asm, asp, bash, caddcl, cadlisp, **c**, c_mac, cpp, csharp, css, **delphi**, diff, d, div, dos, eiffel, freebasic, gml, html4strict, ini, inno, **java**javascript, lisp, lua, matlab, mpasm, nsis, objc, ocaml, ocaml-brief, oobas, oracle8, pascal, perl, php-brief, **php**python, qbasic, scheme, sdlbasic, smarty, **sql**, ruby, vb, vbnet, vhdl, visualfoxpro, **xml**//
===== 1.6 Quote / comment =====
To mark a text as a quote or comment, the "greater than" character is used as follows:
I think we should.
> No, we should not.
>> Yes we should!
> Really?
>> Yes!
>>> Then let's do it!
>>> Comments or quotations can also extend over several lines, as this completely nonsensical text shows. To mark a text as a quote or comment, the "greater than" sign is used as follows
I think we should do it
> No, we shouldn't.
>> Yes we should!
> Really?
>> Yes!
>>> Then let's do it
>>> Comments or quotations can also extend over several lines, as this completely nonsensical text shows. To mark a text as a quote or comment, the "greater than" sign is used as follows
===== 1.7 Escape character =====
If you want to prevent DokuWiki from carrying out any formatting or conversions in the text, you can use the percentage signs
%%[[wiki:testseite|Testseite]]%%
The output would then look like this %%[[wiki:testseite|Test page]]%%
===== 1.8 Footnotes =====
Footnotes ((this is a footnote)) are represented by a double round bracket ((a second footnote)). The text between the brackets is written at the end of the page. The order and thus the numbering is taken over by DokuWiki.
Footnotes ((this is a footnote)) are represented by a double round bracket ((a second footnote))
====== 2 Links ======
Five different types of links can be used with DokuWiki:
===== 2.1 External =====
External links (links to other websites or files) are recognised automatically: http://www.google.com or simply www.google.com.
Links can also be hidden behind your own terms: [[http://www.google.com|hier is google]].
E-mail addresses are placed in angle brackets: .
External links are recognised automatically: http://www.google.com or simply www.google.com.
Links can also be hidden behind your own terms: [[http://www.google.com|hier is google]].
E-mail addresses are placed in angle brackets: .
===== 2.2 Internal =====
Internal links, i.e. links to pages within DokuWiki, are enclosed in double square brackets ("Alt Gr+8" or Alt Gr+9 on Windows or Option+5 and Option+6 on Apple operating systems):
[[doku>pagename]]
A link can also be hidden behind a term or a description:
[[pagename|Description for a link]].
Internal links are placed in double square brackets:
[[pagename]]
A link can also be hidden behind a term or a description:
[[pagename|Description for a link]].
File names for new pages in the wiki are automatically converted to lower case!
Umlauts and special characters are not allowed!
A colon resolves name ranges in the wiki: [[de:namespaces]]
A colon resolves name ranges in the wiki:[[de:namespaces]]
Further information on namespaces: [[doku>de:namespaces]] .
It is also possible to link to a specific section within the document (anchor). The section name is appended to the page name, separated by a double cross (#).
This example links to [[en:wiki:syntax#intern|this section]].
This example links to [[en:wiki:syntax#intern|this section]].
Notes:
* Links to [[syntax|existing pages]] are displayed differently than links to [[nicht-existierenden]] pages.
* DokuWiki does not use [[wpde>CamelCase]] for links by default. However, this can be changed in the settings file: [[doku>config]] . **Note**If the word "DokuWiki" is displayed as a link, then this option is switched on.
* If a heading in the target document changes, the anchor leads to nothing without the link being displayed as faulty.
* Anchors are written in lower case, spaces with underscores and umlauts with their transliteration (ä = ae) are used.
===== 2.3 Interwiki =====
DokuWiki also supports links to other wikis, so-called [[doku>de:interwiki]] links.
A link to the Wikipedia page about wikis:[[wpde>Wiki]]
DokuWiki also supports links to other wikis, so-called [[doku>de:interwiki]] links.
A link to the Wikipedia page about wikis:[[wpde>Wiki]]
===== 2.4 Windows shares =====
DokuWiki also recognises links to Windows shares: [[\\server\freigabe|shared-folder]].
However, this only makes sense in a homogeneous user group (see [[wpde>Intranet]] ).
[[\\server\freigabe|this]].
Note:
* For security reasons, direct navigation through the shares only works with Internet Explorer by default (and only in the "local zone")!
* For Mozilla and Firefox it can be switched on with the option [[http://www.mozilla.org/quality/networking/docs/netprefs.html#file|security.checkloaduri]] option, but this is not recommended! (Further information: [[http://kb.mozillazine.org/Links_to_local_pages_do_not_work|Links to local pages do not work]])
* Opera ignores as a security feature since [[http://www.opera.com/windows/changelogs/754/|Version 7.54]] ignores all links to //file:// in web pages.
* For more information see: [[bug>151]]
===== 2.5 Images as links =====
Images can be used for a link to an internal or external file. To do this, the syntax for displaying links is simply combined with the syntax for displaying images (see below):
[[http://www.php.net|{{wiki:dokuwiki-128.png}}]]
[[http://www.php.net|{{wiki:dokuwiki-128.png}}]]
Please note: Image formatting is the only formatting that can be used in link names!
====== 3 Images and other files ======
===== 3.1 Saving images in DokuWiki =====
To be able to save images in the DokuWiki, the user must have the appropriate authorisation ([[de:acl|ACL]]). At least the authorisation "Upload" is required for uploading and "Delete" for deleting for the namespace [[de:namespaces|namespace]] is required.
===== 3.2 Size of images =====
Both external and internal images can be integrated with curly brackets. [[doku>images|internal images]] can be included. In this example, the image is called "dokuwiki-128.png". Its size can be specified as an option:
Original size: {{wiki:dokuwiki-128.png}}
Specify a width: {{wiki:dokuwiki-128.png?50}}
Specify width and height: {{wiki:dokuwiki-128.png?200x50}}
Specify size for external images: {{http://de3.php.net/images/php.gif?200x50}}
Original size: {{wiki:dokuwiki-128.png}}
Specify a width: {{wiki:dokuwiki-128.png?50}}
Specify width and height: {{wiki:dokuwiki-128.png?200x50}}
Specify size for external images: {{http://de3.php.net/images/php.gif?200x50}}
===== 3.3 Aligning images =====
With spaces to the right and/or left within the brackets, an image can be aligned horizontally (left, centred, right).
{{ wiki:dokuwiki-128.png|Right}}
{{wiki:dokuwiki-128.png |Left}}
{{ wiki:dokuwiki-128.png |Centred}}
{{wiki:dokuwiki-128.png }}
{{ wiki:dokuwiki-128.png }}
{{ wiki:dokuwiki-128.png}}
When aligning and using a title, make sure that the title comes after the space:
{{wiki:dokuwiki-128.png |Left-aligned}}
{{ wiki:dokuwiki-128.png |centred }}
{{ wiki:dokuwiki-128.png|Right-aligned}}
===== 3.4 Tooltips =====
Titles, displayed as tooltips in most browsers, can also be specified.
{{ wiki:dokuwiki-128.png |This is a title}}
{{ wiki:dokuwiki-128.png |This is a title}}
===== 3.5 File download =====
If a file is specified that does not contain an image (''gif, jpeg, png''), it is displayed as a link and offered for download.
{{ wiki:dokuwiki-128.txt |Example}}
{{ wiki:dokuwiki-128.txt |Beispiel}}
===== 3.6 Automatic linking =====
Images are automatically created with a link to your [[wpde>Metadaten]] - e.g: {{wiki:dokuwiki-128.png?15}}
This behaviour can be prevented via the option ?nolink((if necessary, combine with an "&" with other options such as the size specification)). [[tips:image_nolink|this, often undesirable, behaviour]] cannot currently (13.03.2009) be deactivated for the entire DokuWiki)):
{{wiki:dokuwiki-128.png?15&nolink}}
{{wiki:dokuwiki-128.png?15&nolink}}
In addition, ?direct can be used to link directly to the image, e.g. as a full view:
{{wiki:dokuwiki-128.png?15&direct}}
{{wiki:dokuwiki-128.png?15&direct}}
====== 4 Lists ======
DokuWiki recognises unsorted and numbered lists. To create a list entry, start a line with two spaces. These spaces are then followed by a "*" for unsorted lists or a "-" for numbered lists.
* This is an entry in an unsorted list
* A second entry
* Different levels of a list by adding another two spaces
* Another entry
- This is an entry of a numbered list
- A second entry
- Different levels of a list by adding two more spaces
- Another entry
* Dies ist ein Eintrag einer unsortierten Liste
* Ein zweiter Eintrag
* Unterschiedliche Ebenen einer Liste durch Hinzufügen von weiteren zwei Leerzeichen
* Noch ein Eintrag
- Dies ist ein Eintrag einer nummerierte Liste
- Ein zweiter Eintrag
- Unterschiedliche Ebenen einer Liste durch Hinzufügen von weiteren zwei Leerzeichen
- Noch ein Eintrag
====== 5 tables ======
===== 5.1 Basic structure =====
DokuWiki makes it very easy to create tables:
^ highlighted ^ for example for ^ a title line ^
| Line 1 Column 1 | Line 1 Column 2| Line 1 Column 3 |
| Line 2 Column 1 | double column width (note the double vertical line) ||
| Row 3 Column 1 | Row 2 Column 2 | Row 2 Column 3 |
| Row 4 Column 1 | {{wiki:dokuwiki-128.png?400x500}} | Line 4 Column 3 |
Fields in a table start with "|" for a normal field or with a "^" for a highlighted field.
^ highlighted ^ for example for ^ a title line ^
| Line 1 Column 1 | Line 1 Column 2 | Line 1 Column 3 |
| Row 2 Column 1 | double column width (note the double vertical line) ||
| Row 3 Column 1 | Row 2 Column 2 | Row 2 Column 3 |
===== 5.2 Formatting/alignment =====
=== Blank cells ===
Cells across several columns are created if, as shown above, as many "|" or "^" without spaces in between are placed at the end of such a column as there are columns to be bridged.
In short: All rows of a table must have the same number of field separators "|" or "^".
Highlighted fields in vertical alignment are also possible.
| ^ highlighted 1 ^ highlighted 2 ^
^ highlighted 3 | Line 1 Column 2 | Line 1 Column 3 |
^ highlighted 4 | Line 2 Column 2 | |
^ highlighted 5 | Line 3 Column 2 | Line 3 Column 3 |
As we can see, the field separator ("|" or "^") in front of a cell determines its appearance:
| ^ highlighted 1 ^ highlighted 2 ^
^ highlighted 3 | Line 1 Column 2 | Line 1 Column 3 |
^ highlighted 4 | Line 2 Column 2 | |
^ highlighted 5 | Line 3 Column 2 | Line 3 Column 3 |
=== Connect cells ===
Fields over several rows (**vertically connected cells**) can be joined by adding '':::'' in the cell to be joined.
^ Title row 1 ^ Title row 2 ^ Title row 3 ^
| Row 1 Column 1 | This cell is vertically connected | Row 1 Column 3 |
| Row 2 Column 1 | ::: | Row 2 Column 3 |
| Line 3 Column 1 | ::: | Line 3 Column 3 |
Apart from the three colons, the cell to be joined must not have any other content.
^ Title row 1 ^ Title row 2 ^ Title row 3 ^
| Row 1 Column 1 | This cell is vertically connected | Row 1 Column 3 |
| Row 2 Column 1 | ::: | Row 2 Column 3 |
| Line 3 Column 1 | ::: | Line 3 Column 3 |
Fields over several columns (**horizontally connected cells**) can be created by adding ''^'' or ''|'' in the cell to be joined.
^ Title row 1 ^ Title row 2 ^ Title row 3 ^
| Row 1 Column 1 | This cell is connected horizontally ||
| Row 2 Column 1 | Row 2 Column 2 | Row 2 Column 3 |
| Line 3 Column 1 | Line 3 Column 2 | Line 3 Column 3 |
Apart from the three colons, the cell to be joined must not have any other content.
^ Title row 1 ^ Title row 2 ^ Title row 3 ^
| Row 1 Column 1 | This cell is connected horizontally ||
| Row 2 Column 1 | Row 2 Column 2 | Row 2 Column 3 |
| Line 3 Column 1 | Line 3 Column 2 | Line 3 Column 3 |
=== Text alignment ===
The content of a cell can be aligned horizontally within the cell:
* Right-aligned - two spaces to the left of the text
* Left-aligned - spaces to the right of the text
* Centred - two spaces to the left and right of the text
^ Table with alignment ^^^
| Right| Centre |Left centre |
|Left centre | Right centre| Centre |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
This is what the formatting looks like:
^ Table with alignment ^^^
| Right| Centre |Left centre |
|Left centre | Right centre| Centre |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
|Note on the vertical bar character: this character can be reached on a PC keyboard by pressing the "<" bei zusätzlich gedrückter "AltGr"-Taste. Ist dort auch aufgedruckt. Apple-Nutzer erreichen das Zeichen mit der Wahltaste ("Alt") und der "7".|
====== 6 sonstige Formatierungen ======
===== 6.1 horizontale Linie =====
Mit vier aufeinander folgenden Minuszeichen (alleine in einer Zeile) kann eine horizontale Linie erzeugt werden:
----
----
===== 6.2 Smileys =====
DokuWiki verwandelt oft genutzte [[wpde>Emoticon]]s zu kleinen Smiley-Grafiken.
Weitere Smiley-Grafiken können im Ordner "smily" abgelegt und dann in der Datei ''conf/smileys.conf'' bzw. für benutzereigene Smileys unter ''conf/smileys.local.conf'' eingetragen werden.
Hier ist nun eine Übersicht der standardmäßig in DokuWiki enthaltenen Smileys:
^ 8-) ^ 8-O ^ :-( ^ :-) ^ =) ^ :-/ ^ :-\ ^ :-? ^ :-D ^ :-P ^ :-O ^ :-X ^ :-| ^ ;-) ^ :?: ^ :!: ^ ''^_^'' ^ LOL ^ FIXME ^ DELETEME ^
| %% 8-) %% | %% 8-O %% | %% :-( %% | %% :-) %% | %% =) %% | %% :-/ %% | %% :-\ %% | %% :-? %% | %% :-D %% | %% :-P %% | %% :-O %% | %% :-X %% | %% :-| %% | %% ;-) %% | %% :?: %% | %% :!: %% | %% ^_^ %% | %% LOL %% | %% FIXME %% | %% DELETEME %% |
===== 6.3 Typografie =====
[[DokuWiki]] kann einfache Textzeichen in ihre typografischen Entsprechungen umwandeln.
Hier eine Liste aller Zeichen, die DokuWiki kennt:
-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r)
"He thought 'It's a man's world'..."
-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r)
"He thought 'It's a man's world'..."
Bitte beachtet: Diese Umwandlungen können in der Konfigurationsdatei abgestellt werden
===== 6.4 HTML und PHP einbinden =====
In einer Seite kann sowohl HTML als auch PHP direkt benutzt werden.
This is some HTML-Code
This is some HTML-Code
echo 'A logo generated by PHP:';
echo '
';
echo 'A logo generated by PHP:';
echo '
';
**Attention**The inclusion of HTML and PHP in a page can be switched off in the configuration file ((configuration options [[config:htmlok]] or [[config:phpok]] )). If this option is activated, the source code of these sections is displayed as text and not executed.
**Caution**Including HTML and PHP on a page on the Internet is usually a serious security risk! This function is only intended for the intranet!
====== 7 Control macros ======
Some syntax commands influence how Dokuwiki displays a page when it is called up. The following control macros are available:
^ Macro ^ Description ^
| %%~~NOTOC~~%% | If this macro is included in a page, the [[toc|Table of Content]] is not created.|
| %%~~NOCACHE~~%% | All pages are cached for performance reasons. Under certain circumstances, however, this behaviour is not desired. When this macro is inserted, DokuWiki is instructed to rebuild the content of the page. |
----
====== 8 Syntax plugins ======
The syntax of DokuWiki can be extended by [[doku>plugins|plugins]]. How the individual plugins are used can be found on the corresponding description pages. The following plugins are available on this DokuWiki installation:
~~INFO:syntaxplugins~~