A tool for generating standalone HTML articles/blog posts from markdown that are designed to last.
Hosted on SourceHut but also hosted on Github for convenience. If you're curious why SourceHut is neat check out this.
- 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).
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
If you don't want to use docker, all you need is pandoc. From this repo run:
./leaf blogpost.md blogpost.html
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...
Because this is pandoc markdown we can do some extra things with it. For example we can render math:
Or tables:
Ingredients Amount ----------- ------ Flour 1 cup Water 1 cup --------------------------Table: Table Example