Skip to content

Create nice standalone webpages from markdown.

License

Notifications You must be signed in to change notification settings

brian-dawn/leaf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Create nice standalone webpages from markdown.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published