aboutsummaryrefslogtreecommitdiff
path: root/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2023-03-19 21:21:06 +0100
committerAlbert Krewinkel <[email protected]>2023-03-19 22:39:15 +0100
commita37eda971377397e7a2cc71553e5e5d7c0326a9b (patch)
tree1ead0d06894084267e19b1c6efa0e55dd176829c /pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs
parentafee37abc74abac6326486bd355ed6ae800c2ca5 (diff)
lua-filters.md: auto-generate docs for more modules
Diffstat (limited to 'pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs')
-rw-r--r--pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs
index 6b309fbd8..586867672 100644
--- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs
+++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/JSON.hs
@@ -38,7 +38,8 @@ import qualified Data.Text as T
documentedModule :: Module PandocError
documentedModule = Module
{ moduleName = "pandoc.json"
- , moduleDescription = "JSON module based on the Aeson Haskell package."
+ , moduleDescription = "JSON module to work with JSON; " <>
+ "based on the Aeson Haskell package."
, moduleFields = fields
, moduleFunctions = functions
, moduleOperations = []
@@ -59,7 +60,7 @@ fields =
null :: LuaError e => Field e
null = Field
{ fieldName = "null"
- , fieldType = "userdata"
+ , fieldType = "light userdata"
, fieldDescription = "Value used to represent the `null` JSON value."
, fieldPushValue = pushValue Aeson.Null
}
@@ -94,10 +95,10 @@ decode = defun "decode"
=#> functionResult pure "any" "decoded object"
#? T.unlines
[ "Creates a Lua object from a JSON string. The function returns an"
- , "[Inline], [Block], [Pandoc], [Inlines], or [Blocks] element if the"
- , "input can be decoded into represent any of those types. Otherwise"
- , "the default decoding is applied, using tables, booleans, numbers,"
- , "and [null](#pandoc.json.null) to represent the JSON value."
+ , "[[Inline]], [[Block]], [[Pandoc]], [[Inlines]], or [[Blocks]] element"
+ , "if the input can be decoded into represent any of those types."
+ , "Otherwise the default decoding is applied, using tables, booleans,"
+ , "numbers, and [null](#pandoc.json.null) to represent the JSON value."
, ""
, "The special handling of AST elements can be disabled by setting"
, "`pandoc_types` to `false`."
@@ -123,7 +124,7 @@ encode = defun "encode"
_ -> failLua
"Call to __tojson metamethod did not yield a string")
<#> parameter pure "any" "object" "object to convert"
- =#> functionResult pure "string" "JSON encoding of `object`"
+ =#> functionResult pure "string" "JSON encoding of the given `object`"
#? T.unlines
["Encodes a Lua object as JSON string."
, ""