Skip to content

Latest commit

 

History

History
66 lines (39 loc) · 1.86 KB

README.md

File metadata and controls

66 lines (39 loc) · 1.86 KB

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

  • Pure self contained HTML/CSS. Even images get base64 encoded and embedded into the resulting HTML. This makes it really easy to share or host the page.
  • Support for dark and light color preferences (using the CSS prefers dark/light media selectors).

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:

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

Or tables:

Ingredients Amount ----------- ------ Flour 1 cup Water 1 cup --------------------------

Table: Table Example