THT is in early Beta. We welcome contributors & feedback.

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".
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”.

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.
We use the DuckDuckGo search engine.
TODO Auto-linked URLs.

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
  1. Item 1
  2. Item 2
  3. Item 3
TODO Nested lists.

Headings

# Heading 1
## Heading 2
### Heading 3
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();
}
TODO Custom language classes.

HTML

HTML support is only intended for content owners, not for visitors posting comments, etc.

There are two places where HTML tags are passed through as-is:

  1. Inside of a Litemark template function.
  2. When calling Litemark.parse with the HTML argument set to true.

Example:

<div style="text-align: center">
    **This is an <span style="color:orange">HTML styled</span> message.**
</div>

This is an HTML styled message.

Caution In template functions, the Litemark parser processes the body after the placeholders are substituted in. This means you might need to wrap the HTML placeholder in an extra set of HTML tags.
<div>{{ otherHtmlContent() }}</div>
TODO Litemark doesn't support HTML shortcut tags like <...>> yet.

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.

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.]
Just a regular callout.
TipDon’t forget to tip your waitress.
GreatYou pressed the button!
ErrorYou 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.