Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pandoc needs moar options.

  • Loading branch information...
commit 304adc936f2493c6cacd76cde57eed678808f04a 1 parent 83cc6c1
@romac romac authored
Showing with 19 additions and 13 deletions.
  1. +19 −13 Makefile
View
32 Makefile
@@ -1,27 +1,20 @@
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)
@@ -29,12 +22,25 @@ concat: cprsrc
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:
Please sign in to comment.
Something went wrong with that request. Please try again.