2026-09-30

indent tree markup

dynamic expressions inside markdown or similar document formats

here is an example of an extendable syntax for structured documents. it includes forms that can be evaluated by custom procedures to notate things like lists, tables and more.

it is compatible with other formats like markdown and offers dynamic expression types that allow using plaintext or nested dynamic expressions either inline, for the current line, or for the current block.

a template processor compiling from this to other formats just has to parse the expressions and their arguments and then pass that to custom functions to generate suitable output in the target format.

expression types

by scope

  • inline: start and end somewhere on a line
  • indent: include all immediately following further indented lines
  • line: from their start to the end of the line

by content interpretation

  • scm: start with # and arguments have to be valid scheme syntax
  • text: start with ## and arguments are plaintext

by evaluation phase

  • ascend: itm expressions in arguments have been evaluated
  • descend: itm expressions in arguments have not been evaluated

inline expressions

inline-scm

#(identifier dynamic-expression ...)

indent-scm

#identifier dynamic-expression ...
  dynamic-expression ...
  ...

inline-text

##(identifier plaintext/itm-expression ...)

indent-text

##identifier plaintext/itm-expression ...
  plaintext/itm-expression ...
  ...

line-scm, line-text

#identifier: dynamic-expressions ...

##identifier: plaintext/itm-expressions ...

indent-descend

###identifier plaintext ...
  plaintext
  ...

the text is passed as a parsed tree without any nested expressions evaluated. this can be used, for example, to do block escaping

headings

a line before increased indent becomes a heading

this is a heading
  this is content
  and more example text
  a sub-heading
    more content

line breaks

each empty line, two newlines, creates one line break in the output

example text

more text after empty line

escaping

inline expression prefixes, colons and backslashes can be escaped with a backslash

\:
\#
\##
\###
\\

block escapes

###
  content
    content
  content