This is an example repository demonstrating how to embed Fennel to be used as a scripting language for writing Pandoc filters.
Fennel is a Lisp that compiles to Lua. It can be used in place of Lua but doing so to write Pandoc filters is not obvious and so I have put together this repo to demonstrate a basic example.
I prefer writing Lisp rather than Lua. You may too.
Also, I think there are some good patterns stored in this repo for using Pandoc in general, such as:
- Use a self-documenting Makefile to kick off tasks.
- Use config files for different build options.
It is assumed that you have installed the correct LaTeX dependencies
for your operation system as well as pandoc
and make
.
If this is true, just clone this repository.
Run the following command for a help menu of assorted options:
$ make
Built files will appear in the build
directory.
Please refer to the following documentation for programming in Fennel:
https://fennel-lang.org/tutorial
Please refer to the following documentation for writing Pandoc filters in Lua:
https://pandoc.org/lua-filters.html
The rest is up to you.
The entire Fennel language will be loaded from filters/fennel.lua
via the filters/fennel-loader.lua
script. The loader will import
our custom filter filters/myfilter.fnl
. This is setup in the
various build defaults in the configs
directory. The different
build options are specified in Makefile
.
The Fennel MIT license is included in the filters
directory. This
repo is also MIT licensed.