Last active
April 9, 2021 08:50
-
-
Save cderv/ca24d2681b0a1c4b6f91e0b49d725f36 to your computer and use it in GitHub Desktop.
import a script in a Pandoc lua filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("hi, I am utils.lua") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment