DokuWiki поддерживает язык разметки, который по возможности сохраняет файлы данных как можно более читабельными! Здесь перечислены все возможные синтаксические конструкции, которые можно использовать при редактировании страниц. Просто посмотрите на исходный код этой страницы, нажав кнопку Отредактировать страницу вверху или внизу страницы. Если хотите поупражняться, используйте песочницу. Простую разметку также можно легко сделать с помощью панели инструментов
DokuWiki поддерживает выделение текста жирным шрифтом, курсивом, подчеркнутый текст и вывод текста моноширинным шрифтом. Все эти конструкции можно объединить.
DokuWiki поддерживает выделение текста **жирным шрифтом**, //курсивом//, __подчеркниванием текста__ и вывод текста ''моноширинным шрифтом''. Все эти конструкции можно **__//''объединить''//__**.
Также можно использовать подстрочный и надстрочный индексы.
Также можно использовать <sub>подстрочный</sub> и <sup>надстрочный</sup> индексы.
Ещё можно зачеркнуть текст.
Ещё можно <del>зачеркнуть текст</del>.
Параграфы отбиваются пустой строкой. Если нужно принудительно вставить перенос строки, не создавая параграф, вставьте два обратных слэша и за ним пробел или энтер.
Просто текст с разрывом строк
Обратите внимание,
что два обратных слэша действуют только в конце строки
или если за ними стоит
пробел. Если его не поставить, \\получится вот так.
Просто текст с разрывом строк\\ Обратите внимание, что два обратных слэша действуют только в конце строки\\ или если за ними стоит\\ пробел. Если его не поставить, \\получится вот так.
Принудительные переносы следует использовать только в случае крайней необходимости.
Ссылки в DokuWiki бывают разные, и создавать их можно тоже по-разному.
Внешние ссылки распознаются автоматически: http://www.google.com или
просто www.google.com — также можно указывать текст ссылки:
Это ссылка на Google. Адреса электронной почты
тоже распознаются: andi@splitbrain.org.
Внешние ссылки распознаются автоматически: http://www.google.com или просто www.google.com --- также можно указывать текст ссылки: [[http://www.google.com|Это ссылка на Google]]. Адреса электронной почты тоже распознаются: <andi@splitbrain.org>.
Внутренние ссылки создаются посредством квадратных скобок. Можно либо просто указать Имя страницы, либо дополнительно прописать Текст ссылки. Имена Wiki-страниц автоматически переводятся в нижний регистр, спецсимволы использовать нельзя.
Внутренние ссылки создаются посредством квадратных скобок. Можно либо просто указать [[Имя страницы]], либо дополнительно прописать [[Имя страницы|Текст ссылки]]. Имена Wiki-страниц автоматически переводятся в нижний регистр, спецсимволы использовать нельзя.
Можно использовать в ссылке namespaces (пространство имён) через двоеточие.
Можно использовать в ссылке [[namespaces]] (пространство имён) через двоеточие.
Ставить ссылки на определённый раздел тоже можно. Просто добавьте через решётку имя раздела, также как это делается в HTML. Ссылка на этот раздел.
Ссылка на [[syntax#внутренние|этот раздел]].
Примечания:
DokuWiki поддерживает InterWiki-ссылки. Это короткие ссылки на другие Wiki. Например, вот ссылка на страницу Википедии о Wiki: Wiki.
Например, вот ссылка на страницу Википедии о Wiki: [[wp>Wiki]].
Ссылки на сетевые ресурсы вида \\server\share тоже распознаются. Однако учтите, что такие ссылки имеют смысл только в гомогенных группах пользователей, например в корпоративном Интранете.
Ссылки на виндовые шары вида \\server\share тоже распознаются.
Примечания:
Совместив синтаксис ссылки и картинки, можно вставить в текст картинку, которая будет внутренней или внешней ссылкой:
[[http://www.php.net|{{dokuwiki-128.png}}]]
Учтите: форматирование картинок это единственная синтаксическая конструкция, которую можно использовать в тексте ссылки.
С помощью двойных скобок можно добавить сноску2).
С помощью двойных скобок можно добавить сноску ((Это сноска)).
Для структурирования текста можно использовать до пяти уровней заголовков. Если в тексте больше трёх заголовков 3-го уровня и выше, автоматически создаётся список содержимого. Его можно отключить, вставив в документ строку ~~NOTOC~~.
==== Заголовок 3-го уровня ==== === Заголовок 4-го уровня === == Заголовок 5-го уровня ==
Четыре и более тире преобразуются в горизонтальную черту:
----
С помощью фигурных скобок можно вставлять в текст внешние и внутренние картинки. По желанию можно указать их размер.
Отмасштабированная до заданной ширины:
Отмасштабированная до заданных размеров:
Отмасштабированная внешняя картинка:
Нормальный размер: {{dokuwiki-128.png}}
Отмасштабированная до заданной ширины: {{dokuwiki-128.png?50}}
Отмасштабированная до заданных размеров: {{dokuwiki-128.png?200x50}}
Отмасштабированная внешняя картинка: {{http://de3.php.net/images/php.gif?200x50}}
Поставив слева или справа пробел можно задать выравнивание картинки:
{{dokuwiki-128.png }}
{{ dokuwiki-128.png}}
{{ dokuwiki-128.png }}
И, конечно, картинке можно задать название (в большинстве браузеров оно отображается в виде всплывающей подсказки).
{{ dokuwiki-128.png |Название картинки}}
Если задать имя файла (внутреннее или внешнее), который не является картинкой (gif, jpeg, png), оно будет отображаться в виде ссылки.
Dokuwiki поддерживает нумерованные и ненумерованные списки. Чтобы создать элемент списка, поставьте в начале строки два пробела и потом * в случае ненумерованного списка, или - в случае нумерованного.
* Это список
* Второй элемент списка
* Можно сделать вложенный список
* Ещё один элемент
- Тот же список, только нумерованный
- Ещё элемент
- Чем больше пробелов в начале, тем глубже вложенность
- Всё просто
DokuWiki преобразует наиболее употребляемые смайлики в их графические эквиваленты. Дополнительные смайлики можно положить в директорию smiley и внести изменения в файл conf/smileys.conf. Вот смайлики, которые есть в DokuWiki:
DokuWiki может переделывать символы, набранные простым текстом, в их типографски корректные эквиваленты. Распознаются следующие символы.
→ ← ↔ ⇒ ⇐ ⇔ » « – — '640×480' © ™ ®
«Владимир Владимирович™ — это наше всё © не я»
-> <- <-> => <= <=> >> << -- --- '640x480' (c) (tm) (r) "Владимир Владимирович(tm) --- это наше всё (c) не я"
Примечание: Это конвертирование можно отключить в файле конфигурации.
Примечание 2: Если потребуется вставить двойные кавычки (" или "), например как знак дюйма , можно их экранировать
%%:
%%"%% или ''%%"%%''
Иногда нужно пометить некоторый текст в качестве ответа или комментария. Для этого можно использовать следующий синтаксис:
Я думаю, мы должны это сделать. > Нет, мы не должны. >> Ну, я говорю, что мы должны. > Действительно? >> Да! >>> Тогда сделаем это!
Я думаю, мы должны это сделать.
Нет, мы не должны.Ну, я говорю, что мы должны.Действительно?
Да!Тогда сделаем это!
DokuWiki поддерживает упрощённый синтаксис создания таблиц.
| Заголовок 1 | Заголовок 2 | Заголовок 3 |
|---|---|---|
| Ряд 1 Колонка 1 | Ряд 1 Колонка 2 | Ряд 1 Колонка 3 |
| Ряд 2 Колонка 1 | Объединение колонок (обратите внимание на двойную вертикальную черту) | |
| Ряд 3 Колонка 1 | Ряд 2 Колонка 2 | Ряд 2 Колонка 3 |
Нормальные ряды должны начинаться и заканчиваться символом |, а заголовки — ^.
^ Заголовок 1 ^ Заголовок 2 ^ Заголовок 3 ^ | Ряд 1 Колонка 1 | Ряд 1 Колонка 2 | Ряд 1 Колонка 3 | | Ряд 2 Колонка 1 | Объединение колонок (обратите внимание на двойную вертикальную черту) || | Ряд 3 Колонка 1 | Ряд 2 Колонка 2 | Ряд 2 Колонка 3 |
Чтобы объединить две соседние клетки в ряду, просто оставьте соседнюю клетку полностью пустой, как показано выше. Следите, чтобы количество разделителей клеток было одинаковым!
Вертикальные заголовки тоже можно сделать.
| Заголовок 1 | Заголовок 2 | |
|---|---|---|
| Заголовок 3 | Ряд 1 Колонка 2 | Ряд 1 Колонка 3 |
| Заголовок 4 | Объединения нет | |
| Заголовок 5 | Ряд 2 Колонка 2 | Ряд 2 Колонка 3 |
Как легко увидеть, разделитель стоящий перед клеткой определяет форматирование:
| ^ Заголовок 1 ^ Заголовок 2 ^ ^ Заголовок 3 | Ряд 1 Колонка 2 | Ряд 1 Колонка 3 | ^ Заголовок 4 | Объединения нет | | ^ Заголовок 5 | Ряд 2 Колонка 2 | Ряд 2 Колонка 3 |
Можно сделать вертикально объединённые ячейки добавлением трёх двоеточий ::: в объединяемые нижележащие ячейки.
| Заголовок 1 | Заголовок 2 | Заголовок 3 |
|---|---|---|
| Ряд 1 Колонка 1 | эта ячейка объединена вертикально | Ряд 1 Колонка 3 |
| Ряд 2 Колонка 1 | Ряд 2 Колонка 3 | |
| Ряд 3 Колонка 1 | Ряд 2 Колонка 3 |
В этих ячейках не должно быть ничего, кроме синтаксиса объединения (:::).
^ Заголовок 1 ^ Заголовок 2 ^ Заголовок 3 ^ | Ряд 1 Колонка 1 | эта ячейка объединена вертикально | Ряд 1 Колонка 3 | | Ряд 2 Колонка 1 | ::: | Ряд 2 Колонка 3 | | Ряд 3 Колонка 1 | ::: | Ряд 2 Колонка 3 |
Текст клетки таблицы можно выравнивать. Просто добавьте минимум два пробела с противоположной стороны: слева — если надо выравнять вправо, справа – если надо выравнять влево, и по два с каждой стороны — если по центру.
| Таблица с выравниванием | ||
|---|---|---|
| вправо | по центру | влево |
| влево | вправо | по центру |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
^ Таблица с выравниванием ^^^ | вправо| по центру |влево | |влево | вправо| по центру | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
Неформатируемые блоки можно вставлять в документ, либо начиная каждую строчку блока с двух или более пробелов (как это делалось в некоторых предыдущих примерах), либо используя тэги <code> или <file>. При этом пробелы в начале строки являются эквивалентом применения тега <code> к одной строке, но без подсветки кода. Если несколько подряд идущих строк начинаются более чем с одного пробела, они объединяются в один блок <code>.
Пример использования <code>..</code>.
Это неформатированный текст, в котором сохранены все пробелы: вот <- так.
Пример использования <file>..</file>.
В принципе то же самое, но этим выделением можно показать, что цитируется содержимое файла.
Чтобы парсер полностью проигнорировал некий текст (т.е. не форматировал его), либо заключите его в тэги <nowiki>, либо ещё проще — в двойные знаки процента %%.
Это просто текст, в котором есть адрес http://www.splitbrain.org и **форматирование** — но ничего не происходит.
Это просто текст, в котором есть адрес %%http://www.splitbrain.org%% и %%**форматирование**%% --- но ничего не происходит.
Чтобы увидеть, как используются эти блоки, смотрите код страницы.
DokuWiki может подсвечивать <hi>программный код</hi>, чтобы его было проще читать. Для этого используется библиотека GeSHi — соответственно подсвечиваются все языки, поддерживаемые GeSHi. Синтаксис такой же, как и в блоке code в предыдущем разделе, но на этот раз внутри тэга добавляется название языка. Например <code java>.
<hi>текст</hi>
/** * 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. } }
На данный момент распознаются следующие языки:
~~COL:7~~
, 4cs , **a**bap , actionscript-french , actionscript , actionscript3 , ada , apache , applescript , asm , asp , autoconf , autohotkey , autoit , avisynth , awk , **b**ash , basic4gl , bf , bibtex , blitzbasic , bnf , boo , **c** , c_mac , caddcl , cadlisp , cfdg , cfm , chaiscript , cil , clojure , cmake , cobol , cpp , cpp-qt , csharp , css , cuesheet , **d** , dcs , delphi , diff , div , dos , dot , **e**cmascript , eiffel , email , erlang , **f**o , fortran , freebasic , fsharp , **g**ambas , genero , genie , gdb , glsl , gml , gnuplot , groovy , gettext , gwbasic , **h**askell , hicest , hq9plus , html , **i**con , idl , ini , inno , intercal , io , **j** , java5 , java , javascript , jquery , **k**ixtart , klonec , klonecpp , **l**atex , lisp , locobasic , logtalk , lolcode , lotusformulas , lotusscript , lscript , lsl2 , lua , **m**68k , magiksf , make , mapbasic , matlab , mirc , modula2 , modula3 , mmix , mpasm , mxml , mysql , **n**ewlisp , nsis , **o**beron2 , objc , ocaml-brief , ocaml , oobas , oracle8 , oracle11 , oxygene , oz , **p**ascal , pcre , perl , perl6 , per , pf , php-brief , php , pike , pic16 , pixelbender , plsql , postgresql , povray , powerbuilder , powershell , progress , prolog , properties , providex , purebasic , python , **q** , qbasic , **r**ails , rebol , reg , robots , rpmspec , rsplus , ruby , **s**as , scala , scheme , scilab , sdlbasic , smalltalk , smarty , sql , systemverilog , **t**cl , teraterm , text , thinbasic , tsql , typoscript , **u**nicon , **v**ala , vbnet , vb , verilog , vhdl , vim , visualfoxpro , visualprolog , **w**hitespace , winbatch , whois , **x**basic , xml , xorg_conf , xpp , **z**80
Используя тэги <code> или <file>, как показано выше, вы можете сделать отображаемый код доступным для загрузки. Для этого определите имя файла после кода языка вот так:
<file php myexample.php> <?php echo "hello world!"; ?> </file>
<?php echo "hello world!"; ?>
Если вам не нужна подсветка, но нужен загружаемый файл, поставьте прочерк (-) на месте кода языка: <code - myfile.foo>.
Чистый HTML- или PHP-код можно вставлять в документ с помощью тэгов html и php:
<html> Тут вставлен <font color="red" size="+1">HTML-код</font> </html>
<html> Тут вставлен <font color=«red» size=«+1»>HTML-код</font> </html>
<php> echo 'Логотип, сгенерированный PHP:'; echo '<img src="' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '" alt="Логотип PHP!" />'; </php>
<php> echo 'Логотип, сгенерированный PHP:'; echo '<img src=«' . $_SERVER['PHP_SELF'] . '?=' . php_logo_guid() . '» alt=«Логотип PHP!» />'; </php>
Примечание: по умолчанию вставка HTML и PHP запрещена. Когда она запрещена, код не исполняется, а выводится в исходном виде.
Некоторый синтаксис влияет на то, как «ДокуВики» обрабатывает статьи без создания каких-либо результатов для себя. Доступны следующие макросы:
| Макрос | Описание |
|---|---|
| ~~NOTOC~~ | Если этот макрос присутствует в статье, оглавление не будет создано. |
| ~~NOCACHE~~ | «ДокуВики» помещает всё выводимое в кэш по умолчанию. Иногда это нежелательно (например, когда выше был использован синтаксис <php>), добавление этого макроса заставит «ДокуВики» обрабатывать статью при каждом вызове. |
DokuWiki может отображать на своих страницах данные из внешних XML-фидов. Для парсинга XML-фидов используется библиотека SimplePie, соответственно, все форматы, распознаваемые этой библиотекой поддерживаются в DokuWiki. Вывод информации можно настроить, используя следующие параметры (параметры надо разделять пробелами):
| Параметр | Описание |
|---|---|
| любое число | максимальное кол-во отображаемых элементов, по умолчанию - 8 |
| reverse | вывести список новостей в обратном порядке - самые старые записи выводятся первыми |
| author | показывать имена авторов (если указаны в фиде) |
| date | показывать даты записей (если указаны в фиде) |
| description | показывать описание записи. Если в настройках DokuWiki выключено отображение HTML кодов, то из описания будут удалены все HTML коды |
| n[dhm] | период обновления фида, где d=дни, h=часы, m=минуты. (т.е. 12h = 12 часов, а 2d = 2 дня). |
По умолчанию период обновления равен 4 часам. Если указать значение меньше 10 минут, то DokuWiki всё-равно будет обновлять не чаще, чем раз в 10 минут. По умолчанию DokuWiki выдаёт пользователю сохранённую версию страницы, однако указание периода обновления фида приводит к повторному рендерингу страницы.
Пример:
{{rss>http://wsrss.bbc.co.uk/russian/index.xml 7 author date 10h }}
Синтаксис «ДокуВики» может быть расширен за счёт плагинов. Как их устанавливать и использовать — описывается на страницах описания. На этом сайте установлены следующие модули, которые расширяют стандартное форматирование DokuWiki:
~~INFO:syntaxplugins~~
Текст можно выделять цветом. <hi>Цвет по умолчанию</hi> может быть заменён на какой-либо другой, например <hi red>красный</hi> или <hi lightblue>голубой</hi>.
Текст можно выделять цветом. <hi>Цвет по умолчанию</hi> может быть заменён на какой-либо другой, например <hi red>красный</hi> или <hi lightblue>голубой</hi>.
С помощью плагина chem простые химические формулы форматируются автоматически, например: <chem>10C2H5OH, 2H3PO4, Al(OH)3, Fe3+, 15[Cat]3|2+[Anion]2|3-, 238^Pu, N0, N+1, N-3, e-</chem>
<chem>10C2H5OH, 2H3PO4, Al(OH)3, Fe3+, 15[Cat]3|2+[Anion]2|3-, 238^Pu, N0, N+1, N-3, e-</chem>
Плагин Note позволяет легко оформлять всевозможные комментарии и заметки:
<note>обычная заметка </note> <note tip>заметка-подсказка</note> <note important>важная заметка</note> <note warning>заметка-предупреждение</note>
<note>обычная заметка</note> <note tip>заметка-подсказка</note> <note important>важная заметка</note> <note warning>заметка-предупреждение</note>
ссылка на плагин: http://www.dokuwiki.org/plugin:note
~~DISCUSSION:off~~
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 page. The simpler markup is easily accessible via quickbuttons, too.
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.
You can use subscript and superscript, too.
You can use <sub>subscript</sub> and <sup>superscript</sup>, too.
You can mark something as deleted as well.
You can mark something as <del>deleted</del> as well.
Paragraphs are created from blank lines. If you want to force a newline without a paragraph, you can use two backslashes followed by a whitespace or the end of line.
This is some text with some linebreaks
Note that the
two backslashes are only recognized at the end of a line
or followed by
a whitespace \\this happens without it.
This is some text with some linebreaks\\ Note that the two backslashes are only recognized at the end of a line\\ or followed by\\ a whitespace \\this happens without it.
You should use forced newlines only if really needed.
DokuWiki supports multiple ways of creating links.
External links are recognized automagically: http://www.google.com or simply www.google.com - You can set the link text as well: This Link points to google. Email addresses like this one: andi@splitbrain.org are recognized, too.
DokuWiki supports multiple ways of creating links. External links are recognized automagically: http://www.google.com or simply www.google.com - You can set link text as well: [[http://www.google.com|This Link points to google]]. Email addresses like this one: <andi@splitbrain.org> are recognized, too.
Internal links are created by using square brackets. You can either just give a pagename or use an additional link text.
Internal links are created by using square brackets. You can either just give a [[pagename]] or use an additional [[pagename|link text]].
Wiki pagenames are converted to lowercase automatically, special characters are not allowed.
You can use namespaces by using a colon in the pagename.
You can use [[some:namespaces]] by using a colon in the pagename.
For details about namespaces see 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 this Section.
This links to [[syntax#internal|this Section]].
Notes:
DokuWiki supports Interwiki links. These are quick links to other Wikis. For example this is a link to Wikipedia's page about Wikis: 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]].
Windows shares like this are recognized, too. Please note that these only make sense in a homogeneous user group like a corporate Intranet.
Windows Shares like [[\\server\share|this]] are recognized, too.
Notes:
conf/lang/en/lang.php (more details at localization): <?php /** * Customization of the english language file * Copy only the strings that needs to be modified */ $lang['js']['nosmblinks'] = '';
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:
[[http://php.net|{{wiki:dokuwiki-128.png}}]]
Please note: The image formatting is the only formatting syntax accepted in link names.
The whole image and link syntax is supported (including image resizing, internal and external images and URLs and interwiki links).
You can add footnotes 3) by using double parentheses.
You can add footnotes ((This is a footnote)) by using double parentheses.
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 ~~NOTOC~~ in the document.
==== Headline Level 3 ==== === Headline Level 4 === == Headline Level 5 ==
By using four or more dashes, you can make a horizontal line:
You can include external and internal images, videos and audio files with curly brackets. Optionally you can specify the size of them.
Resize to given width and height4):
Real size: {{wiki:dokuwiki-128.png}}
Resize to given width: {{wiki:dokuwiki-128.png?50}}
Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}}
Resized external image: {{https://www.php.net/images/php.gif?200x50}}
By using left or right whitespaces you can choose the alignment.
{{ wiki:dokuwiki-128.png}}
{{wiki:dokuwiki-128.png }}
{{ wiki:dokuwiki-128.png }}
Of course, you can add a title (displayed as a tooltip by most browsers), too.
{{ wiki:dokuwiki-128.png |This is the caption}}
For linking an image to another page see Image Links above.
DokuWiki can embed the following media formats directly.
| Image | gif, jpg, png |
| Video | webm, ogv, mp4 |
| 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.
By adding ?linkonly you provide a link to the media without displaying it inline
{{wiki:dokuwiki-128.png?linkonly}}
dokuwiki-128.png This is just a link to the image.
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.
For example consider this embedded mp4 video:
{{video.mp4|A funny video}}
When you upload a video.webm and video.ogv next to the referenced video.mp4, DokuWiki will automatically add them as alternatives so that one of the three files is understood by your browser.
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.
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.
* This is a list
* The second item
* You may have different levels
* Another item
- The same list but ordered
- Another item
- Just use indention for deeper levels
- That's it
Also take a look at the FAQ on list items.
DokuWiki can convert certain pre-defined characters or strings into images or other text or HTML.
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.
DokuWiki converts commonly used emoticons to their graphical equivalents. Those Smileys and other images can be configured and extended. Here is an overview of Smileys included in DokuWiki:
Typography: DokuWiki can convert simple text characters to their typographically correct entities. Here is an example of recognized characters.
→ ← ↔ ⇒ ⇐ ⇔ » « – — 640×480 © ™ ® «He thought 'It's a man's world'…»
-> <- <-> => <= <=> >> << -- --- 640x480 (c) (tm) (r) "He thought 'It's a man's world'..."
The same can be done to produce any kind of HTML, it just needs to be added to the pattern file.
There are three exceptions which do not come from that pattern file: multiplication entity (640×480), 'single' and «double quotes». They can be turned off through a config option.
Some times you want to mark some text to show it's a reply or comment. You can use the following syntax:
I think we should do it > No we shouldn't >> Well, I say we should > Really? >> Yes! >>> Then lets do it!
I think we should do it
No we shouldn't
Well, I say we should
Really?
Yes!
Then lets do it!
DokuWiki supports a simple syntax to create tables.
| 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 |
Table rows have to start and end with a | for normal rows or a ^ for headers.
^ 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 |
To connect cells horizontally, just make the next cell completely empty as shown above. Be sure to have always the same amount of cell separators!
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 |
As you can see, it's the cell separator before a cell which decides about the formatting:
| ^ 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 |
You can have rowspans (vertically connected cells) by adding ::: into the cells below the one to which they should connect.
| 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 |
Apart from the rowspan syntax those cells should not contain anything else.
^ 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 |
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 | ||
|---|---|---|
| right | center | left |
| left | right | center |
| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
This is how it looks in the source:
^ Table with alignment ^^^ | right| center |left | |left | right| center | | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
Note: Vertical alignment is not supported.
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 %%.
This is some text which contains addresses like this: http://www.splitbrain.org and **formatting**, but nothing is done with it. The same is true for //__this__ text// with a smiley ;-).
<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 %%//__this__ text// with a smiley ;-)%%.
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>.
This is text is indented by two spaces.
This is preformatted code all spaces are preserved: like <-this
This is pretty much the same, but you could use it to show that you quoted a file.
Those blocks were created by this source:
This is text is indented by two spaces.
<code> This is preformatted code all spaces are preserved: like <-this </code>
<file> This is pretty much the same, but you could use it to show that you quoted a file. </file>
DokuWiki can highlight sourcecode, which makes it easier to read. It uses the 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. <code java> or <file java>.
/** * 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 language strings are currently recognized: 4cs 6502acme 6502kickass 6502tasm 68000devpac abap actionscript3 actionscript ada aimms algol68 apache applescript apt_sources arm asm asp asymptote autoconf autohotkey autoit avisynth awk bascomavr bash basic4gl batch bf biblatex bibtex blitzbasic bnf boo caddcl cadlisp ceylon cfdg cfm chaiscript chapel cil c_loadrunner clojure c_mac cmake cobol coffeescript c cpp cpp-qt cpp-winapi csharp css cuesheet c_winapi dart dcl dcpu16 dcs delphi diff div dos dot d ecmascript eiffel email epc e erlang euphoria ezt f1 falcon fo fortran freebasic freeswitch fsharp gambas gdb genero genie gettext glsl gml gnuplot go groovy gwbasic haskell haxe hicest hq9plus html html4strict html5 icon idl ini inno intercal io ispfpanel java5 java javascript jcl j jquery julia kixtart klonec klonecpp kotlin latex lb ldif lisp llvm locobasic logtalk lolcode lotusformulas lotusscript lscript lsl2 lua m68k magiksf make mapbasic mathematica matlab mercury metapost mirc mk-61 mmix modula2 modula3 mpasm mxml mysql nagios netrexx newlisp nginx nimrod nsis oberon2 objc objeck ocaml-brief ocaml octave oobas oorexx oracle11 oracle8 oxygene oz parasail parigp pascal pcre perl6 perl per pf phix php-brief php pic16 pike pixelbender pli plsql postgresql postscript povray powerbuilder powershell proftpd progress prolog properties providex purebasic pycon pys60 python qbasic qml q racket rails rbs rebol reg rexx robots roff rpmspec rsplus ruby rust sas sass scala scheme scilab scl sdlbasic smalltalk smarty spark sparql sql sshconfig standardml stonescript swift systemverilog tclegg tcl teraterm texgraph text thinbasic tsql twig typoscript unicon upc urbi uscript vala vbnet vb vbscript vedit verilog vhdl vim visualfoxpro visualprolog whitespace whois winbatch wolfram xbasic xml xojo xorg_conf xpp yaml z80 zxbasic
There are additional advanced options available for syntax highlighting, such as highlighting lines or adding line numbers.
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:
<file php myexample.php> <?php echo "hello world!"; ?> </file>
<?php echo "hello world!"; ?>
If you don't want any highlighting but want a downloadable file, specify a dash (-) as the language code: <code - myfile.foo>.
DokuWiki can integrate data from external XML feeds. For parsing the XML feeds, 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:
| Parameter | Description |
|---|---|
| any number | will be used as maximum number items to show, defaults to 8 |
| reverse | display the last items in the feed first |
| author | show item authors names |
| date | show item dates |
| description | show the item description. All HTML tags will be stripped |
| nosort | do not sort the items in the feed |
| n[dhm] | refresh period, where d=days, h=hours, m=minutes. (e.g. 12h = 12 hours). |
The refresh period defaults to 4 hours. Any value below 10 minutes will be treated as 10 minutes. DokuWiki will generally try to supply a cached version of a page, obviously this is inappropriate when the page contains dynamic external content. The parameter tells DokuWiki to re-render the page if it is more than refresh period since the page was last rendered.
By default the feed will be sorted by date, newest items first. You can sort it by oldest first using the reverse parameter, or display the feed as is with nosort.
Example:
{{rss>http://slashdot.org/index.rss 5 author date 1h }}
Some syntax influences how DokuWiki renders a page without creating any output it self. The following control macros are availble:
| Macro | Description |
|---|---|
| ~~NOTOC~~ | If this macro is found on the page, no table of contents will be created |
| ~~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 |
DokuWiki's syntax can be extended by 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:
~~INFO:syntaxplugins~~