Skip to content

Instantly share code, notes, and snippets.

@slaymaker1907
Created May 18, 2018 23:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slaymaker1907/6b24f508bbad190e78b618efd54726b4 to your computer and use it in GitHub Desktop.
Save slaymaker1907/6b24f508bbad190e78b618efd54726b4 to your computer and use it in GitHub Desktop.
Poor Mans Pandoc Wiki
SOURCES=$(wildcard **/*.md) $(wildcard *.md)
HTML=$(patsubst %.md, build/%.html, $(SOURCES))
all: $(HTML)
build/%.html: %.md
mkdir --parents $(dir $@)
pandoc -s $< -o $@
.PHONY:
clean:
rm -rf ./build
@slaymaker1907
Copy link
Author

slaymaker1907 commented May 18, 2018

The idea behind this is to have a bunch of markdown files in the same directory as this file (as well as any subdirectories). It converts them into HTML and puts them in a build directory. I created this because I wanted a quick and easy way to write notes as hypertext without having to write raw HTML.

Setup

  1. Install Pandoc, Latex is not necessary since this renders HTML.
  2. Put this Makefile in the root directory of your notes/project.
  3. Run make all to convert all markdown .md files into HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment