PDF generation + some Makefile idiosyncrasies
This commit is contained in:
parent
69216b190a
commit
c05a1c57ae
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
|||
.DS_Store
|
||||
html/
|
||||
pdf/
|
||||
pdf-index.rkt
|
|
@ -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
|
||||
|
||||
|
|
41
makefile
41
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user