diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2019-05-19 15:26:00 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2019-05-29 10:07:43 +0200 |
commit | 505f5bf5d951a5c4342f7acce9bea5f260dc9d78 (patch) | |
tree | 3b201baedf4003cdb17fa58c444bbb158faf213d /src/Text/Pandoc/Lua/Packages.hs | |
parent | d07ed83d705df491bba7b295bd5e80629d971685 (diff) | |
download | pandoc-505f5bf5d951a5c4342f7acce9bea5f260dc9d78.tar.gz |
Lua: add Version type to simplify comparisons
Version specifiers like `PANDOC_VERSION` and `PANDOC_API_VERSION` are
turned into `Version` objects. The objects simplify version-appropriate
comparisons while maintaining backward-compatibility.
A function `pandoc.types.Version` is added as part of the newly
introduced module `pandoc.types`, allowing users to create version
objects in scripts.
Diffstat (limited to 'src/Text/Pandoc/Lua/Packages.hs')
-rw-r--r-- | src/Text/Pandoc/Lua/Packages.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Lua/Packages.hs b/src/Text/Pandoc/Lua/Packages.hs index 5f2751f52..ca1779e27 100644 --- a/src/Text/Pandoc/Lua/Packages.hs +++ b/src/Text/Pandoc/Lua/Packages.hs @@ -26,6 +26,7 @@ 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.Types as Types import Text.Pandoc.Lua.Module.Utils as Utils -- | Parameters used to create lua packages/modules. @@ -54,6 +55,7 @@ pandocPackageSearcher pkgParams pkgName = in pushWrappedHsFun (Pandoc.pushModule datadir) "pandoc.mediabag" -> pushWrappedHsFun MediaBag.pushModule "pandoc.system" -> pushWrappedHsFun System.pushModule + "pandoc.types" -> pushWrappedHsFun Types.pushModule "pandoc.utils" -> let datadir = luaPkgDataDir pkgParams in pushWrappedHsFun (Utils.pushModule datadir) _ -> searchPureLuaLoader |