Goals for a lightweight markup language (LML?)
- Embrace CSS selectors
- Trivial to parse
- Easy to learn
- Consistent
- Optimised for writers
- BNF spec
Combining ideas from Jade, Markdown, and Textile.
Support any tag with simple replacement, inspired by Jade, using this format:
tag.className(attr1="value", attr2="value")[optional innerHTML]
tag(defaultOption)[optional innerHTML]
tag[innerHTML]
tag#id
Examples:
a.className(href="http://example.com")[This is a link]
h3[This is a header]
code[Here is some code]
bq[This is a block quote]
Strong/emphasis:
*text*
_text_
Unordered:
* Item 1
* Item 2
* Item 3
Ordered:
# Item 1
# Item 2
# Item 3
Link shorthand:
a(http://)[Link text]
One parameter implies 'href'.
And, omission of 'a' should be supported too:
(http://)[Link text]
- Brackets can be escaped
- Lines that don't match are paragraphs
- Preformatted is escaped
- Spans, tables: not supported (why bother if the lightweight markup is harder to read than the original HTML?)
Not keen on the headers
I like the markdown approach with #
Maybe something like
.className Header 1
Not sure how that would work for id's though
I like it the code blocks and block quotes though.