leaf 🍃

A tool for generating standalone HTML articles/blog posts from markdown that are designed to last.

Example.

Hosted on SourceHut but also hosted on Github for convenience. If you’re curious why SourceHut is neat check out this.

Features

Usage with Docker

If you want to use a prebuilt image all you need to do is run (note you’ll need to mount any local resources like images and whatnot):

cat blogpost.md | docker run -i briandawn/leaf > blogpost.html

If you want to customize the footer or css first build the docker image, you only need to do this once.

docker build -t leaf .

Now you can stamp out pages with:

cat blogpost.md | docker run -i leaf > blogpost.html

Usage without Docker

If you don’t want to use docker, all you need is pandoc. From this repo run:

./leaf blogpost.md blogpost.html

Adding a Title

Pandoc will read in yaml headers and read metadata off of that. For example to set a title you can do:

---
title: My Title
---

Rest of the markdown here...

Extra Features

Because this is pandoc markdown we can do some extra things with it. For example we can render math:

F=1NfiFi{\langle F\rangle=\frac{1}{N_f}\sum_i F_i}

Or tables:

Table Example
Ingredients Amount
Flour 1 cup
Water 1 cup