From 2413d436ed98866e9a70fbd4070a5da52dd97cd5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 8 Jan 2016 12:15:31 -0800 Subject: New format for spec tests, new lua formatter for specs. The format for the spec examples has changed from . markdown . html . to ```````````````````````````````` example markdown . html ```````````````````````````````` One advantage of this is that `spec.txt` becomes a valid Markdown file. `tests/spec_test.py` has been changed to use the new format. The old `tools/makespec.py` has been replaced by a lua program, `tools/make_spec.lua`, which uses the `lcmark` rock (and indirectly libcmark). It can generate html, latex, and commonmark versions of the spec. Pandoc is no longer needed for the latex/PDF version. And, since the new program uses the cmark API and operates directly on the parse tree, we avoid certain bad results we got with the regex replacements done by the python script. --- Makefile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f50996b..af6bb36 100644 --- a/Makefile +++ b/Makefile @@ -2,20 +2,21 @@ SPEC=spec.txt SITE=_site SPECVERSION=$(shell perl -ne 'print $$1 if /^version: *([0-9.]+)/' $(SPEC)) -.PHONY: spec update-site upload-site +.PHONY: spec clean -spec: spec.html # spec.pdf +spec: spec.html # spec.pdf spec.md -spec.md: $(SPEC) - python3 tools/makespec.py markdown > $@ +spec.md: spec.txt tools/template.commonmark + lua tools/make_spec.lua commonmark < $< > $@ spec.html: spec.txt tools/template.html - python3 tools/makespec.py html > $@ + lua tools/make_spec.lua html < $< > $@ -spec.pdf: spec.md tools/template.tex tools/specfilter.hs - pandoc -s $< --template tools/template.tex \ - --filter tools/specfilter.hs -o $@ --latex-engine=xelatex --toc \ - --number-sections --toc-depth=2 --no-highlight \ - -V documentclass=report \ - -V classoption=twosides +spec.tex: spec.txt tools/template.latex + lua tools/make_spec.lua latex < $< > $@ +spec.pdf: spec.tex + xelatex $< + +clean: + -rm spec.tex spec.md spec.html -- cgit v1.2.3