Created
February 11, 2015 13:24
-
-
Save fiedsch/2904c9a0d4102ea20056 to your computer and use it in GitHub Desktop.
pretty print Contao documentation with LaTeX
This file contains 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
# Die Contao Dokumentantion (Manual und Cookbook) | |
# als "hübsch" formatierte Dokumentation (PDF) erstellen. | |
# Quellen (Markdown Dokumente) | |
MDCOOKBOOK=./docs/cookbook/de | |
MDMANUAL=./docs/manual/de | |
OUT=./latex | |
COOKBOOK=$(OUT)/Autoloading.tex \ | |
$(OUT)/Benutzer-Authentifizierung-und-Rechtepruefung.tex \ | |
$(OUT)/Cronjobs-in-Contao.tex \ | |
$(OUT)/Eigene-Inserttags.tex \ | |
$(OUT)/Hooks-in-Contao.tex \ | |
$(OUT)/Inhaltselemente-verwenden.tex \ | |
$(OUT)/Models.tex \ | |
$(OUT)/Toggle-Funktion-in-eigenen-Erweiterungen.tex | |
MANUAL=$(OUT)/01-Installation.tex \ | |
$(OUT)/02-Administration-area.tex \ | |
$(OUT)/03-Managing-pages.tex \ | |
$(OUT)/04-Managing-content.tex \ | |
$(OUT)/05-System-administration.tex \ | |
$(OUT)/06-Data-Container-Arrays.tex \ | |
$(OUT)/07-Customizing-Contao.tex \ | |
$(OUT)/08-Extension-Repository.tex \ | |
$(OUT)/09-Contao-development.tex | |
# Markdown nach LaTeX konvertieren | |
MDTOLATEX=perl ./html-table2pandoc.pl | pandoc --from markdown --parse-raw --to latex | |
# Die Konvertierungsschritte: | |
# | |
# sed -i '' -e 's/\?raw=true//g' # ?raw=true bei Bildlinks entfernen | |
# | |
# MDTOLATEX von markdown mit inline HTML-Tabellen zu markdown mit Tabellen als markdown | |
# code und dann weiter nach LaTeX. Für das verwendete html-table2pandoc.pl | |
# siehe z.B. https://github.com/mithro/media2iki/blob/master/htmltable2pandoc.pl | |
# TeX Dateien für das Cookbook erstellen | |
$(OUT)/%.tex: $(MDCOOKBOOK)/%.md | |
cat $< | sed -e 's/\?raw=true//g' | $(MDTOLATEX) --output $(OUT)/`basename $< .md`.tex | |
# TeX Dateien für das Manual erstellen | |
$(OUT)/%.tex: $(MDMANUAL)/%.md | |
cat $< | sed -e 's/\?raw=true//g' | $(MDTOLATEX) --output $(OUT)/`basename $< .md`.tex | |
# Cookbook (PDF) erstellen | |
cookbook: $(OUT)/cookbook.tex $(COOKBOOK) | |
( cd $(OUT) && xelatex cookbook && xelatex cookbook ) | |
# Manual (PDF) erstellen | |
manual: $(OUT)/cookbook.tex $(MANUAL) | |
( cd $(OUT) && xelatex manual && xelatex manual ) | |
books: clean cookbook manual | |
# Aufräumen (nur cookbook.{pdf,tex} und manual.{pdf,tex} übrig lassen | |
clean: | |
( cd $(OUT) ; rm -f 0?-*.tex *-*.tex ) | |
( cd $(OUT) ; rm -f Models.tex Autoloading.tex ) | |
( cd $(OUT) ; rm -f *.aux *.log *.toc *.out ) | |
## EOF ## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment