lettuce render

~1 min read

lettuce render

Render a single Markdown file to HTML. Useful for one-off conversions, scripts, and previewing.

lettuce render [options] <input.md>

The input file is a positional argument. Output is always a full standalone HTML page.

Options

Flag Default Notes
--out PATH <input>.html Where to write the HTML
--title STRING (from frontmatter) Override page title

Examples

Quick preview:

lettuce render note.md && open note.html

Write to a specific path:

lettuce render note.md --out /tmp/note.html && open /tmp/note.html

With a custom title:

lettuce render --title "Release notes" CHANGELOG.md --out site/changelog.html

This is what Scripts/package.sh uses to publish the CHANGELOG alongside the docs.

In a script

#!/usr/bin/env bash
for note in Inbox/*.md; do
    out="rendered/$(basename "$note" .md).html"
    lettuce render --out "$out" "$note"
done

What it understands

lettuce render uses the same renderer as the app, so:

Non-published notes are still rendered (this is just a single-file command — published: is only consulted by lettuce publish).