Skip to content

Instantly share code, notes, and snippets.

@cderv
Last active April 9, 2021 08:50
Show Gist options
  • Save cderv/ca24d2681b0a1c4b6f91e0b49d725f36 to your computer and use it in GitHub Desktop.
Save cderv/ca24d2681b0a1c4b6f91e0b49d725f36 to your computer and use it in GitHub Desktop.
import a script in a Pandoc lua filter
-- MIT LICENCE - 2021 Christophe Dervieux
-- Only works with Pandoc 2.1.2+ because of PANDOC_SCRIPT_FILE availability
function import(script)
local PATH_SEP = package.config:sub(1,1)
local path = PANDOC_SCRIPT_FILE:match("(.*"..PATH_SEP..")")
dofile(path .. script)
end
import("utils.lua")
print("hi, I am utils.lua")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment