syntax
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| syntax [May 14, 2026 at 13:31] – yanevskiv | syntax [August 22, 2026 at 15:22] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # Wiki syntax | ||
| - | ------ | + | This wiki runs **DokuWiki** with the [[list-of-syntaxes|markdowku]] plugin on top, so **both DokuWiki markup and Markdown work in the same page**, often interchangeably. Math is handled by **KaTeX** and LaTeX figures by **texrender**. |
| + | |||
| + | Where the two markups overlap, this page shows both and says which one to prefer. Everything below was checked against this installation. The differences from stock DokuWiki are real, not theoretical. | ||
| + | |||
| + | Pages are stored as `.md` files under `data/ | ||
| + | |||
| + | ## Headings | ||
| + | |||
| + | Both heading styles work and mix freely. Markdown `#` counts levels downward, DokuWiki `=` counts them upward. | ||
| + | |||
| + | < | ||
| + | # Level 1 ====== Level 1 ====== | ||
| + | ## Level 2 ===== Level 2 ===== | ||
| + | ### Level 3 ==== Level 3 ==== | ||
| + | #### Level 4 === Level 4 === | ||
| + | ##### Level 5 == Level 5 == | ||
| + | </ | ||
| + | |||
| + | Setext headings work too: | ||
| + | |||
| + | < | ||
| + | Level 1 | ||
| + | ======= | ||
| + | |||
| + | Level 2 | ||
| + | ------- | ||
| + | </ | ||
| + | |||
| + | House style is `#` for the page title and `##`/`###` for sections. | ||
| + | |||
| + | The table of contents appears as soon as there is one heading, and lists levels 1 and 2 only. A page whose title starts with `(WIP)` is treated as work in progress: it is listed separately on the [[: | ||
| + | |||
| + | ## Text formatting | ||
| + | |||
| + | < | ||
| + | **bold** and //italic// and *italic* and _italic_ | ||
| + | __underline__ and '' | ||
| + | **// | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | **bold** and //italic// and *italic* and _italic_ | ||
| + | __underline__ and '' | ||
| + | **// | ||
| + | < | ||
| + | |||
| + | Note that `'' | ||
| + | |||
| + | ## Paragraphs and line breaks | ||
| + | |||
| + | A blank line starts a new paragraph. Single newlines inside a paragraph are ignored. | ||
| + | |||
| + | Forced line breaks come in two forms, both of which need the trailing whitespace: | ||
| + | |||
| + | < | ||
| + | DokuWiki style\\ next line | ||
| + | Markdown style, two trailing spaces | ||
| + | next line | ||
| + | </ | ||
| + | |||
| + | `\\` immediately followed by a letter does nothing. It needs a space or an end of line after it. | ||
| + | |||
| + | ## Links | ||
| + | |||
| + | ### Internal | ||
| + | |||
| + | < | ||
| + | [[qubit]] | ||
| + | [[qubit|a qubit]] | ||
| + | [[qubit]] | ||
| + | [[qubit# | ||
| + | [[# | ||
| + | </ | ||
| + | |||
| + | [[qubit]], [[qubit|a qubit]], [[qubit# | ||
| + | |||
| + | Almost every article lives in the `wiki:` namespace, so the short form is what you want. Links to pages that do not exist yet are red, links to `(WIP)` pages are gold. | ||
| + | |||
| + | Section anchors are the heading text, lowercased, with spaces turned into dashes. | ||
| + | |||
| + | ### External | ||
| + | |||
| + | < | ||
| + | https:// | ||
| + | [[https:// | ||
| + | [Example](https:// | ||
| + | < | ||
| + | < | ||
| + | [[wp> | ||
| + | [[doku> | ||
| + | </ | ||
| + | |||
| + | A **bare e-mail address is not linked**. It needs the angle brackets. The available interwiki shortcuts are listed in `conf/ | ||
| + | |||
| + | Link text is plain text: `**bold**` inside a link title is printed literally, not rendered. Math and images are the exceptions: `[[ket-0|$\lvert 0\rangle$]]` and `[[qubit|{{img.png}}]]` both work. | ||
| + | |||
| + | ## Footnotes and references | ||
| + | |||
| + | < | ||
| + | A claim((and the reason it is only a claim)). | ||
| + | </ | ||
| + | |||
| + | A claim((and the reason it is only a claim)). Footnotes collect at the bottom of the page and are the **only** citation mechanism here. There is no `< | ||
| + | |||
| + | Links, images and math all work inside a footnote: | ||
| + | |||
| + | < | ||
| + | Shor's algorithm((Shor 1994, see [[shor]] and https:// | ||
| + | </ | ||
| + | |||
| + | Shor's algorithm((Shor 1994, see [[shor]] and https:// | ||
| + | |||
| + | ### Citing the same source twice | ||
| + | |||
| + | Repeating a footnote **with byte-identical text** collapses it into a single entry at the bottom, with one backlink per marker. That is the closest thing available to MediaWiki' | ||
| + | |||
| + | < | ||
| + | Sorting((Knuth 1998)) and searching((Knuth 1998)) and concurrency((Dijkstra 1968)). | ||
| + | </ | ||
| + | |||
| + | Sorting((Knuth 1998)) and searching((Knuth 1998)) and concurrency((Dijkstra 1968)). | ||
| + | |||
| + | The markers still count up, but the two Knuth markers point at one shared entry. Change a single character and the entry splits in two, so copy and paste the citation rather than retyping it. | ||
| + | |||
| + | For pointing at other articles, the house convention is a plain `[[link]]` in the prose and a **See also** section at the end, as at the bottom of this page. Footnotes are for sources and asides, not for navigation. | ||
| + | |||
| + | ## Lists | ||
| + | |||
| + | Bullet lists work in both markups. The DokuWiki form needs **two leading spaces**, the Markdown form needs a **blank line before it**. Indent by two more spaces to nest. | ||
| + | |||
| + | < | ||
| + | * DokuWiki bullet | ||
| + | * nested | ||
| + | |||
| + | * Markdown bullet | ||
| + | * nested | ||
| + | </ | ||
| + | |||
| + | Numbered lists are **Markdown only**: | ||
| + | |||
| + | < | ||
| + | 1. first | ||
| + | 2. second | ||
| + | </ | ||
| + | |||
| + | DokuWiki' | ||
| + | |||
| + | ## Tables | ||
| + | |||
| + | Tables are DokuWiki syntax. Markdown pipe tables are **not** supported. The `|---|---|` separator row shows up as a literal row of dashes. | ||
| + | |||
| + | `^` marks a header cell, `|` a normal one: | ||
| + | |||
| + | < | ||
| + | ^ Fruit ^ Colour ^ Count ^ | ||
| + | | apple | red | 12 | | ||
| + | | lemon | yellow | 3 | | ||
| + | </ | ||
| + | |||
| + | ^ Fruit ^ Colour ^ Count ^ | ||
| + | | apple | red | 12 | | ||
| + | | lemon | yellow | 3 | | ||
| + | |||
| + | **Exactly one space each side is the neutral padding.** Two or more spaces are not whitespace, they are the alignment marker: extra space on the left aligns right, on the right aligns left, on both sides centres. This is why table source on this wiki looks cramped and cannot be padded into neat columns. Widening a cell to line the pipes up would silently re-align it. | ||
| + | |||
| + | < | ||
| + | ^ Left ^ Centre ^ Right ^ | ||
| + | | a | b | c | | ||
| + | </ | ||
| + | |||
| + | ^ Left ^ Centre ^ Right ^ | ||
| + | | a | b | c | | ||
| + | |||
| + | An empty cell (`||`) merges with the one to its left; `:::` merges with the one above: | ||
| + | |||
| + | < | ||
| + | ^ A ^ B ^ C ^ | ||
| + | | spans two columns || third | | ||
| + | | tall | x | y | | ||
| + | | ::: | z | w | | ||
| + | </ | ||
| + | |||
| + | ^ A ^ B ^ C ^ | ||
| + | | spans two columns || third | | ||
| + | | tall | x | y | | ||
| + | | ::: | z | w | | ||
| + | |||
| + | Links and math work inside cells, which is how most tables on this wiki are built: | ||
| + | |||
| + | < | ||
| + | ^ State ^ Vector ^ | ||
| + | | [[ket-0|$\lvert 0\rangle$]] | $\begin{pmatrix}1\\0\end{pmatrix}$ | | ||
| + | </ | ||
| + | |||
| + | ^ State ^ Vector ^ | ||
| + | | [[ket-0|$\lvert 0\rangle$]] | $\begin{pmatrix}1\\0\end{pmatrix}$ | | ||
| + | | [[ket-1|$\lvert 1\rangle$]] | $\begin{pmatrix}0\\1\end{pmatrix}$ | | ||
| + | |||
| + | A bare `^` or `|` inside a cell splits it. Wrap it as `'' | ||
| + | |||
| + | ## Code | ||
| + | |||
| + | Fenced blocks are syntax highlighted by language: | ||
| + | |||
| + | < | ||
| + | ```python | ||
| + | def f(x): | ||
| + | return x ** 2 | ||
| + | ``` | ||
| + | </ | ||
| + | |||
| + | ```python | ||
| + | def f(x): | ||
| + | return x ** 2 | ||
| + | ``` | ||
| + | |||
| + | The DokuWiki form takes an optional language and an optional filename; with a filename the block gets a download link: | ||
| + | |||
| + | < | ||
| + | <code python demo.py> | ||
| + | print(" | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | <code python demo.py> | ||
| + | print(" | ||
| + | </ | ||
| + | |||
| + | `< | ||
| + | |||
| + | Indenting a line by **two or more spaces** also makes a code block. That is DokuWiki' | ||
| + | |||
| + | Nothing inside a code block is parsed, so it is the safest way to show wiki markup, math or TikZ literally. | ||
| + | |||
| + | ## Math | ||
| + | |||
| + | KaTeX renders math in the browser. Inline math uses single dollars, display math double: | ||
| + | |||
| + | < | ||
| + | The identity $e^{i\pi} + 1 = 0$ is inline. | ||
| + | |||
| + | $$\int_0^1 x^2\,dx = \frac{1}{3}$$ | ||
| + | </ | ||
| + | |||
| + | The identity $e^{i\pi} + 1 = 0$ is inline. | ||
| + | |||
| + | $$\int_0^1 x^2\,dx = \frac{1}{3}$$ | ||
| + | |||
| + | Math works inside table cells, headings and link titles. | ||
| + | |||
| + | Five shorthand macros are defined for the number sets: | ||
| + | |||
| + | ^ Macro ^ Renders ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | Two limitations worth knowing: | ||
| + | |||
| + | - `\(...\)` and `\[...\]` **do not work**, even though KaTeX is configured for them. The Markdown escape handling eats the backslash before KaTeX ever sees it. Use `$` and `$$`. | ||
| + | - Math inside code blocks and inline code stays literal, which is exactly what you want when writing *about* math syntax. | ||
| + | |||
| + | ## LaTeX figures | ||
| + | |||
| + | The texrender plugin runs LaTeX on the server and embeds the result as inline SVG. Two forms are recognised. | ||
| + | |||
| + | A small picture in the middle of a sentence, using TikZ's own `\tikz` shorthand. It ends at the first semicolon outside braces, or at the closing brace of `\tikz{...}`: | ||
| + | |||
| + | < | ||
| + | An arrow \tikz \draw[-> | ||
| + | </ | ||
| + | |||
| + | An arrow \tikz \draw[-> | ||
| + | |||
| + | A standalone document gets a block of its own: | ||
| + | |||
| + | < | ||
| + | \documentclass[border=2pt]{standalone} | ||
| + | \usepackage{tikz} | ||
| + | \begin{document} | ||
| + | \begin{tikzpicture} | ||
| + | \draw[thick] (0,0) circle (0.6); | ||
| + | \draw[-> | ||
| + | \draw[-> | ||
| + | \fill (0.42,0.42) circle (0.05) node[above right] {$\psi$}; | ||
| + | \end{tikzpicture} | ||
| + | \end{document} | ||
| + | </ | ||
| + | |||
| + | \documentclass[border=2pt]{standalone} | ||
| + | \usepackage{tikz} | ||
| + | \begin{document} | ||
| + | \begin{tikzpicture} | ||
| + | \draw[thick] (0,0) circle (0.6); | ||
| + | \draw[-> | ||
| + | \draw[-> | ||
| + | \fill (0.42,0.42) circle (0.05) node[above right] {$\psi$}; | ||
| + | \end{tikzpicture} | ||
| + | \end{document} | ||
| + | |||
| + | Anything found in the wild that is already a standalone document can be pasted in unchanged. No preamble is added and nothing is wrapped around it. Figures are cached, follow the surrounding text colour, and are capped in size and render time; a figure that fails to compile shows the LaTeX error instead of silently disappearing. | ||
| + | |||
| + | ## Images and media | ||
| + | |||
| + | Images live in the media manager and are referenced by ID, exactly like pages. The one below is `wiki: | ||
| + | |||
| + | < | ||
| + | {{wiki: | ||
| + | </ | ||
| + | |||
| + | {{wiki: | ||
| + | |||
| + | Options go after a `?`, a caption after a `|`. The live examples on this page are all left at full size to keep the markup readable, but any of these can be used, and combined: | ||
| + | |||
| + | ^ Written ^ Does ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | ### Alignment | ||
| + | |||
| + | Alignment is a space **inside** the braces, and it is easy to miss when reading source. Think of the space as padding that shoves the image away from that side: a space on the left pushes the image right. | ||
| + | |||
| + | ^ Written ^ Space on ^ Image goes ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | The three aligned forms, in order: | ||
| + | |||
| + | {{ wiki: | ||
| + | |||
| + | {{wiki: | ||
| + | |||
| + | {{ wiki: | ||
| + | |||
| + | ## Quotes | ||
| + | |||
| + | < | ||
| + | > a quoted line | ||
| + | > a second one | ||
| + | </ | ||
| + | |||
| + | > a quoted line | ||
| + | > a second one | ||
| + | |||
| + | Quotes have two quirks here. Consecutive lines are joined **without a space**, so end each line with a trailing space as above. Nesting with `>>` does not produce a nested quote; separate paragraphs with a bare `>` line instead. | ||
| + | |||
| + | ## Horizontal rules | ||
| + | |||
| + | A line of four or more dashes on its own gives a rule, as do the Markdown forms `***` and `___`: | ||
| + | |||
| + | ---- | ||
| + | |||
| + | Keep a **blank line above it**. A row of dashes directly underneath a line of text is a Setext heading, not a rule. That is true even inside a code block, which is why the example above is a live rule rather than a listing. | ||
| + | |||
| + | ## Smileys and typography | ||
| + | |||
| + | Text smileys are replaced by icons: | ||
| + | |||
| + | ^ Type ^ Get ^ Type ^ Get ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | `FIXME` and `DELETEME` are the useful ones. They mark a page for later without any extra markup. | ||
| + | |||
| + | Some character sequences are replaced as you would expect in print: | ||
| + | |||
| + | ^ Type ^ Get ^ Type ^ Get ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | |||
| + | The full list lives in `conf/ | ||
| + | |||
| + | ## Escaping | ||
| + | |||
| + | To show markup rather than have it interpreted: | ||
| + | |||
| + | < | ||
| + | %%no //markup// here%% | ||
| + | < | ||
| + | \*escaped\* \_underscore\_ \`backtick\` | ||
| + | </ | ||
| + | |||
| + | %%no //markup// here%%. The `%%...%%` form is the shortest and works inside table cells. | ||
| + | |||
| + | For inline examples that contain math or wiki markup, combine the two: `'' | ||
| + | |||
| + | Backslash escapes work for `` ` * _ { } [ ] ( ) > # + - . ! ``. That is also why `\(` and `\[` cannot be used as math delimiters. | ||
| + | |||
| + | ## Control macros | ||
| + | |||
| + | < | ||
| + | ~~NOTOC~~ | ||
| + | ~~NOCACHE~~ | ||
| + | </ | ||
| + | |||
| + | ## Embedding a feed | ||
| + | |||
| + | < | ||
| + | {{rss> | ||
| + | </ | ||
| + | |||
| + | The number caps how many items are shown; `author`, `date` and `description` are optional flags. `nosort` keeps the feed's own order, and a bare number like `2h` sets the refresh period. | ||
| + | |||
| + | ## Where each syntax comes from | ||
| + | |||
| + | Four independent parsers contribute to this page: DokuWiki core, markdowku, katex and texrender. Which one owns a given construct is usually what explains its quirks, and when two claim the same characters the lower `getSort()` wins. | ||
| + | |||
| + | [[syntax-origin|Syntax origin]] lists every construct above against the component that implements it. | ||
| + | |||
| + | ## Quick reference of the gotchas | ||
| + | |||
| + | ^ Looks like it should work ^ What actually happens ^ Use instead ^ | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | Markdown pipe tables | separator row shows as dashes | DokuWiki '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | Markdown list right after a paragraph | may swallow what follows | leave a blank line, or use '' | ||
| + | | '' | ||
| + | | a bare '' | ||
| + | |||
| + | ## See also | ||
| + | |||
| + | - [[syntax-origin|Syntax origin]] | ||
| + | - [[list-of-syntaxes|List of syntaxes]] | ||
| + | - [[latex-syntax|LaTeX syntax]] | ||
| + | - [[general-writing-guide|General writing guide]] | ||
| + | - [[doku> | ||
| - | [id]: fdsafdsa | ||
syntax.1778765493.md.gz · Last modified: by yanevskiv
