pandoc-lua-filters/margin-notes/Makefile

24 lines
825 B
Makefile
Raw Normal View History

2022-04-03 16:38:42 +01:00
.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
2022-06-12 11:33:43 +01:00
test: margin-notes.lua sample.md
pandoc -t native -L margin-notes.lua sample.md > test/tmp.native
diff test/tmp.native test/sample.native
2022-04-03 16:38:42 +01:00
@echo -e '\n===============\ntest passed.\n===============\n'
rm test/tmp.native