From 786594b23be4a757e95776f782527c8a98fbaab5 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 4 May 2019 07:06:30 +0200 Subject: Lua: add `pandoc.system` module (#5468) The `system` Lua module provides utility functions to interact with the operating- and file system. E.g. print(pandoc.system.get_current_directory()) or pandoc.system.with_temporary_directory('tikz', function (dir) -- write and compile a TikZ file with pdflatex end) --- src/Text/Pandoc/Lua/Packages.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Text/Pandoc/Lua/Packages.hs') diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index fdfa2238a..5f2751f52 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -25,6 +25,7 @@ import Text.Pandoc.Class (readDataFile, runIO, setUserDataDir) import qualified Foreign.Lua as Lua import Text.Pandoc.Lua.Module.Pandoc as Pandoc import Text.Pandoc.Lua.Module.MediaBag as MediaBag +import Text.Pandoc.Lua.Module.System as System import Text.Pandoc.Lua.Module.Utils as Utils -- | Parameters used to create lua packages/modules. @@ -52,6 +53,7 @@ pandocPackageSearcher pkgParams pkgName = "pandoc" -> let datadir = luaPkgDataDir pkgParams in pushWrappedHsFun (Pandoc.pushModule datadir) "pandoc.mediabag" -> pushWrappedHsFun MediaBag.pushModule + "pandoc.system" -> pushWrappedHsFun System.pushModule "pandoc.utils" -> let datadir = luaPkgDataDir pkgParams in pushWrappedHsFun (Utils.pushModule datadir) _ -> searchPureLuaLoader -- cgit v1.2.3