From 535afc08febf42fb984e7115bf7a947985690e41 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 8 Nov 2014 20:24:32 -0800 Subject: Spec: better system for designating definitions of terms. `[foo](@foo)` turns into an anchor with id `foo` that links to itself and has class `definition`. This allows us to remove the manual `` tags in `spec.txt`. A simple regex substitution in the Makefile handles the transformation. I believe this addresses some of the concerns in #141 by giving the definitions a prominent appearance. Note that we want definitions to link to themselves, to allow users to quickly generate a link to the relevant bit of the spec. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index afe939e..5f9cb34 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,10 @@ spec.md: $(SPEC) perl spec2md.pl < $< > $@ spec.html: spec.md template.html - pandoc --no-highlight --number-sections --template template.html -s --toc -S $< > $@ # | perl -pe 's/␣/ <\/span>/g' > $@ + pandoc --no-highlight --number-sections --template template.html -s --toc -S $< | \ + perl -pe 's/a href="@([^"]*)"/a id="\1" href="#\1" class="definition"/g' > $@ + + # | perl -pe 's/␣/ <\/span>/g' > $@ spec.pdf: spec.md template.tex specfilter.hs pandoc -s $< --template template.tex \ -- cgit v1.2.3