LHTML+ lhtml-site

Text

Paragraphs and line breaks

A blank line does not make a paragraph, and a line break in the source is not a line break in the page. The reason: LHTML is HTML-first. What is not one of its symbols is HTML, and a browser reading HTML joins the lines of the source, blank lines included. LHTML keeps that rule, so that the HTML you write or paste behaves as it does everywhere else.

Lines are joined
LHTML
A first line
and a second one.

A line after a blank line.
Result
HTML produced
A first line
and a second one.

A line after a blank line.

To separate them, write the paragraphs and the line breaks in HTML, with <p> and <br>:

Paragraphs and a line break in HTML
LHTML
<p>A first paragraph.</p>
<p>A second paragraph,<br>
on two lines.</p>
Result
HTML produced
<p>A first paragraph.</p>
<p>A second paragraph,<br>
on two lines.</p>

Or render every line break of the source: the option line-breaks: true in the configure.yaml of lhtml-site, or -b for the lhtml command. Each line break then becomes a <br>, blank lines included; headings, lists and blocks get none.

Bold, italic and inline code

LHTML
This is **bold**, this is __italic__,
and this is `inline code`.
Result
HTML produced
This is <strong>bold</strong>, this is <em>italic</em>,
and this is <code class="code-inline">inline code</code>.
  • **...** is <strong>, __...__ is <em>. They nest (**bold __and italic__**), but do not cross.
  • Bold and italic stay on their line: a ** opened on one line and closed on the next is left as text, with a warning.

Inline code is literal

Nothing between backquotes is converted: neither **, nor __, nor a tag. Its < and > are shown as they are.

Code shown as written
LHTML
Write `**bold**` to get **bold**.
A list of floats: `std::vector<float>`.
Result
HTML produced
Write <code class="code-inline">**bold**</code> to get <strong>bold</strong>.
A list of floats: <code class="code-inline">std::vector&lt;float&gt;</code>.

Outside the backquotes, <float> would be read as an HTML tag, which the browser does not show.

A space

::nl is a one-line vertical space:

LHTML
Above
::nl
Below
Result
HTML produced
Above
<div style="height:1em;"></div>
Below

Slide themes have a gap:: macro for spaces of several sizes: gap::s, gap::, gap::l, gap::xl (see Your own tags: macros).

Next: Blocks and styles. All the rules: Syntax reference.

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