Skip to content

Commit

Permalink
pandoc needs moar options.
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Nov 27, 2011
1 parent 83cc6c1 commit 304adc9
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions Makefile
@@ -1,40 +1,46 @@

TEMP_DIR:=$(shell mktemp -d -t /tmp)
PANDOC=pandoc
PREPROCESS=python _scripts/preprocess.py
BUILD_DIR=_build
ASSETS_DIR=_assets
MD_OUTPUT=documentation.md
HTML_OUTPUT=Documentation.html
HTML_OUTPUT=index.html

all: convert build
all: md2html build
@echo '-- The documentation has been successfully generated.'

build:
@echo -n '-- Copying the required assets into the build folder...'
@cp _assets/stylesheet.css $(BUILD_DIR)/
@cat $(TEMP_DIR)/highlight.css >> $(BUILD_DIR)/stylesheet.css
@cat _assets/header.html $(TEMP_DIR)/$(HTML_OUTPUT) _assets/footer.html > _build/index.html
@echo ' Done.'

cprsrc:
@echo -n '-- Copying the required assets into the temp folder...'
@ditto 0*.md* $(TEMP_DIR)/
@echo ' Done.'

convert: md2html

concat: cprsrc
@echo -n '-- Concatenating the Markdown files...'
@cat $(TEMP_DIR)/0*.md > $(TEMP_DIR)/$(MD_OUTPUT)
@echo ' Done.'

preprocess:
@echo -n '-- Syntax-highlighting code blocks...'
@python _scripts/preprocess.py $(TEMP_DIR)/$(MD_OUTPUT) $(TEMP_DIR)
@$(PREPROCESS) $(TEMP_DIR)/$(MD_OUTPUT) $(TEMP_DIR)
@echo ' Done.'

md2html: concat preprocess
@echo -n '-- Converting the Markdown document to HTML...'
@$(PANDOC) --html5 --toc -o $(TEMP_DIR)/$(HTML_OUTPUT) $(TEMP_DIR)/$(MD_OUTPUT)
@$(PANDOC) --standalone \
--html5 \
--toc \
--css=stylesheet.css \
--template=$(ASSETS_DIR)/template.html \
--include-before-body=_assets/header.html
-o $(BUILD_DIR)/$(HTML_OUTPUT) \
$(TEMP_DIR)/$(MD_OUTPUT)
@echo ' Done.'

build:
@echo -n '-- Copying the required assets into the build folder...'
@cp $(ASSETS_DIR)/stylesheet.css $(BUILD_DIR)/
@cat $(TEMP_DIR)/highlight.css >> $(BUILD_DIR)/stylesheet.css
@echo ' Done.'

clean:
Expand Down

0 comments on commit 304adc9

Please sign in to comment.