Metainformationen zur Seite
Dies ist eine alte Version des Dokuments!
Syntax
DokuWiki zeichnet sich u. a. durch einfache Textformatierungen aus. Dadurch bleiben die Dateien, die den Inhalt enthalten, gut lesbar. In den nachfolgenden Abschnitten sind die möglichen Formatierungsarten aufgelistet, die innerhalb des Editors verwendet werden können. Einige der hier vorgestellten Formatierungen sind auch direkt über die Quickbuttons erreichbar. Ein erstes Beispiel, wie der Aufbau einer Seite aussehen kann, findest du, wenn du dir diese Seite im Quelltext-Modus anzeigen lässt. Klicke dazu auf den Button "Vorschau".
Zum Ausprobieren oder Üben kann die Spielwiese verwendet werden.
1 Texte
1.1 Formatierungen
DokuWiki unterstützt fetten, kursiven, unterstrichenen und dicktengleichen
(Dickte) Text. Natürlich kann auch alles kombiniert
werden.
DokuWiki unterstützt **fetten**, //kursiven//, __unterstrichenen__ und ''dicktengleichen'' Text. Natürlich kann auch alles **__//''kombiniert''//__** werden.
Ebenso gibt es tiefgestellten und hochgestellten Text.
Ebenso gibt es <sub>tiefgestellten</sub> und <sup>hochgestellten</sup> Text.
Text kann als gelöscht1) markiert werden.
Text kann als <del>gelöscht</del> markiert werden.
1.2 Absätze
Ein Absatz wird durch eine leere Zeile erzeugt. Eine neue Zeile (Zeilenumbruch) kann durch zwei "Backslashes" (umgekehrte Schrägstriche: \\) gefolgt von einem Leerzeichen erzeugt werden.
Dies ist ein Beispieltext mit einigen Zeilenumbrüchen.
Beachte: Die zwei umgekehrten Schrägstriche
werden nur erkannt, wenn sie am Zeilenende stehen
oder wenn ihnen ein
Leerzeichen folgt.
So\\sieht es ohne Leerzeichen aus.
Dies ist ein Beispieltext mit einigen Zeilenumbrüchen.\\ Beachte: Die zwei umgekehrten Schrägstriche werden nur erkannt, wenn sie am Zeilenende stehen\\ oder wenn ihnen ein\\ Leerzeichen folgt.\\ So\\sieht es ohne Leerzeichen aus.
Zeilenumbrüche durch zwei "Backslashes" (umgekehrte Schrägstriche: \\) sollten nur verwendet werden, wenn sie unbedingt notwendig sind.
1.3 Überschriften
Mit fünf unterschiedlichen Ebenen, getrennt durch Überschriften, kann der Inhalt einer Seite strukturiert werden. Die Überschriften werden mit maximal sechs "=" eingerahmt, je nach Größe. H1 ist die Überschrift auf höchster Ebene. Am einfachsten ist es zur Erzeugung der Überschriften, die Symbolleiste zu verwenden. Das Einfügen der Überschriften erfolgt über die Buttons, die ein "H" anzeigen.
Es ist sinnvoll, wenn immer eine Level 1 Überschrift am Anfang eines Artikels steht.
Wenn in einer Seite mehr als drei Überschriften vorkommen, wird automatisch ein Inhaltsverzeichnis erstellt, welches alle Überschriften auflistet.
Soll dieses Inhaltsverzeichnis nicht erstellt werden, muss der Befehl: ~~NOTOC~~
mit in die Seite aufgenommen werden.
====== Überschrift Ebene 1 ====== ===== Überschrift Ebene 2 ===== ==== Überschrift Ebene 3 ==== === Überschrift Ebene 4 === == Überschrift Ebene 5 ==
Innerhalb von Überschriften können standardmäßig keine weiteren Formatierungen vorgenommen werden! (s. FAQ - Headerlinks)
1.4 unformatierte Abschnitte
Um Text so anzuzeigen, wie er geschrieben wurde, egal ob er DokuWiki Formatierungen oder andere Formatierungen enthält, kann man jede Zeile mit zwei Leerzeichen beginnen (so wie es in dieser Seite angewendet wurde) oder einen der Bezeichner "code" bzw. "file" benutzen:
Mit "code": In diesem Text werden keine überflüssigen Leerzeichen entfernt: wie hier <-- zwischen
<file plain Beispiel.txt> Mit dem Bezeichner "file" kann ein bestimmter Abschnitt als einzelner Bestandteil auf einer Seite zum Download angeboten werden. </file>
Innerhalb von "file" ist auch die im Abschnitt weiter unten beschriebene Syntax-Hervorhebung aktivierbar.
- HelloWorld.pl
#!/usr/bin/perl print "Hello World!\n";
<file perl HelloWorld.pl> #!/usr/bin/perl print "Hello World!\n"; </file>
Um jegliche Umwandlung durch DokuWiki abzustellen, umschließe den entsprechenden Bereich mit "nowiki" Bezeichnern oder kürzer mit doppelten Prozentzeichen %%
.
Dieser Text enthält Links wie: http://www.splitbrain.org und **Formatierungen** aber sie werden nicht umgesetzt und erscheinen als normaler Text.
Dieser Text ist nun mit %%
markiert und hat die gleiche Wirkung wie "nowiki".
"Dieser Text enthält links wie: http://www.splitbrain.org und **Formatierungen** aber sie werden nicht umgesetzt und erscheinen als normaler Text."
Einfach den Quelltext dieser Seite anschauen (den Knopf "Edit" drücken) um zu sehen, wie diese Blöcke angewendet werden.
1.5 Syntax-Hervorhebung
DokuWiki kennt Syntax-Highlighting für Quellcode, um dessen Lesbarkeit zu erhöhen. Dafür wird GeSHi "Generic Syntax Highlighter" benutzt. Somit wird jede Programmiersprache unterstützt, die GeSHi kennt.
Es wird der gleiche Bezeichner wie im vorherigen Abschnitt benutzt, nur dass er nun auch den Namen der Sprache enthält:
<code java> Quelltext </code>
/** * 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. } }
Es werden folgende Sprachen unterstützt: 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 Zitat / Kommentar
Um einen Text als Zitat oder Kommentar zu kennzeichnen, wird das "größer als" - Zeichen folgendermaßen verwendet:
Ich denke wir sollten es tun. > Nein, sollten wir nicht. >> Doch! > Wirklich? >> Ja! >>> Dann lass es uns tun! >>> Kommentare oder Zitate können auch über mehrere Zeilen gehen, wie dieser völlig unsinnige Text zeigt. Um einen Text als Zitat oder Kommentar zu kennzeichnen, wird das "größer als"-Zeichen folgendermaßen verwendet
Ich denke wir sollten es tun
Nein, sollten wir nicht.
Doch!
Wirklich?
Ja!
Dann lass es uns tun
Kommentare oder Zitate können auch über mehrere Zeilen gehen, wie dieser völlig unsinnige Text zeigt. Um einen Text als Zitat oder Kommentar zu kennzeichnen, wird das "größer als"-Zeichen folgendermaßen verwendet
1.7 Escapezeichen
Will man verhindern, dass DokuWiki irgendwelche Formatierungen am bzw. Umwandlungen im Text vornimmt so kann man die Prozentzeichen benutzen
%%[[wiki:testseite|Testseite]]%%
Die Ausgabe würde dann folgendermaßen aussehen [[wiki:testseite|Testseite]]
1.8 Fußnoten
Fußnoten 2) werden durch eine doppelte runde Klammer dargestellt 3). Der Text zwischen den Klammern wird an das Ende der Seite geschrieben. Die Reihenfolge und somit die Nummerierung übernimmt DokuWiki.
Fußnoten ((dies ist eine Fußnote)) werden durch eine doppelte runde Klammer dargestellt ((eine zweite Fußnote))
1.9 Linien
Durch vier oder mehr Bindestriche bzw. Minuszeichen "-" wird eine horizontale Linie erzeugt:
2 Links
Mit DokuWiki können fünf unterschiedliche Arten von Links benutzt werden:
2.1 Extern
Externe Links (Verweise auf andere Webseiten oder Dateien) werden automatisch erkannt: http://www.google.com oder einfach www.google.com. Verweise können auch hinter eigenen Begriffen versteckt werden: hier ist google. E-Mail Adressen werden in spitze Klammern gesetzt: andi [at] splitbrain [dot] org.
Externe Links werden automatisch erkannt: http://www.google.com oder einfach www.google.com. Verweise können auch hinter eigenen Begriffen versteckt werden: [[http://www.google.com|hier ist google]]. E-Mail Adressen werden in spitze Klammern gesetzt: <andi@splitbrain.org>.
2.2 Intern
Interne Links, also Verweise auf Seiten innerhalb von DokuWiki, werden in doppelten eckigen Klammern gesetzt ("Alt Gr+8" bzw. Alt Gr+9 unter Windows bzw. Wahltaste+5 und Wahltaste+6 bei Apple-Betriebssystemen): pagename
Ein Link kann auch hinter einem Begriff oder einer Beschreibung versteckt werden: Beschreibung für einen Link.
Interne Links werden in doppelten eckigen Klammern gesetzt: [[pagename]] Ein Link kann auch hinter einem Begriff oder einer Beschreibung versteckt werden: [[pagename|Beschreibung für einen Link]].
Dateinamen für neue Seiten im Wiki werden automatisch in Kleinbuchstaben umgewandelt! Umlaute sind genauso wie Sonderzeichen nicht erlaubt!
Durch einen Doppelpunkt werden Namensbereiche im Wiki aufgelöst: namespaces
Durch einen Doppelpunkt werden Namensbereiche im Wiki aufgelöst:[[de:namespaces]]
Weitere Informationen zu Namensbereichen: de:namespaces.
Die Verlinkung zu einem speziellen Abschnitt innerhalb des Dokuments (Anker) ist auch möglich. Der Abschnittsnamen wird getrennt durch ein Doppelkreuz (#) an den Seitennamen gehängt.
Dieses Beispiel verlinkt zu diesem Abschnitt.
Dieses Beispiel verlinkt zu [[de:wiki:syntax#intern|diesem Abschnitt]].
Anmerkungen:
- Links zu existierenden Seiten werden anders angezeigt als Links zu nicht-existierenden Seiten.
- Ändert sich eine Überschrift im Zieldokument, führt der Anker ins Leere ohne dass der Link dabei als fehlerhaft angezeigt wird.
- Anker werden klein geschrieben, es werden Leerzeichen mit Unterstrichen und Umlaute mit ihren Umschreibungen (ä = ae) verwendet.
2.3 Interwiki
DokuWiki unterstützt auch Links in andere Wikis, sogenannte de:interwiki Links. Ein Link zur Wikipedia Seite über Wikis:Wiki
DokuWiki unterstützt auch Links in andere Wikis, sogenannte [[doku>de:interwiki]] Links. Ein Link zur Wikipedia Seite über Wikis:[[wpde>Wiki]]
2.4 Windows-Freigaben
DokuWiki kennt auch Links auf Windows-Freigaben: freigegebener-Ordner. Dies ist allerdings nur in einer homogenen Benutzergruppe sinnvoll (siehe Intranet).
[[\\server\freigabe|this]].
Hinweis:
- Aus Sicherheitsgründen funktioniert direktes Navigieren durch die Freigaben standardmäßig nur mit dem Internet Explorer (und das nur in der "lokalen Zone")!
- Für Mozilla und Firefox kann es durch die Option security.checkloaduri eingeschaltet werden, was aber nicht empfohlen wird! (Weitere Informationen: Links to local pages do not work)
- Opera ignoriert als Sicherheitsfeature seit Version 7.54 alle Links auf file: in Webseiten.
- Für weitere Informationen siehe: 151
2.5 Bilder als Links
Bilder können für einen Link auf eine interne oder externe Datei verwendet werden. Dazu wird die Syntax zur Anzeige von Links einfach mit der zur Anzeige von Bildern (siehe unten) kombiniert:
[[http://www.php.net|{{wiki:dokuwiki-128.png}}]]
Bitte beachte: Bildformatierungen sind die einzigen Formatierungen, die in Linknamen benutzt werden können!
3 Bilder und andere Dateien
3.1 Bilder im DokuWiki speichern
Um Bilder im DokuWiki speichern zu dürfen, muss der Benutzer die entsprechende Berechtigung besitzen (ACL). Zum Hochladen ist mindestens die Berechtigung "Hochladen" (engl. "Upload"), zum Löschen "Entfernen" (engl. "Delete") für den Namensraum erforderlich.
3.2 Größe von Bildern
Mit geschweiften Klammern können sowohl externe als auch interne Bilder eingebunden werden. Das Bild heißt in diesem Beispiel "dokuwiki-128.png". Optional kann deren Größe angegeben werden:
Größe für externe Bilder vorgeben:
Originalgröße: {{wiki:dokuwiki-128.png}} Eine Breite vorgeben: {{wiki:dokuwiki-128.png?50}} Breite und Höhe vorgeben: {{wiki:dokuwiki-128.png?200x50}} Größe für externe Bilder vorgeben: {{http://de3.php.net/images/php.gif?200x50}}
3.3 Ausrichten von Bildern
Mit Leerzeichen zur Rechten und/oder Linken innerhalb der Klammern kann ein Bild horizontal ausgerichtet werden (Links, Zentriert, Rechts).
{{wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png }} {{ wiki:dokuwiki-128.png}}
Bei Ausrichtung und der Verwendung eines Titels sollte man drauf achten, dass der Titel nach dem Leerzeichen kommt:
{{wiki:dokuwiki-128.png |Linksbündig}} {{ wiki:dokuwiki-128.png |Zentriert }} {{ wiki:dokuwiki-128.png|Rechtsbündig}}
3.4 Tooltips
Auch Titel, in den meisten Browsern als Tooltip angezeigt, können angegeben werden.
{{ wiki:dokuwiki-128.png |Dies ist ein Titel}}
3.5 Dateidownload
Wenn eine Datei angegeben wird, die kein Bild (gif, jpg, png
) ist, so wird sie als Link angezeigt und so zum Download angeboten.
{{ wiki:dokuwiki-128.txt |Beispiel}}
3.6 Automatische Verlinkung
Bilder werden automatisch mit einer Verlinkung zur Ihren Metadaten erstellt - Bsp.:
Dieses Verhalten kann über die Option ?nolink4) unterbunden werden5):
{{wiki:dokuwiki-128.png?15&nolink}}
Außerdem kann mit ?direct das Bild, z.Bsp. als Vollansicht, direkt verlinkt werden:
{{wiki:dokuwiki-128.png?15&direct}}
4 Listen
DokuWiki kennt unsortierte und nummerierte Listen. Um einen Listeneintrag zu erzeugen, beginne eine Zeile mit zwei Leerzeichen. Diesen Leerzeichen folgt dann ein "*" für unsortierte oder ein "-" für nummerierte Listen.
- 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
* 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 Tabellen
5.1 Grundlegender Aufbau
Mit DokuWiki können Tabellen ganz einfach erstellt werden:
hervorgehoben | zum Beispiel für | eine Titelzeile |
---|---|---|
Zeile 1 Spalte 1 | Zeile 1 Spalte 2 | Zeile 1 Spalte 3 |
Zeile 2 Spalte 1 | doppelte Spaltenbreite (beachte den doppelten senkrechten Strich) | |
Zeile 3 Spalte 1 | Zeile 2 Spalte 2 | Zeile 2 Spalte 3 |
Zeile 4 Spalte 1 | Zeile 4 Spalte 3 |
Felder einer Tabelle starten mit "|" für ein normales Feld oder mit einem "^" für hervorgehobenes Feld.
^ hervorgehoben ^ zum Beispiel für ^ eine Titelzeile ^ | Zeile 1 Spalte 1 | Zeile 1 Spalte 2 | Zeile 1 Spalte 3 | | Zeile 2 Spalte 1 | doppelte Spaltenbreite (beachte den doppelten senkrechten Strich) || | Zeile 3 Spalte 1 | Zeile 2 Spalte 2 | Zeile 2 Spalte 3 |
5.2 Formatierung/Ausrichtung
Leerzellen
Zellen über mehrere Spalten werden erzeugt wenn man, wie oben gezeigt, am Ende einer solchen Spalte so viele "|" oder "^" ohne Leerzeichen dazwischen hintereinander setzt, wie Spalten überbrückt werden sollen. Kurz gesagt: Alle Zeilen einer Tabelle müssen die gleiche Anzahl an Feldtrennern "|" oder "^" haben.
Hervorgehobene Felder in Vertikaler Ausrichtung sind auch möglich.
hervorgehoben 1 | hervorgehoben 2 | |
---|---|---|
hervorgehoben 3 | Zeile 1 Spalte 2 | Zeile 1 Spalte 3 |
hervorgehoben 4 | Zeile 2 Spalte 2 | |
hervorgehoben 5 | Zeile 3 Spalte 2 | Zeile 3 Spalte 3 |
Wie wir sehen, entscheidet der Feldtrenner ("|" oder "^") vor einer Zelle über ihr Aussehen:
| ^ hervorgehoben 1 ^ hervorgehoben 2 ^ ^ hervorgehoben 3 | Zeile 1 Spalte 2 | Zeile 1 Spalte 3 | ^ hervorgehoben 4 | Zeile 2 Spalte 2 | | ^ hervorgehoben 5 | Zeile 3 Spalte 2 | Zeile 3 Spalte 3 |
Zellen verbinden
Felder über mehrere Zeilen (vertikal verbundene Zellen) lassen sich durch hinzufügen von :::
in der zu verbindenden Zelle zusammenfügen.
Zum Stand der Release 2015-08-10a "Detritus" können Zellen der ersten Zeile nicht in vertikal verbundene Zellen einbezogen werden.
Titelzeile 1 | Titelzeile 2 | Titelzeile 3 |
---|---|---|
Zeile 1 Spalte 1 | Diese Zelle ist vertikal verbunden | Zeile 1 Spalte 3 |
Zeile 2 Spalte 1 | Zeile 2 Spalte 3 | |
Zeile 3 Spalte 1 | Zeile 3 Spalte 3 |
Außer den drei Doppelpunkten darf die zu verbindende Zelle keine weiteren Inhalte haben.
^ Titelzeile 1 ^ Titelzeile 2 ^ Titelzeile 3 ^ | Zeile 1 Spalte 1 | Diese Zelle ist vertikal verbunden | Zeile 1 Spalte 3 | | Zeile 2 Spalte 1 | ::: | Zeile 2 Spalte 3 | | Zeile 3 Spalte 1 | ::: | Zeile 3 Spalte 3 |
Felder über mehrere Spalten (horizontal verbundene Zellen) lassen sich durch hinzufügen von ^
bzw. |
in der zu verbindenden Zelle zusammenfügen.
Titelzeile 1 | Titelzeile 2 | Titelzeile 3 |
---|---|---|
Zeile 1 Spalte 1 | Diese Zelle ist horizontal verbunden | |
Zeile 2 Spalte 1 | Zeile 2 Spalte 2 | Zeile 2 Spalte 3 |
Zeile 3 Spalte 1 | Zeile 3 Spalte 2 | Zeile 3 Spalte 3 |
^ Titelzeile 1 ^ Titelzeile 2 ^ Titelzeile 3 ^ | Zeile 1 Spalte 1 | Diese Zelle ist horizontal verbunden || | Zeile 2 Spalte 1 | Zeile 2 Spalte 2 | Zeile 2 Spalte 3 | | Zeile 3 Spalte 1 | Zeile 3 Spalte 2 | Zeile 3 Spalte 3 |
Textausrichtung
Der Inhalt einer Zelle kann horizontal innerhalb der Zelle ausgerichtet werden:
- Rechtsbündig - zwei Leerzeichen links vom Text
- Linksbündig - Leerzeichen rechts vom Text
- Zentriert - zwei Leerzeichen links und rechts vom Text
Tabelle mit Ausrichtung | ||
---|---|---|
Rechts | Mitte | Links |
Links | Rechts | Mitte |
xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
So sieht die Formatierung aus:
^ Tabelle mit Ausrichtung ^^^ | Rechts| Mitte |Links | |Links | Rechts| Mitte | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
Hinweis zu dem senkrechten Balken-Zeichen: dieses Zeichen ist auf einer PC-Tastatur erreichbar über die Taste "<" 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 Emoticons 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 |
6.3 Typografie
DokuWiki kann einfache Textzeichen in ihre typografischen Entsprechungen umwandeln. Hier eine Liste aller Zeichen, die DokuWiki kennt:
→ ← ↔ ⇒ ⇐ ⇔ » « – — 640x480 © ™ ® "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
<html> This is some <font color="red" size="+1">HTML-Code</font> </html>
<php> echo 'A logo generated by PHP:'; echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; </php>
<php> echo 'A logo generated by PHP:'; echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="PHP Logo !" />'; </php>
Achtung: Das Einbinden von HTML und PHP in einer Seite kann in der Konfigurationsdatei ausgeschaltet werden6). Ist diese Option aktiviert, wird der Quellcode dieser Abschnitte als Text angezeigt und nicht ausgeführt.
Achtung: Das Einbinden von HTML und PHP auf einer Seite im Internet ist gewöhnlich ein schweres Sicherheitsrisiko! Diese Funktion ist nur für das Intranet gedacht!
7 Kontroll-Makros
Einige Syntax-Befehle beeinflussen wie Dokuwiki eine Seite beim Aufruf ausgibt. Die folgenden Kontroll-Makros sind verfügbar:
Makro | Beschreibung |
---|---|
~~NOTOC~~ | Wenn dieses Makro in eine Seite eingebunden ist, wird das Table of Content nicht erstellt. |
~~NOCACHE~~ | Alle Seiten werden aus Performancegründen zwischengespeichert. Unter bestimmten Umständen ist dieses Verhalten aber nicht gewollt. Beim Einfügen dieses Makros wird DokuWiki angewiesen, den Inhalt der Seite neu aufzubauen. |
8 Syntax-Plugins
Die Syntax von DokuWiki kann durch Plugins erweitert werden. Wie die einzelnen Plugins benutzt werden, findet ihr in den folgenden Kapiteln. Die folgenden Plugins sind auf dieser DokuWiki Installation verfügbar:
Folded Plugin
Full documentation: https://www.dokuwiki.org/plugin:folded
If you want to make additional information available that is hidden by default, you have two options with this plugin:
Inline:
This is example ++text | with some of it only shown when you unfold it++. And after that the text just continues to flow in the same paragraph.
This is example text . And after that the text just continues to flow in the same paragraph.
Block:
This is example text. ++++ Title | | This table | is only shown | when you unfold the block | {{page>some other wiki page&inline}} ++++
Inline | Block | |
---|---|---|
Syntax | ++title| formatted text ++ | ++++title| any content ++++ |
HTML | <span> tag | <div> tag |
Can contain formatting | | |
Can contain block elements7) | — | |
Can be used within a paragraph, table, list, etc. | | — |
You can see in the image below.
Note: As of version 2005-09-02 the syntax has changed to allow linked titles to unfold and fold the section. The pipe char between title and text is mandatory. |
---|
Wrap Plugin
Full documentation: https://www.dokuwiki.org/plugin:wrap
This plugin gives you the ability to wrap wiki text inside containers (divs or spans) and give them
- a certain class (with loads of useful preset classes)
- a width
- a language with its associated text direction
Basic Syntax:
<WRAP classes #id width :language> "big" content </WRAP> **or** <block classes #id width :language> "big" content </block> or <div classes #id width :language> "big" content </div>
An uppercase <WRAP> (or alternatively <block> or <div>) creates a div
and should be used for "big" containers, surrounding paragraphs, lists, tables, etc.
<wrap classes #id width :language>"small" content</wrap> or <inline classes #id width :language>"small" content</inline> or <span classes #id width :language>"small" content</span>
A lowercase <wrap> (or alternatively <inline> or <span>) creates a span
and should be used for "small" containers, inside paragraphs, lists, tables, etc.
Since version 2013-06-13 there is also a shorthand syntax (for wraps without content):
<WRAP classes #id /> or <block classes #id /> or <div classes #id />
and
<wrap classes #id /> or <inline classes #id /> or <span classes #id />
Please note, some things won't work with spans: alignments (including alignments generated by changing the text direction), multi-columns and widths if the according wrap isn't floated as well.
Examples
The plugin comes with an example page, which should explain a lot and looks like this in the default template, see https://demo.selfthinker.org/plugin:wrap
Classes
The following classes are currently available:
class name | description/notes |
---|---|
columns – similar to columns, side_note, styler, tip | |
column | same as left in LTR languages and same as right in RTL languages |
left | same as column , will let you float your container on the left |
right | will let the container float right |
center | will position the container in the horizontal center of the page |
col2 ..col5 | will show the text in multiple columns determined by their amount (2, 3, 4 or 5), only works in modern browsers (no IE9 and below) |
colsmall , colmedium , collarge | will also show the text in multiple columns but determined by their width (small, medium or large), only works in modern browsers (no IE9 and below) |
widths – |
|
half | fits two columns in a row, should be used in pairs |
third | fits three or two columns in a row, should be used in triplets or together with twothirds |
twothirds | fits two columns in a row when used together with third , one 1/3 wide and another 2/3 wide |
quarter | fits four columns in a row, should be used in quads |
alignments – similar to divalign, columns, styler – |
|
leftalign | aligns text on the left |
rightalign | aligns text on the right |
centeralign | centers the text |
justify | justifies the text |
boxes and notes – similar to box, note, tip | |
box | creates a box around the container (uses colours from style.ini ) |
info (was information in first version) | creates a blue box with an info icon |
important | creates an orange box with an important icon |
alert (warning in previous versions) | creates a red box with an alert icon |
tip | creates a yellow box with a tip icon |
help | creates a violet box with a help icon |
todo | creates a cyan box with an todo icon |
download | creates a green box with a download icon |
round | adds rounded corners to any container with a background colour or a border (only works in modern browsers, i.e. no IE) |
danger | creates a red danger safety note |
warning | creates an orange warning safety note |
caution | creates a yellow caution safety note |
notice | creates a blue notice safety note |
safety | creates a green safety note |
marks – similar to emphasis, important_paragraf, importanttext | |
hi | marks text as highlighted |
lo | marks text as less significant |
em | marks text as especially emphasised |
miscellaneous | |
clear | similar to clearfloat, should preferably be used with divs, i.e. uppercase <WRAP> s |
tabs | if wrapped around a list of links, will show those as tabs |
hide | hides the text per CSS (the text will still appear in the source code, in non-modern browsers and is searchable) |
noprint | displays text on the screen, but not in print, similar to noprint |
onlyprint | displays text only in print, but not on the screen |
pagebreak | forces a new page in printouts (not visible on the screen), similar to pagebreak |
nopagebreak | tries to avoid a pagebreak in printouts (not visible on the screen) |
spoiler | shows white text on a white background, only to be revealed by highlighting it; similar to hide |
button | when wrapped around a link, styles it like a button |
tablewidth | sets widths of tables inside to whichever width the wrap gets, partly replaces tablewidth |
indent | indents the text, could be used instead of tab |
outdent | "outdents" the text, could partly be used instead of outdent |
prewrap | wraps text inside pre-formatted code blocks, similar to wpre |
Indexmenu Plugin
Full documentation: https://www.dokuwiki.org/plugin:indexmenu
This plugin allows you to insert a fully customizable index or a list of pages starting from a specified namespace. It should be useful in DokuWiki sites where pages are organized by namespaces. Main features are:
- Fully customizable with a lot of flexible options, but easy to use and configure for standard needs.
- Built-in support of Navigation features like highlighting the current location or dynamically displaying the tree of the current namespace.
- Easily themeable with prebuilt JavaScript themes.
- Assign Namespaces title and link (headpages) to namespaces.
- Sortable by date, title and custom metadata information.
- AJAX support to speed up sites with many pages.
- Customizable context mouse menu for usual namespace/page actions.
- TOC pages preview.
- Replace the DokuWiki page index.
Minimum syntax:
{{indexmenu>.}}
{{indexmenu>:}}
{{indexmenu>|}}
That means this {{indexmenu}}
and this {{indexmenu>}}
do not work.
Basic syntax usage:
Main | Options |
---|---|
{{indexmenu>ns[#n] [ns1[#n] ns2[#n] …] | | [js[#theme]] [tsort] … }} |
Arguments inside []
parenthesis are optional. The #
char is always required with related options.
All the syntax options can be easily accessed with the indexmenu picker in the edit window toolbar.
Full syntax
Settings before the "|" separator:
Main | Action | Note |
---|---|---|
ns | Main namespace name. Index starts from here. Syntax complies with DokuWiki namespaces paths. | "." refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 8) (see the context option for this feature). ".." or an empty value shows the root site namespace. |
#n | n is a number that specifies how many namespace levels to display open under the main namespace. | If it's not defined then the whole tree, till the deeper node, will be open. If 0 or 1 it'll display only nodes under the main namespace. For example: "#2" will display "root:myns1:myns2" but will keep myns2 closed thus hiding "root:myns1:myns2:myns3". Optional. |
ns1[#n] ... nsn[#n] | A list of optional namespaces inside the main namespace. Every namespace will be opened or closed at the specified n level. Syntax complies with DokuWiki namespaces. | If n is not defined then all namespaces are open, if 0 they are closed. "." refers to the namespace of the page containing the indexmenu syntax and not to the current DokuWiki namespace context 9) (see the context option for this feature). ".." or an empty value shows the root site namespace. Optional. |
Optional settings after the "|" separator (separated by spaces):
Option | Action | Note |
---|---|---|
js undo: nojs | JavaScript render method: the index is an expandable tree menu. Without the js option DokuWikis index renderer is used | Without n, all nodes are open, with it, nodes are open till n level. |
#theme undo: #default | Theme name for indexmenu icons | A theme is a set of icons inside images directory as described in Theme tutorial. Admins can download and share themes in admin panel. It works only in js e.g. js#tango |
Next options are available with or without js option. | ||
navbar undo: nonavbar | The tree opens itself automatically at the current page namespace. Useful in a navigation sidebar. | Without js option, the indexmenu page is never cached (just like the default DokuWiki index page) and the DokuWiki loading could be slower depending on the amount of child nodes displayed. |
context undo: nocontext | Relative main namespace and optional namespaces will refer to the current DokuWiki namespace context 10) instead of to the namespace of the page containing the indexmenu syntax. Useful in a navigation sidebar. | The indexmenu page is now never cached so the DokuWiki loading could be slower depending on the amount of child nodes displayed (In js mode, when a lot of nodes are usually displayed, the max option is recommended). It automatically enable the nocookie option. |
tsort undo: notsort | Sort (only) pages by title. | Useful when useheading is on. By default namespaces are not sorted, you need the nsort option for this. |
dsort undo: nodsort | Sort (only) pages by date creation (first the oldest). | By default namespaces are not sorted, you need the nsort option for this. |
msort[#meta] undo: nomsort | Sort (only) pages by a custom metadata information. Without the #meta parameter, i.e. msort , it looks for the custom sorting number specified with the {{indexmenu_n>N}} syntax (see the below metadata tag syntax).With #meta parameter you can refer to the meta data structure (Array values are managed through the ":" separator, for example: msort#date:modified ). | By default, pages without metadata tag are sorted by page name (the default DokuWiki way), but you can override this behaviour adding also the tsort or dsort option in the indexmenu syntax. By default namespaces are not sorted, you need the nsort option for this. |
hsort undo: nohsort | Sort the headpages as defined by config setting startpage to the top | msort overrules hsort |
rsort undo: norsort | Reverse the sorting of pages (change between ascending and descending). | By default namespaces are not sorted, you need the nsort option for this. |
nsort undo: nonsort | Also sort namespaces according to page sort options but grouped separately. | To use in addition to the above sort options. tsort, dsort, msort, hsort apply only for namespaces when using headpages. rsort is applicable always together with nsort. |
nons undo: ns | Exclude namespaces nodes from index. It shows only the pages. | Without js, the closing n namespace option prevents to display nodes below the n namespace level. |
nopg undo: pg | Exclude pages nodes from index. It shows only the namespaces. | All namespace nodes will link to the start pages (as defined by startpage setting) |
skipfile[+|=]/regexp/ | Skip files matching the regexp. | skipfile+/../ skips files defined with this regexp additional to global skip config. skipfile=/../ replace the global skip config with regexp from this syntax. See the global config explanation for some regexp examples. |
skipns[+|=]/regexp/ | Skip namespaces matching the regexp. | Just like skipfile, but namespaces. |
Next options are only available with js option. | ||
max#n[#m] undo: nomax | If initially closed, the node at n level will retrieve all its child nodes through the AJAX mechanism when opened for the first time. Optionally, the nodes after the n level can be retrieved with AJAX every m sublevels instead of in one go. | It affects the server loading and speeds up the loading of pages in DokuWiki with an high amount of pages. It works only in js. Cookie are automatically disabled, just like with nocookie. |
maxjs#n undo: nomaxjs | It sets how many js tree levels to render when page loads. Remaining nodes are rendered (slightly slower) only when they are open by users, by optional namespaces option, by cookies or by navbar option. | Default n is 1 so that it will speed up the page loading, above all with an high amount of pages. It affects only the user-client CPU speed, not the webserver load. It works only in js |
id#[random|ns|number] undo: id#random | Cookie Identifier for a js indexmenu where the previously opened/closed nodes by a user are stored. | Useful when a page is uncached and you like the tree state is stored in cookie. (See nocookie for disabling cookies.) Default the option id#random is active, also when the option is not specified in the syntax. You can apply self a number as unique identifier for your indexmenu ( e.g. id#20 ) or let generate a number unique for requested namespace with id#ns . Read the Js does not remember its previous state section. ATTENTION: ID must be unique for every indexmenu in your DokuWiki site or you'll get strange js behaviors. Tree state storage with cookie only in js |
nocookie undo: cookie | Disable cookies. By default js indexmenu remember selected,open and closed nodes by user during navigation. With this option it doesn't remember them and the tree is blocked to its start status. | Tree state storage with cookie only in js |
noscroll undo: scroll | Disable the JavaScript scrolling feature when it doesn't fit the container width. It could solve visualization problems. | It works only in js |
notoc undo: toc | Disable the TOC-preview feature. | ToC preview only available in js |
nomenu undo: menu | Disable the contextmenu feature. | Context menu only available in js |
Examples
A sample of an indexmenu JS index that could be used inside a navigation sidebar. Its initial status is blocked by the nocookie option, so, when the page is reloaded, it doesn't remember the open and closed nodes by the user.:
{{indexmenu>..#1|js navbar nocookie}}
JS navigation index with "thread" theme where nodes after the third level are retrieved with Ajax every 2 sublevels. Pages are sorted by title and custom sort number:
{{indexmenu>..#1|js#thread navbar max#3#2 tsort msort}}
Standard DokuWiki index showing only pages inside wiki:plugins and lower namespaces (max two levels):
{{indexmenu>:wiki:plugins#2|nons}}
Js tree showing pages and namespaces both sorted by reverse title. For example,if "archive" contains stuff ("news","oldnews",etc) that you need to quickly organize by time, you could create numbered headpages for every namespace (i.e renaming "oldnews" in "news 2006", "news" in "news 2010" and so on) and sort them from new to older:
{{indexmenu>:archive#1|js tsort nsort rsort}}
Standard index showing the tree of the current context 11) opened at the second level .
{{indexmenu>playground#2|context}}
Show all current namespace pages .
{{indexmenu>.:#1|context}}
JS tree showing all (and only) the namespaces of the "private" namespace sorted by date creation. "private" is relative and refers to the private namespace under the page containing the indexmenu syntax.
{{indexmenu>private|js nopg dsort}}
Metadata tag syntax
By default nodes on the same tree level are sorted by name (or by title/date if you use the tsort/dsort syntax), but you can also specify a custom sort number for every page inserting a metadata tag in the pages with this syntax:
{{indexmenu_n>N}}
Where N
is a number.
Then you need to use the "msort" option in your indexmenu tree syntax.
If you have the show_sort
option enabled in the Configuration Manager, a notice is displayed to admins (only) on every page with this metadata tag (the text defaults to "Indexmenu sort number: N").
Examples:
You can change the order of this tree containing a mix of standard and useheading pages:
-Root |_don |_Mirror sessions (headline title of the ":mirror" page) |_pachuco |_At the radar station (headline title of the ":radar" page) |_van |_vliet
in this way:
{{indexmenu>..#1|msort}}
-Root |_vliet {{indexmenu_n>1}} |_van {{indexmenu_n>2}} |_don {{indexmenu_n>3}} |_Mirror sessions (headline title of the ":mirror" page) |_pachuco |_At the radar station (headline title of the ":radar" page)
Pages without sort number, like the last three pages, are sorted by page name as default, but you can force a different sort:
{{indexmenu>..#1|tsort msort}}
-Root |_vliet {{indexmenu_n>1}} |_van {{indexmenu_n>2}} |_don {{indexmenu_n>3}} |_At the radar station (headline title of the ":radar" page) |_Mirror sessions (headline title of the ":mirror" page) |_pachuco