diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2018-01-07 14:06:34 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2018-01-07 14:06:34 +0100 |
commit | f5dec4bdc12e5ba895458ba117e0966a78b3c790 (patch) | |
tree | 05963f97344999ef8be141345e2dcbcd95a30bd6 /src/Text | |
parent | 043740d32baa9bf5c58409c2a8ace5a196283fa8 (diff) | |
download | pandoc-f5dec4bdc12e5ba895458ba117e0966a78b3c790.tar.gz |
Lua: make pandoc-types version available as PANDOC_API_VERSION
The current pandoc-types version is made available to Lua programs in
the global PANDOC_API_VERSION. It contains the version as a list of
numbers.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Lua/Init.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs index 5e879114f..f3ee2caf1 100644 --- a/src/Text/Pandoc/Lua/Init.hs +++ b/src/Text/Pandoc/Lua/Init.hs @@ -41,6 +41,7 @@ import GHC.IO.Encoding (getForeignEncoding, setForeignEncoding, utf8) import Paths_pandoc (version) import Text.Pandoc.Class (PandocIO, getCommonState, getUserDataDir, getMediaBag, setMediaBag) +import Text.Pandoc.Definition (pandocTypesVersion) import Text.Pandoc.Lua.Packages (LuaPackageParams (..), installPandocPackageSearcher) import Text.Pandoc.Lua.Util (loadScriptFromDataDir) @@ -79,5 +80,7 @@ initLuaState luaPkgParams = do Lua.preloadTextModule "text" Lua.push (versionBranch version) Lua.setglobal "PANDOC_VERSION" + Lua.push (versionBranch pandocTypesVersion) + Lua.setglobal "PANDOC_API_VERSION" installPandocPackageSearcher luaPkgParams loadScriptFromDataDir (luaPkgDataDir luaPkgParams) "init.lua" |