diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Lua/Marshaling/AST.hs | 5 | ||||
-rw-r--r-- | src/Text/Pandoc/Lua/Module/Types.hs | 46 |
2 files changed, 50 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs index f18754ac2..7b428b5f0 100644 --- a/src/Text/Pandoc/Lua/Marshaling/AST.hs +++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs @@ -14,7 +14,10 @@ Marshaling/unmarshaling instances for document AST elements. -} -module Text.Pandoc.Lua.Marshaling.AST () where +module Text.Pandoc.Lua.Marshaling.AST + ( LuaAttr (..) + , LuaListAttributes (..) + ) where import Prelude import Control.Applicative ((<|>)) diff --git a/src/Text/Pandoc/Lua/Module/Types.hs b/src/Text/Pandoc/Lua/Module/Types.hs index 641bde7d6..fdc63cd99 100644 --- a/src/Text/Pandoc/Lua/Module/Types.hs +++ b/src/Text/Pandoc/Lua/Module/Types.hs @@ -15,8 +15,11 @@ module Text.Pandoc.Lua.Module.Types import Prelude import Data.Version (Version) import Foreign.Lua (Lua, NumResults) +import Text.Pandoc.Definition +import Text.Pandoc.Lua.Marshaling.AST (LuaAttr, LuaListAttributes) import Text.Pandoc.Lua.Marshaling.Version () import Text.Pandoc.Lua.Util (addFunction) +import Text.Pandoc.Shared (Element (..)) import qualified Foreign.Lua as Lua @@ -25,4 +28,47 @@ pushModule :: Lua NumResults pushModule = do Lua.newtable addFunction "Version" (return :: Version -> Lua Version) + pushCloneTable + Lua.setfield (Lua.nthFromTop 2) "clone" return 1 + +pushCloneTable :: Lua NumResults +pushCloneTable = do + Lua.newtable + addFunction "Attr" cloneAttr + addFunction "Block" cloneBlock + addFunction "Citation" cloneCitation + addFunction "Element" cloneElement + addFunction "Inline" cloneInline + addFunction "Meta" cloneMeta + addFunction "MetaValue" cloneMetaValue + addFunction "ListAttributes" cloneListAttributes + addFunction "Pandoc" clonePandoc + return 1 + +cloneAttr :: LuaAttr -> Lua LuaAttr +cloneAttr = return + +cloneBlock :: Block -> Lua Block +cloneBlock = return + +cloneCitation :: Citation -> Lua Citation +cloneCitation = return + +cloneElement :: Element -> Lua Element +cloneElement = return + +cloneInline :: Inline -> Lua Inline +cloneInline = return + +cloneListAttributes :: LuaListAttributes -> Lua LuaListAttributes +cloneListAttributes = return + +cloneMeta :: Meta -> Lua Meta +cloneMeta = return + +cloneMetaValue :: MetaValue -> Lua MetaValue +cloneMetaValue = return + +clonePandoc :: Pandoc -> Lua Pandoc +clonePandoc = return |