summaryrefslogtreecommitdiff
path: root/paper/lua-filters/track-changes/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'paper/lua-filters/track-changes/Makefile')
-rw-r--r--paper/lua-filters/track-changes/Makefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/paper/lua-filters/track-changes/Makefile b/paper/lua-filters/track-changes/Makefile
new file mode 100644
index 0000000..990450e
--- /dev/null
+++ b/paper/lua-filters/track-changes/Makefile
@@ -0,0 +1,26 @@
+.PHONY: test clean
+
+## PENDING: ensure that LaTeX output can be compiled to PDF.
+test: sample.md test-track-changes.sh sample.pdf
+ @pandoc -t markdown --wrap=preserve \
+ --lua-filter=track-changes.lua sample.md | \
+ diff --strip-trailing-cr -u - expected_accept.markdown
+ @pandoc -t markdown --wrap=preserve --track-changes=reject \
+ -M trackChanges:reject --lua-filter=track-changes.lua sample.md | \
+ diff --strip-trailing-cr -u - expected_reject.markdown
+ @pandoc -s -t html --wrap=preserve --track-changes=all \
+ -M trackChanges:all --lua-filter=track-changes.lua sample.md | \
+ diff --strip-trailing-cr -u - expected_draft.html
+ @pandoc -M trackChanges:all --track-changes=all --wrap=preserve \
+ --to=latex --lua-filter=track-changes.lua \
+ --standalone sample.md | \
+ sh test-track-changes.sh
+ @rm sample.pdf
+
+sample.pdf: sample.md track-changes.lua
+ @pandoc -M trackChanges:all --track-changes=all \
+ --lua-filter=track-changes.lua \
+ --output $@ $<
+
+clean:
+ rm sample.pdf || true