pandoc-lua-filters/margin-notes/Makefile
2022-04-03 17:38:42 +02:00

24 lines
829 B
Makefile

.PHONY: test test-internal test-fr test-en
SHELL=/bin/bash
nblines := $(shell wc -l margin-notes.lua | cut -d ' ' -f 1)
but_four_last_lines := $(shell echo $$(($(nblines) - 4)))
test: test test-internal
test-internal: margin-notes.lua test/test-functions.lua
-rm --interactive=never test/tmp.lua
sed -n 1,$(but_four_last_lines)p margin-notes.lua > test/tmp.lua
cat test/test-functions.lua >> test/tmp.lua
chmod -w test/tmp.lua
pandoc -L test/tmp.lua <<< ''
@echo -e '==========================\nAll internal tests passed.\n==========================\n'
rm --interactive=never test/tmp.lua
test: margin-notes.lua test/test.md
pandoc -t native -L margin-notes.lua test/test.md > test/tmp.native
diff test/tmp.native test/test.native
@echo -e '\n===============\ntest passed.\n===============\n'
rm test/tmp.native