diff --git a/.gitignore b/.gitignore index 24ed1fe..22b90c9 100644 --- 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 index 588b5be..7203ec7 100644 --- 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 new file mode 100644 index 0000000..972bf34 --- /dev/null +++ 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 index 475120b..265a14e 100644 --- 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)