Documentation Patterns
DocuWIKI Resources
Typical Patterns
Bitfield Display
<zbitfield bits=144, width=600, lanes=3>
{"bits": 8, "name": "S", "type": 4},
{"bits": 8, "name": "1", "type": 4, "attr": "type"},
{"bits": 8, "name": "0", "attr": "count 0", "type": 5},
{"bits": 8, "name": "C", "attr": "count 1", "type": 5},
{"bits": 8, "attr": "addr0", "type": 1},
{"bits": 8, "attr": "addr1", "type": 2},
{"bits": 8, "attr": "addr2", "type": 3},
{"bits": 8, "attr": "addr3", "type": 4},
{"bits": 48, "name": "data", "type": 6},
{"bits": 16, "name": "checksum", "type": 7},
{"bits": 8, "name": "'\\r'", "type": 8},
{"bits": 8, "name": "'\\n'"}
</zbitfield>
<zbitfield bits=60, lanes=2, compact=false, height=80, width=600, invalid=true, hflip=true, vflip=true, cache=false>
{ "name": "IPO", "bits": 8, "attr": "RO" },
{ "bits": 7 },
{ "name": "BRK", "bits": 5, "attr": "RW", "type": 4 },
{ "name": "CPK", "bits": 1 },
{ "name": "Clear", "bits": 3 },
{ "bits": 8 }
</zbitfield>
<zbitfield bits=16, cache=false>
{ "bits": 7 },
{ "name": "BRK", "bits": 5, "attr": "RW", "type": 4 },
{ "name": "CPK", "bits": 1 },
{ "name": "Clear", "bits": 3 },
{ "bits": 8 }
</zbitfield>
<zbitfield bits=60, cache=false>
vfd 12/F1, 12/F2, 12/F3, 6/F4, 6/F5, 6/F7, 6/F8
</zbitfield>
Mathematical Formulae
<m>S(f)(t)=a_{0}+sum{n=1}{+infty}{a_{n} cos(n omega t)+b_{n} sin(n omega t)}</m>
<m 8>delim{lbrace}{matrix{3}{1}{{3x-5y+z=0} {sqrt{2}x-7y+8z=0} {x-8y+9z=0}}}{ }</m>
<m 32>delim{|}{{1/N} sum{n=1}{N}{gamma(u_n)} - 1/{2 pi} int{0}{2 pi}{gamma(t) dt}}{|} <= epsilon/3</m>
Extended Backus-Naur Form
The Extended Backus–Naur form is used to document the syntax of command lines, .ini files and more. Some of the sample patterns are shown below:
Arithmetic Expressions
<ebnf> "Arithmetic Expressions" {
expression = term { ("+" | "-") term} .
term = factor { ("*"|"/") factor} .
factor = constant | variable | "(" expression ")" .
variable = "x" | "y" | "z" .
constant = digit {digit} .
digit = "0" | "1" | "..." | "9" .
} </ebnf>
See: Syntax Diagram
Designator
<ebnf> "Designator" {
Designator = (ident | "this" | "super") {"." ident | "[" Expr "]"}.
} </ebnf>
Backus-Naur Form (BNF)
<ebnf> "Backus-Naur Form" {
syntax = rule [ syntax ] .
rule = opt-ws identifier opt-ws "::=" opt-ws expression opt-ws EOL .
expression = list [ "|" expression ] .
line-end = opt-ws EOL | line-end line-end .
list = term [ WHITESPACE list ] .
term = literal | identifier .
identifier = "<" character {character} ">" .
literal = "'" {character} "'" | '"' {character} '"' .
opt-ws = { WHITESPACE } .
character = lowercase-char | uppercase-char | digit | special-char .
lowercase-char = "a" | "b" | "..." | "z" .
uppercase-char = "A" | "B" | "..." | "Z" .
digit = "0" | "1" | "..." | "2" .
special-char = "-" | "_" .
} </ebnf>
ADM tags
This wiki supports the
Note
tag pair to start and end a note. The first parameter of the opening tag chooses the note style.
There are twelve styles available: 'abstract', 'bug', 'danger', 'example', 'failure', 'information', 'note', 'question', 'quote', 'achievement', 'tip', 'warning'
Abstract
Abstract
Bug
Bug
Danger
Danger
Example
Example
Error
Failure
Info
Information
Note
Note
Question
Question
Quote
Quote
Success
Achievement
Tip
Tip
Warning
Warning
You can replace the standard heading by adding your heading text as a third parameter in the
Note
tag:
<adm warning A very special warning>This is a warning
You can also omit the body of the note completely:
Will initiate self destruction if you click this
The default style is 'note', so
Note
is a valid note although it does not make much sense:
The default style will also be used if you mistype a style.
You can use almost every DokuWiki element inside a note body except headers.