Coder Social home page Coder Social logo

leaf's Introduction

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

leaf's People

Contributors

brian-dawn avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.