diff --git a/cabal.project b/cabal.project index d810241ed92e..0afe50d737bd 100644 --- a/cabal.project +++ b/cabal.project @@ -7,3 +7,7 @@ flags: +embed_data_files constraints: skylighting-format-blaze-html >= 0.1.1.2, skylighting-format-context >= 0.1.0.2 +source-repository-package + type: git + location: https://github.com/pandoc/pandoc-lua-marshal.git + tag: 2dc58d431bb3e4d55999db03c470fbf32970b3d5 diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Chunks.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Chunks.hs index 33c2a92c2a6b..70209f45bf39 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Chunks.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Chunks.hs @@ -30,7 +30,7 @@ pushChunk :: LuaError e => Pusher e Chunk pushChunk = pushUD typeChunk typeChunk :: LuaError e => DocumentedType e Chunk -typeChunk = deftype "pandoc.Chunk" +typeChunk = deftype "Chunk" [ operation Tostring $ lambda ### liftPure show <#> udparam typeChunk "chunk" "chunk to print in native format" @@ -103,7 +103,7 @@ pushChunkedDoc = pushUD typeChunkedDoc -- | Lua type for 'ChunkedDoc' values. typeChunkedDoc :: LuaError e => DocumentedType e ChunkedDoc -typeChunkedDoc = deftype "pandoc.ChunkedDoc" +typeChunkedDoc = deftype "ChunkedDoc" [] [ readonly "chunks" "list of chunks that make up the document" diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/CommonState.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/CommonState.hs index f4abd575d7de..b0d2b0990c3e 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/CommonState.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/CommonState.hs @@ -22,7 +22,7 @@ import Text.Pandoc.Lua.Marshal.LogMessage (pushLogMessage) -- | Lua type used for the @CommonState@ object. typeCommonState :: LuaError e => DocumentedType e CommonState -typeCommonState = deftype "pandoc CommonState" [] +typeCommonState = deftype "CommonState" [] [ readonly "input_files" "input files passed to pandoc" (pushPandocList pushString, stInputFiles) diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/LogMessage.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/LogMessage.hs index ebc8abb3920c..752f136f781a 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/LogMessage.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/LogMessage.hs @@ -19,7 +19,7 @@ import qualified Data.Aeson as Aeson -- | Type definition for pandoc log messages. typeLogMessage :: LuaError e => DocumentedType e LogMessage -typeLogMessage = deftype "pandoc LogMessage" +typeLogMessage = deftype "LogMessage" [ operation Index $ defun "__tostring" ### liftPure showLogMessage <#> udparam typeLogMessage "msg" "object" diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Sources.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Sources.hs index 8224786f68d5..902c127f276f 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Sources.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Sources.hs @@ -25,7 +25,7 @@ import Text.Parsec (SourcePos, sourceName) pushSources :: LuaError e => Pusher e Sources pushSources (Sources srcs) = do pushList (pushUD typeSource) srcs - newListMetatable "pandoc Sources" $ do + newListMetatable "Sources" $ do pushName "__tostring" pushHaskellFunction $ do sources <- forcePeek $ peekList (peekUD typeSource) (nthBottom 1) @@ -43,7 +43,7 @@ peekSources idx = liftLua (ltype idx) >>= \case -- | Source object type. typeSource :: LuaError e => DocumentedType e (SourcePos, Text) -typeSource = deftype "pandoc input source" +typeSource = deftype "Source" [ operation Tostring $ lambda ### liftPure snd <#> udparam typeSource "srcs" "Source to print in native format" diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Template.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Template.hs index 8179d6504635..d0c29b71d9d8 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Template.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/Template.hs @@ -40,4 +40,4 @@ peekTemplate idx = liftLua (ltype idx) >>= \case -- | Template object type. typeTemplate :: LuaError e => DocumentedType e (Template Text) -typeTemplate = deftype "pandoc Template" [] [] +typeTemplate = deftype "Template" [] [] diff --git a/pandoc-lua-engine/test/lua/module/pandoc-structure.lua b/pandoc-lua-engine/test/lua/module/pandoc-structure.lua index af19785c92a5..ff2abba22c39 100644 --- a/pandoc-lua-engine/test/lua/module/pandoc-structure.lua +++ b/pandoc-lua-engine/test/lua/module/pandoc-structure.lua @@ -59,7 +59,7 @@ return { test('returns a chunked doc', function () assert.are_equal( pandoc.utils.type(structure.split_into_chunks(pandoc.Pandoc{})), - 'pandoc.ChunkedDoc' + 'ChunkedDoc' ) end), }, diff --git a/pandoc-lua-engine/test/lua/module/pandoc-template.lua b/pandoc-lua-engine/test/lua/module/pandoc-template.lua index 65e0798f5c38..36120159a724 100644 --- a/pandoc-lua-engine/test/lua/module/pandoc-template.lua +++ b/pandoc-lua-engine/test/lua/module/pandoc-template.lua @@ -55,14 +55,14 @@ return { test('returns a Template', function () assert.are_equal( pandoc.utils.type(template.compile('$title$')), - 'pandoc Template' + 'Template' ) end), test('returns a Template', function () local templ_path = pandoc.path.join{'lua', 'module', 'default.test'} assert.are_equal( pandoc.utils.type(template.compile('${ partial() }', templ_path)), - 'pandoc Template' + 'Template' ) end), test('fails if template has non-existing partial', function () @@ -76,7 +76,7 @@ return { assert.are_equal(type(jats_template), 'string') assert.are_equal( pandoc.utils.type(template.compile(jats_template)), - 'pandoc Template' + 'Template' ) end), }, diff --git a/stack.yaml b/stack.yaml index 21bbfdec2a1a..7728d23b2c72 100644 --- a/stack.yaml +++ b/stack.yaml @@ -20,12 +20,12 @@ extra-deps: - doctemplates-0.11.0.1 - typst-0.6 - hslua-module-doclayout-1.2.0 -- pandoc-lua-marshal-0.2.9 - djot-0.1.2.2 - texmath-0.12.8.11 - commonmark-0.2.6.1 - commonmark-pandoc-0.2.2.2 - +- git: https://github.com/pandoc/pandoc-lua-marshal + commit: 2dc58d431bb3e4d55999db03c470fbf32970b3d5 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-22.33