Skip to content
Philip Cali edited this page Nov 18, 2011 · 8 revisions

There are not many syntax rules, and the parsing engine is pretty flexible. Here is a quick bullet list of the syntax rules, and a following in-depth explanation of each:

  • Whitespace is important
  • JSON-style attributes
  • Id attributes prefixed with "#"
  • Class attributes prefixed with "."
  • Attribute shorthand with "@" prefix
  • Unescaped text is suffixed with is unescaped
  • Markdown indirect link style templates
  • Indirect definitions are delimited from main document by ---

Whitespace is Important

The parser uses whitespace to determine if the next node is a child or sibling.

I think it is better to explain the difference by actually looking at some real markup.

html
  head title "Blah"
  body

In this case, head and body are both children of html, and their same level of indention also states that they are siblings.

<html>
  <head>
    <title>Blah</title>
  </head>
  <body/>
</html>

The children of head were written on the same line, and this is where the parser is flexible. Nodes written in this manner are treated as recursive children.

Note: Nodes written on the same line like that, is the Quick and Dirty way of writing LMXML. Use this method if you know for sure that there will be no siblings.

JSON-style attributes

More talk about this later

Clone this wiki locally