Skip to content

DokuWiki Syntax — Headings, Bold, Italic, Lists, and Code Blocks

DodaTech Updated 2026-06-28 7 min read

In this tutorial, you'll learn DokuWiki's lightweight markup syntax for formatting text, creating lists, writing code blocks, and organizing content with headings and horizontal rules.

What You'll Learn

  • DokuWiki heading levels (H1 through H5)
  • Text formatting: bold, italic, underlined, monospace, and deleted
  • Bullet lists and numbered lists with nesting
  • Code blocks with syntax highlighting
  • Horizontal rules and line breaks
  • Indentation and blockquote syntax

Why It Matters

DokuWiki uses its own lightweight markup language. It is different from Markdown, MediaWiki syntax, and HTML. If you come from another wiki platform, the syntax looks familiar but has important differences. Learning the syntax properly means you write content faster, avoid formatting errors, and produce clean, readable pages.

Real-World Use

A technical writer documents an API in DokuWiki. They use heading levels to structure the page (H1 for the API name, H2 for endpoints, H3 for parameters), code blocks for request and response examples, bullet lists for parameter tables, and bold for emphasis on important notes. The rendered page is clean, scannable, and easy to navigate. Developers find the information they need within seconds.

Learning Path

flowchart LR
  A[First Wiki Page] --> B[DokuWiki Syntax]
  B --> C[Links and Images]
  C --> D[Tables]
  D --> E[Media Management]
  E --> F[Sidebar]
  F --> G[Namespaces]

Headings

DokuWiki headings use the equals sign (=). The number of equals signs indicates the level:

====== Heading Level 1 ======   (H1)
===== Heading Level 2 =====    (H2)
==== Heading Level 3 ====      (H3)
=== Heading Level 4 ===        (H4)
== Heading Level 5 ==          (H5)

The opening and closing equals must match. A space after the opening and before the closing is not required but improves readability.

Try to have only one H1 per page. The page title typically uses H1, and your sections use H2 and below.

Text Formatting

DokuWiki uses specific markup for text styles:

Style Syntax Rendered
Bold **Bold text** Bold text
//Italic// //Italic text// Italic text
Underlined __Underlined text__ Underlined text
''Monospace'' ''Monospace text'' Monospace text
Deleted ~~Deleted text~~ Deleted text
Superscript <sup>superscript</sup> superscript
Subscript <sub>subscript</sub> subscript

You can combine styles. **//Bold italic//** renders as Bold italic.

DokuWiki uses double slashes for italic, not single asterisks like Markdown. This is one of the most common points of confusion for newcomers.

Lists

Bullet Lists

Use asterisks for bullet lists. Indent with two spaces for nesting:

* Item 1
* Item 2
  * Sub-item 2a
  * Sub-item 2b
    * Sub-sub-item 2b-i
* Item 3

Rendered:

  • Item 1
  • Item 2
    • Sub-item 2a
    • Sub-item 2b
      • Sub-sub-item 2b-i
  • Item 3

Numbered Lists

Use hyphens for numbered lists:

- First item
- Second item
  - Sub-item A
  - Sub-item B
- Third item

Rendered:

  1. First item
  2. Second item
    1. Sub-item A
    2. Sub-item B
  3. Third item

Mixed Lists

You can mix bullet and numbered lists:

* Bullet item
  - Numbered sub-item
  - Another numbered sub-item
* Another bullet item
  * Bullet sub-item

Code Blocks

Inline Code

For code within a sentence, use double quotes (backtick equivalents in DokuWiki):

The `echo` command outputs text.

Renders as: The echo command outputs text.

Note: DokuWiki uses '' (two single quotes) for monospace, which is different from the backticks used in Markdown.

Block Code

For multi-line code, use the <code> tag with an optional language parameter for syntax highlighting:

<code php>
<?php
echo "Hello, DokuWiki!";
function greet($name) {
    return "Hello, $name!";
}
echo greet("World");
?>
</code>

Supported languages include: php, JavaScript, python, bash, html, css, sql, xml, and many more.

File Blocks

Use <file> for downloadable code blocks:

<file python hello.py>
def greet(name):
    return f"Hello, {name}!"

print(greet("World"))
</file>

The <file> tag adds a filename label and a download link.

No Highlighting

Use <code> without a language parameter for plain text:

<code>
This is a plain text block
with no syntax highlighting.
</code>

Horizontal Rules

Four or more hyphens create a horizontal rule:

----

This renders as a horizontal line across the page. Use it to separate sections visually.

Indentation and Blockquotes

Use > at the start of a line for indentation or blockquotes:

> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquotes work too.

For simple indentation, use two spaces at the start of the line:

Normal text
  Indented text
    Further indented text

Line Breaks

To force a line break without starting a new paragraph, use two backslashes at the end of a line:

First line\\
Second line

Without the double backslash, adjacent lines are joined into a single paragraph.

Special Characters

DokuWiki converts common special characters automatically:

  • -> becomes an arrow (→)
  • <- becomes a left arrow (←)
  • <-> becomes a double arrow (↔)
  • => becomes a double arrow (⇒)
  • (c) becomes copyright (©)
  • (tm) becomes trademark (™)
  • (r) becomes registered (®)

Putting It All Together

Here is a complete example page using multiple formatting elements:

====== Server Setup Guide ======

This page describes the **standard server configuration** for all new projects.

----

===== System Requirements =====

  - Operating System: Ubuntu 22.04 LTS
  - PHP version: 8.1 or later
  - //Minimum// RAM: 2 GB
  - Disk space: //20 GB// (//recommended//: 40 GB)

===== Installation Steps =====

Follow these steps in order:

  1. Update the system
  2. Install PHP and extensions
  3. Configure the web server
  4. //Verify the installation//

===== Configuration File =====

<code php /etc/php/8.1/cli/conf.d/custom.ini>
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 120
</code>

----

**Note:** Reboot the web server after changes.

Common Mistakes

  1. Using Markdown syntax: If you come from Markdown, you will instinctively write # Heading, *italic*, and `code`. DokuWiki uses different syntax. The most common mistake is using *italic* instead of //italic//.
  2. Incorrect heading syntax: Forgetting the closing equals signs (===== Heading without ===== at the end) breaks the heading. Both opening and closing marks are required.
  3. Using tabs for list indentation: DokuWiki requires spaces, not tabs, for list nesting. Using tabs creates rendering artifacts.
  4. Missing space after list markers: *Item without a space after the asterisk does not create a list item. Always write * Item.
  5. Overusing heading levels: Jumping from H1 to H4 without H2 and H3 creates confusing document structure. Use headings hierarchically.

Practice Questions

  1. How do you create a level-2 heading in DokuWiki, and how does this differ from Markdown and MediaWiki?
  2. Write the DokuWiki syntax for: bold text, italic text, monospace text, and a bullet list with three items.
  3. What is the difference between the <code> and <file> tags in DokuWiki?
  4. Challenge: Write a complete DokuWiki page that documents a simple REST API endpoint. Use H2 for the endpoint name, H3 for request parameters, a bullet list for parameter descriptions, a code block for a sample request (JSON), a table for response codes, and formatting (bold, italic, monospace) for emphasis. The page should be at least 150 words of content plus code examples.

FAQ

How do I create a line break in DokuWiki?

Use two backslashes at the end of a line to force a line break: Line one\\\\Line two. This creates a soft break without starting a new paragraph.

Does DokuWiki support Markdown?

DokuWiki does not natively support Markdown. It uses its own syntax. However, you can install the Markdown plugin if you prefer Markdown syntax. The native DokuWiki syntax is simpler and more consistent.

How do I escape special characters in DokuWiki?

To prevent DokuWiki from interpreting formatting characters, use '' (double single quotes) around the text to render it as monospace. For literal asterisks or equals signs, wrapping them in monospace prevents interpretation.

Can I use HTML in DokuWiki pages?

By default, HTML is disabled in DokuWiki for security reasons. You can enable it in Configuration Manager under 'Allow HTML.' This is not recommended for wikis with multiple editors, as raw HTML can break page layout.

How do I add comments or notes that are not visible on the page?

DokuWiki does not have a built-in comment syntax. Use the NOTE plugin or wrap text in double-slash comment blocks if you have the appropriate plugin installed. Without plugins, content is always visible.

Mini Project

Goal: Create a well-formatted documentation page.

  1. Create a new page called formatting-practice in your wiki
  2. Add a level-1 heading: "DokuWiki Formatting Practice"
  3. Add three level-2 sections: "Text Styles", "Lists", and "Code Examples"
  4. In "Text Styles," demonstrate bold, italic, underlined, and monospace text
  5. In "Lists," create a nested bullet list (3 levels deep) and a numbered list
  6. In "Code Examples," add a PHP code block and a Python code block with syntax highlighting
  7. Add a horizontal rule before each section
  8. Preview and save, then verify the rendering matches your expectations

What's Next

Now you can format text. Learn to create links and images to connect your pages and add visual content.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro