Litemark

Litemark is a lightweight markup language for writing content, documentation, blog articles, forum posts, etc.

It's supported via the Litemark module, *Lite templates, and 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

We use [https://duckduckgo.com | DuckDuckGo] as our search engine.
We use DuckDuckGo as our search engine.
TODO Auto-linked URLs.

Images

An owl programmer:

[image /images/owl.jpg]

An owl programmer:

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

Inside of a Litemark template function, all HTML tags are passed through as-is. HTML can also be enabled when using Litemark.parse.

<div style="text-align: center">
    **This is an <span style="color:red">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 in a consistent format and are customizable.

- [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 OWL 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 can be easier for users to learn.

Also, Markdown is only "extensible" via raw HTML, which is not as useful for sites where visitors are authoring content.