Last active
June 15, 2016 12:32
-
-
Save tobbe11/b164131cf2611034792c142e2d45ab30 to your computer and use it in GitHub Desktop.
Simple Makefile for markdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # in your Makefile include H:\prj\inc.makefile | |
| # in Vim set makeprg=d:/path/to/bin/mingw32-make | |
| PANDOC_PATH = D:\prg\Pandoc | |
| PANDOC = $(PANDOC_PATH)\pandoc.exe | |
| PP = D:\prg\pp\pp.exe | |
| PLANTUML = java -jar "D:\prg\plantuml\plantuml.jar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include H:\prj\inc.makefile | |
| SOURCES = $(wildcard *.md) | |
| TARGETS = $(patsubst %.pu,%.png,$(wildcard *.pu)) | |
| TARGETS += $(patsubst %.md,%.html,$(SOURCES)) | |
| DOCPATH = \\networkpath\doc | |
| .PHONY: all clean install | |
| all: ${TARGETS} | |
| install: ${TARGETS} | |
| copy /y *.html ${DOCPATH} | |
| %.png: %.pu | |
| ${PLANTUML} $< | |
| %.html: %.md | |
| type $< | ${PP} | \ | |
| $(PANDOC) -o $@ --template ${PANDOC_PATH}/templates/bootstrap.html \ | |
| --css ${PANDOC_PATH}/templates/bootstrap.css --self-contained --toc --toc-depth 2 | |
| .PHONY: clean | |
| clean: | |
| -del ${TARGETS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment