{html {head {title S-Expression Inspired Markup Syntax} {style H1, H2, H3, H4, H5, H6 { font-family: futura, sans-serif; }} {body {h1 Introduction} {p We wanted to have a simple and easy to remember markup syntax for SGML-inspired markup like HTML. It should parse to a hierarchy of {i nodes} which these days often is called a "DOM".} {-- we could make a double newline be like

, but that would -- need the DTD, but would be quite nice to have. --} Escaping rules should be dead easy to remember: {:tt \\} is the sole escape character and strips the next character of any special meaning making it behave like any letter. Like with SGML or XML, nodes have a {I general identifier} (GI), a list of attributes mapping a name to a string and a sequence of either text (PCDATA) or other nodes. With our syntax both nodes and attributes share a common syntax: {pre \{{I gi} {I children}...\} } When the identifier begins with {:tt :} it names an attribute, otherwise it names a node. Text doesn't need any quotes and once the {I general identifier} has been consumed, the rest until a matching {tt \}} is the text of that node. Non-attribute nodes may contain other nodes mixed with text. {-- something more complex --} {table {:border 0} {:cellpadding 5} {:rules groups} {thead {tr {th SXML} {th SGML/HTML/XML}}} {tbody {tr {td {tt \{b foo\}}} {td foo}} {tr {td {tt \{a \{:href http://example.com/\} click me\}}} {td click me}}}} }}}