jsstanley / md2html

md2html is a bash program that creates html files with custom css from a specified directory of markdown files using pandoc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

███╗   ███╗██████╗ ██████╗ ██╗  ██╗████████╗███╗   ███╗██╗     
████╗ ████║██╔══██╗╚════██╗██║  ██║╚══██╔══╝████╗ ████║██║     
██╔████╔██║██║  ██║ █████╔╝███████║   ██║   ██╔████╔██║██║     
██║╚██╔╝██║██║  ██║██╔═══╝ ██╔══██║   ██║   ██║╚██╔╝██║██║     
██║ ╚═╝ ██║██████╔╝███████╗██║  ██║   ██║   ██║ ╚═╝ ██║███████╗
╚═╝     ╚═╝╚═════╝ ╚══════╝╚═╝  ╚═╝   ╚═╝   ╚═╝     ╚═╝╚══════╝

md2html is a bash program that creates html files with custom css from a specified directory of markdown files using pandoc.

Dependencies

  • pandoc 2.10.1
  • bash 5.0.17(1)-release

Installation

Ensure pandoc and bash that meet or exceed the version numbers noted above are installed on your system.

Clone the repo

git clone https://www.github.com/jsstanley/md2html.git/

Create an alias to use md2html easily (optional but recommended)

In your .bashrc file (usually found at ~/.bashrc), add:

alias md2html="FULL_PATH_TO_MD2HTML"

Reboot your machine or run the following in the terminal:

. ~/.bashrc

You should now be able to use md2html from anywhere on the command line.

Usage

An example css file (custom.css) has been provided in this repository.

md2html ~/notes/md/ ~/notes/css/

md2html requires two positional arguments:

  1. The absolute directory path containing the markdown files
  2. The absolute directory path containing the custom css file

md2html will create a directory of html files within the directory of markdown files that was specified. For the above example, the html directory would be ~/notes/md/html/.

License

© 2020 Jay Stanley. Released under the GNU General Public License, version 2 (GPLv2).

About

md2html is a bash program that creates html files with custom css from a specified directory of markdown files using pandoc

License:GNU General Public License v2.0


Languages

Language:Shell 59.2%Language:CSS 40.8%