LHTML+ lhtml-site

Lists

A line that starts with * and a space is an item of a list.

A list and a nested list
LHTML
* First item
* Second item
** A nested item
** Another one
* Back to the first level
Result
HTML produced
<ul>
<li>
First item
</li>
<li>
Second item
<ul>
<li>
A nested item
</li>
<li>
Another one
</li>
</ul>
</li>
<li>
Back to the first level
</li>
</ul>
  • Each * adds a level: *** is level 3.
  • A nested list is placed inside the item before it, as HTML expects.
  • - and 1. do not make a list in LHTML: such lines stay text.

An item is one line

A list ends at the first line that is not an item. Keep each item on its line, however long:

The second line ends the list
LHTML
* An item on one line
* An item cut
in two lines
Result
HTML produced
<ul>
<li>
An item on one line
</li>
<li>
An item cut
</li>
</ul>
in two lines

The line in two lines is no longer in the list: it follows it, as text.

Formatting inside an item

An item can hold bold, italic, links, inline code, even a styled span:

LHTML
* **Monday**: read __chapter 2__
* **Tuesday**: run `make test`
* **Friday**: span::[color:#b4232c;] deadline ::
Result
HTML produced
<ul>
<li>
<strong>Monday</strong>: read <em>chapter 2</em>
</li>
<li>
<strong>Tuesday</strong>: run <code class="code-inline">make test</code>
</li>
<li>
<strong>Friday</strong>: <span style="color:#b4232c;"> deadline </span>
</li>
</ul>

What an item opens closes on its line, as the span here: a block of several lines does not fit in an item.

A numbered list

LHTML has no symbol for it: write the HTML, which is kept as it is.

LHTML
<ol>
<li>Install</li>
<li>Write</li>
<li>Build</li>
</ol>
Result
HTML produced
<ol>
<li>Install</li>
<li>Write</li>
<li>Build</li>
</ol>

Next: Text. All the rules: Syntax reference.

Built with lhtml-site, the docs theme. Part of ScholarTools.