2017-11-18

itml

extendable ident-based markup language for structured documents

includes forms that can be evaluated by custom procedures to create custom forms like lists, tables and other. nested expressions can be passed unevaluated or evaluated

example

source of this page

expression types

by scope

inline: start and end somewhere on a line

indent: all immediately following further indented lines

line: from its start to the end of the line

by content interpretation

scm: start with \. and have to contain valid scheme syntax

non-scm: start with \ and treat arguments as plaintext

base syntax

plain text lines and indentation

"identifier" stands for a binding in the evaluation environment. custom environments can be set

inline-expr

\(identifier plaintext/itml-expression ...)

indent-expr

\identifier plaintext/itml-expression ...
  plaintext/itml-expression ...
  ...

inline-scm-expr

\.(identifier scheme-expression ...)

indent-scm-expr

\.identifier scheme-expression ...
  scheme-expression ...
  ...

indent-descend-expr

\#identifier plaintext ...
  plaintext
  ...

the text is passed as a prefix-tree list without any nested expressions evaluated. this can be used for example to create block escaping

line-expr line-scm-expr

\identifier: plaintext/itml-expressions ...
\.identifier: scheme-expressions ...

association

plaintext/itml-expression ...: plaintext/itml-expression ...

escaping

with backslash

colons and backslashes can be escaped

\\
\:

block escaping

\#escape
  content
    content
  content

parsing and compilation

parser: (sph lang itml *)

a sxml html5 compiler is also avaliable: (sph lang itml eval shtml)

document syntax

is the base syntax used for a document format like markdown

it is experimental

headings

the line before increased indent becomes the heading

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

linebreaks

each empty line creates one linebreak in the output

example text

more text after empty line

emphasis

example \(emphasis test xy) text
example \(strong-emphasis test xy) text

tables

\table
  \cell
    cell text
    cell text
  \cell
    cell text
    cell text

lists

unordered

ordered

link

\.(hlink "http://unr" "title")

image

\.(image "http://unr" "title")

escape

\#escape
  escaped
    content

inline code

\(scm-eval a ...)
\(scm-qq a ...)

other itml expressions can be called but need the itml-state as the first argument. this state is available via the binding "s" in the environment

\(scm-eval (emphasis s "text") ...)
\(scm-qq a ...)

tags: itml overview start q1 syntax specification computer