Litemark
Litemark is a lightweight markup language based on Markdown. It's useful for writing content, documentation, blog articles, forum posts, etc.
Compared to Markdown, it has a somewhat simpler syntax and is extensible via Square Tags.
It is supported via the Litemark module, -Lite templates, and inside JCON.
Inline Markup
This is __italics__ This is **bold** This is **bold with __italic text__ inside** This is a `code tag` This is a long dash -- and "smart quotes".
code tag
This is a long dash — and “smart quotes”.Paragraphs
One or more blank lines separates text into paragraph blocks.
Here is a paragraph. Here is another. It has two sentences that go together.
Here is a paragraph.
Here is another. It has two sentences that go together.
Links
Links use a square tag with the URL as the first argument. The 2nd label argument is optional.
We use the [https://duckduckgo.com | DuckDuckGo] search engine.
Images
Images use the image
square tag.
A work of art: [image /images/artwork.jpg]
A work of art:
Lists
- Item 1 - Item 2 - Item 3 + Item 1 + Item 2 + Item 3
- Item 1
- Item 2
- Item 3
- Item 1
- Item 2
- Item 3
Headings
# Heading 1 ## Heading 2 ### Heading 3
Block Quotes
Note: Line breaks are preserved.
> This is a famous quote. > > -- Someone Famous
This is a famous quote.
— Someone Famous
Code Blocks
Start and end a line with three backticks.
``` let a = 123; if (a > 200) { doSomething(); } ```
let a = 123; if (a > 200) { doSomething(); }
HTML
HTML support is only intended for content authors, not for visitors posting comments, etc.
There are two places where HTML tags are passed through as-is:
- Inside of a Litemark template function.
- When calling
Litemark.parse
with the HTML argument set totrue
.
Example:
<div style="text-align: center"> **This is an <span style="color:orange">HTML styled</span> message.** </div>
This is an HTML styled message.
<div>{{ otherHtmlContent() }}</div>
Square Tags
Square tags [ ... ]
are similar to BBCode tags. They provide extra formatting via a uniform syntax and are extensible.
- [dfn DNA] is the code of life. - Press [kbd Ctrl-C] to copy the code. - Mutations are [del mistakes] happy accidents. - Never put Uranium[sup 238] in your H[sub 2]O. - Add a line break.[br]That is, if you need one.
- DNA is the code of life.
- Press Ctrl-C to copy the code.
- Mutations are
mistakeshappy accidents. - Never put Uranium238 in your H2O.
- Add a line break.
That is, if you need one.
Messages
[message | Just a regular callout.] [message Tip | Don't forget to tip your waitress.] [success Great | You pressed the button!] [error Error | You did something wrong.]
Table of Contents
The square tag [toc]
will insert an auto-generated table of contents, linking to your h2
headings.
Custom Square Tags (TODO)
Custom tags start with the command name, then optional arguments, and end with the text.
[command text] [command argument1 | text] [command argument2 | argument1 | text]
Aside: Why doesn't THT use Markdown?
Markdown was optimized to be readable in raw form, so it has a looser syntax and a lot of edge cases to support.
Because Litemark is simpler, it can be implemented in less code, and there is less syntax for users to remember.
Also, Markdown is only "extensible" via raw HTML, which is not as useful for sites where visitors are allowed to post content.