commit c05a1c57ae2dc6ec4e9b24ff5e93dff7cbd32c18
parent 69216b190a436d7e94b3a190b0440920e40b7be3
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Sat, 7 Jan 2017 04:21:29 +0100
PDF generation + some Makefile idiosyncrasies
Diffstat:
4 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1,2 +1,4 @@
.DS_Store
html/
+pdf/
+pdf-index.rkt
+\ No newline at end of file
diff --git a/README.md b/README.md
@@ -11,6 +11,7 @@ because I don't.
- [Multiple HTML files](http://www.greghendershott.com/fear-of-macros)
- [One big HTML file](http://www.greghendershott.com/fear-of-macros/all.html)
+- [One big PDF file](http://www.greghendershott.com/fear-of-macros/all.pdf)
## Feeback
diff --git a/gh.tex b/gh.tex
@@ -0,0 +1,2 @@
+\usepackage[normalem]{ulem}
+\let\strike=\sout
+\ No newline at end of file
diff --git a/makefile b/makefile
@@ -1,25 +1,55 @@
SCRBL=index.rkt
+PDF_SCRBL=pdf-index.rkt
+HTML_SINGLE=all.html
+# Since we don't know the names of the files, and they are all generated in one go,
+# we just point to the main index.html file (which is not generated by other targets)
+HTML_MULTI=index.html
+PDF_SINGLE=all.pdf
all: publish
clean:
- rm -rf html
+ rm -rf html $(PDF_SCRBL)
html: html-single html-multi
racket add-to-head.rkt
-html-single: $(SCRBL)
+.PHONY: html-single
+html-single: html/$(HTML_SINGLE)
+
+html/$(HTML_SINGLE): $(SCRBL)
raco scribble \
--html \
--dest html \
- --dest-name all.html \
+ --dest-name $(HTML_SINGLE) \
++style gh.css \
++main-xref-in \
--redirect-main http://docs.racket-lang.org/ \
\
$(SCRBL)
-html-multi: $(SCRBL)
+.PHONY: pdf
+pdf: html/$(PDF_SINGLE)
+
+$(PDF_SCRBL): index.rkt
+ # LaTeX chokes on this, let's just remove it for now.
+ sed -e 's/トランスフォーマ/@;{トランスフォーマ}/' index.rkt > $(PDF_SCRBL)
+
+html/$(PDF_SINGLE): $(PDF_SCRBL)
+ raco scribble \
+ --pdf \
+ --dest html \
+ --dest-name $(PDF_SINGLE) \
+ ++style gh.tex \
+ ++main-xref-in \
+ --redirect-main http://docs.racket-lang.org/ \
+ \
+ $(PDF_SCRBL)
+
+.PHONY: html-multi
+html-multi: html/$(HTML_MULTI)
+
+html/$(HTML_MULTI): $(SCRBL)
raco scribble \
--htmls \
--dest-name html \
@@ -37,7 +67,8 @@ pages:
@(echo 'Is the branch up to date? Press enter to continue.'; read dummy)
git clone -b gh-pages . pages
-publish: html pages
+.PHONY: publish
+publish: html/$(HTML_SINGLE) html/$(PDF_SINGLE) html/$(HTML_MULTI) pages
rm -rf pages/*
cp -r html/. pages/.
(cd pages; git add -A)