lettuce render
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:
Wikilinks resolve against the surrounding files.
Mermaid and KaTeX work.
Callouts work.
Frontmatter sets
<title>,<meta>, etc.
Non-published notes are still rendered (this is just a single-file command — published: is only consulted by lettuce publish).
Related
CLI cookbook/03 lettuce publish — full vault build
Publishing/02 The static site — what the renderer does