home | guide index


GUIDE 3 — NESTING + CLOSERS

the 10 closers

every closer is ; + 1 character. one job each. zero ambiguity.

closernameclosesexample
;.inlineheadings, bold, italic, links, items;^ bold ;.
;|blockdiv, nav, form, section;\d. content ;|
;"attributeclass, id, style, generic;?:box;"
;zraw zonesvg, mathml, passthrough;\r9 ... ;z
;xtable cellcells opened by ;[;[ data ;x
;ccontainedinner inline (nested formatting);^ bold ;% italic ;c ;.
;vvoidelements with no content;\i5 ;v
;bbranchparent list with children;- parent ... ;b
;,sequencedatapod items, attr values;:a: item ;,
;>key-valuedatapod keys, attr keys;:k: name ;>

the 5 bottom-row keyboard closers: z x c v b — ergonomic and memorable.


leaf vs branch

;. = leaf (no children). ;b = branch (has children).

;- leaf item ;.              no children — ;. closes
;- branch item               has children — ;b closes
  ;- child one ;.
  ;- child two ;.
;b

rendered:

indentation is cosmetic — for readability. the parser follows closers, not whitespace.


contained inline (;c)

when nesting inline operators, use ;c to close the inner one:

;^ bold with ;% italic ;c still bold ;.

renders: bold with italic still bold

;c means "close the inner thing, not the outer thing."

deeper nesting

;c chains to any depth. each ;c pops one level inward.

;^ bold ;% italic ;` code ;c still italic ;c still bold ;.

parser stack:

when you need it

only when nesting. if not nesting, ;. works fine:

;^ just bold ;.         no nesting — ;. is fine
;^ bold ;% italic ;c ;.  nesting — inner needs ;c

why only ;. needs ;c

;. is shared across many operator types — bold, italic, code, links, items, headings, spans.
when two of them nest, the parser cannot tell which ;. belongs to which.
;c solves this.

the other closers do not need a chain equivalent:


block containers (;|)

;| closes block-level containers:

;\d. content goes here ;|           div
;\n. nav links here ;|              nav
;\f1 form fields here ;|            form
;\s1 section content ;|             section

block containers can nest — each ;| pops the nearest open block:

;\d.
  ;\d.
    inner content
  ;|
  outer content
;|

raw zones (;z)

;\r9 opens a raw block. ;z closes it.
content passes through untouched — for svg, mathml, or any literal html.

;\r9
<svg viewBox="0 0 100 100">
  <circle cx="50" cy="50" r="40"/>
</svg>
;z

escape: if content has a lone ;z line, write ;;z to prevent early close.


prev: structure | next: html-ish