Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

pandoc needs moar options.

  • Loading branch information...
commit 304adc936f2493c6cacd76cde57eed678808f04a 1 parent 83cc6c1
Romain Ruetschi authored November 27, 2011

Showing 1 changed file with 19 additions and 13 deletions. Show diff stats Hide diff stats

  1. 32  Makefile
32  Makefile
... ...
@@ -1,27 +1,20 @@
1 1
 
2 2
 TEMP_DIR:=$(shell mktemp -d -t /tmp)
3 3
 PANDOC=pandoc
  4
+PREPROCESS=python _scripts/preprocess.py
4 5
 BUILD_DIR=_build
  6
+ASSETS_DIR=_assets
5 7
 MD_OUTPUT=documentation.md
6  
-HTML_OUTPUT=Documentation.html
  8
+HTML_OUTPUT=index.html
7 9
 
8  
-all: convert build
  10
+all: md2html build
9 11
 	@echo '-- The documentation has been successfully generated.'
10 12
 
11  
-build:
12  
-	@echo -n '-- Copying the required assets into the build folder...'
13  
-	@cp _assets/stylesheet.css $(BUILD_DIR)/
14  
-	@cat $(TEMP_DIR)/highlight.css >> $(BUILD_DIR)/stylesheet.css
15  
-	@cat _assets/header.html $(TEMP_DIR)/$(HTML_OUTPUT) _assets/footer.html > _build/index.html
16  
-	@echo ' Done.'
17  
-
18 13
 cprsrc:
19 14
 	@echo -n '-- Copying the required assets into the temp folder...'
20 15
 	@ditto 0*.md* $(TEMP_DIR)/
21 16
 	@echo ' Done.'
22 17
 
23  
-convert: md2html
24  
-
25 18
 concat: cprsrc
26 19
 	@echo -n '-- Concatenating the Markdown files...'
27 20
 	@cat $(TEMP_DIR)/0*.md > $(TEMP_DIR)/$(MD_OUTPUT)
@@ -29,12 +22,25 @@ concat: cprsrc
29 22
 
30 23
 preprocess:
31 24
 	@echo -n '-- Syntax-highlighting code blocks...'
32  
-	@python _scripts/preprocess.py $(TEMP_DIR)/$(MD_OUTPUT) $(TEMP_DIR)
  25
+	@$(PREPROCESS) $(TEMP_DIR)/$(MD_OUTPUT) $(TEMP_DIR)
33 26
 	@echo ' Done.'
34 27
 
35 28
 md2html: concat preprocess
36 29
 	@echo -n '-- Converting the Markdown document to HTML...'
37  
-	@$(PANDOC) --html5 --toc -o $(TEMP_DIR)/$(HTML_OUTPUT) $(TEMP_DIR)/$(MD_OUTPUT)
  30
+	@$(PANDOC)  --standalone \
  31
+				--html5 \
  32
+				--toc \
  33
+				--css=stylesheet.css \
  34
+				--template=$(ASSETS_DIR)/template.html \
  35
+				--include-before-body=_assets/header.html
  36
+				-o $(BUILD_DIR)/$(HTML_OUTPUT) \
  37
+				$(TEMP_DIR)/$(MD_OUTPUT)
  38
+	@echo ' Done.'
  39
+
  40
+build:
  41
+	@echo -n '-- Copying the required assets into the build folder...'
  42
+	@cp $(ASSETS_DIR)/stylesheet.css $(BUILD_DIR)/
  43
+	@cat $(TEMP_DIR)/highlight.css >> $(BUILD_DIR)/stylesheet.css
38 44
 	@echo ' Done.'
39 45
 
40 46
 clean:

0 notes on commit 304adc9

Please sign in to comment.
Something went wrong with that request. Please try again.