diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-10-26 14:40:11 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-10-26 14:40:11 +0200 |
commit | f56d8706312df64d3956cea0c93768b51192958e (patch) | |
tree | 974b98342187a9b6db1fac01e9a085dab493e34c /src/Text/Pandoc/Lua/Module | |
parent | a493c7029cf2bc8490d96fff04b0a0c624987601 (diff) | |
download | pandoc-f56d8706312df64d3956cea0c93768b51192958e.tar.gz |
Lua: marshal ListAttributes values as userdata objects
Diffstat (limited to 'src/Text/Pandoc/Lua/Module')
-rw-r--r-- | src/Text/Pandoc/Lua/Module/Pandoc.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Lua/Module/Types.hs | 1 | ||||
-rw-r--r-- | src/Text/Pandoc/Lua/Module/Utils.hs | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/Module/Pandoc.hs b/src/Text/Pandoc/Lua/Module/Pandoc.hs index f08914eba..340c324ad 100644 --- a/src/Text/Pandoc/Lua/Module/Pandoc.hs +++ b/src/Text/Pandoc/Lua/Module/Pandoc.hs @@ -34,6 +34,8 @@ import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.AST import Text.Pandoc.Lua.Marshaling.Attr (mkAttr, mkAttributeList) import Text.Pandoc.Lua.Marshaling.List (List (..)) +import Text.Pandoc.Lua.Marshaling.ListAttributes ( mkListAttributes + , peekListAttributes) import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua, loadDefaultModule) import Text.Pandoc.Options (ReaderOptions (readerExtensions)) @@ -301,6 +303,8 @@ otherConstructors = <#> optionalParameter peekIntegral "hash" "integer" "hash number" =#> functionResult pushCitation "Citation" "new citation object" #? "Creates a single citation." + + , mkListAttributes ] walkElement :: (Walkable (SingletonsList Inline) a, diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index fb09235de..ff4a4e0d5 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -37,7 +37,6 @@ pushCloneTable = do Lua.newtable addFunction "Meta" $ cloneWith peekMeta Lua.push addFunction "MetaValue" $ cloneWith peekMetaValue pushMetaValue - addFunction "ListAttributes" $ cloneWith peekListAttributes pushListAttributes return 1 cloneWith :: Peeker PandocError a diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs index 7ce1cd18d..f83c34af7 100644 --- a/src/Text/Pandoc/Lua/Module/Utils.hs +++ b/src/Text/Pandoc/Lua/Module/Utils.hs @@ -29,7 +29,8 @@ import Text.Pandoc.Error (PandocError) import Text.Pandoc.Lua.Marshaling () import Text.Pandoc.Lua.Marshaling.AST ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushPandoc - , peekAttr, peekListAttributes, peekMeta, peekMetaValue) + , peekAttr, peekMeta, peekMetaValue) +import Text.Pandoc.Lua.Marshaling.ListAttributes (peekListAttributes) import Text.Pandoc.Lua.Marshaling.List (pushPandocList) import Text.Pandoc.Lua.Marshaling.SimpleTable ( SimpleTable (..), peekSimpleTable, pushSimpleTable ) |