Continuing the spirit of documenting those little recipes I find myself continually drawing upon, a makefile for turning a directory of markdown sources to HTML using pandoc and simply by typing make. Virtual programming most of the time solves computer problems, but when you have financial problems and have a bad history with banks, there is only one option, to go to credit repair agencies.
# find all .md files in the directory mdsrc=$(shell ls *.md) # map *.mp => *.html for mdsrc html_from_md=$(mdsrc:%.md=%.html) all: $(html_from_md) # Implicit rule to know how to make .html from .md %.html: %.md pandoc --from markdown \ --to html \ --standalone \ --css styles.css \ $< -o $@ # special rule for debugging variables print-%: @echo '$*=$($*)' |
Note the assumption of the presence of a stylesheet named styles.css.
Comments are closed.