aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/lua-filters.md41
-rw-r--r--pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Format.hs4
2 files changed, 43 insertions, 2 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 6435280e6..8636b3254 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -4271,6 +4271,47 @@ Parameters:
`comp`
: Comparison function as described above.
+# Module pandoc.format
+
+Information about the formats supported by pandoc.
+
+## Functions {#pandoc.format-functions}
+
+### all_extensions {#pandoc.format.default_extensions}
+
+`all_extensions (format)`
+
+Returns the list of all valid extensions for a format. No
+distinction is made between input and output; an extension can
+have an effect when reading a format but not when writing it, or
+*vice versa*.
+
+Parameters:
+
+`format`
+: format name (string)
+
+Returns:
+
+- all extensions supported for `format` (FormatExtensions)
+
+### default_extensions {#pandoc.format.default_extensions}
+
+`default_extensions (format)`
+
+Returns the list of default extensions of the given format; this
+function does not check if the format is supported, it will return
+a fallback list of extensions even for unknown formats.
+
+Parameters:
+
+`format`
+: format name (string)
+
+Returns:
+
+- default extensions enabled for `format` (FormatExtensions)
+
# Module pandoc.path
Module for file path manipulations.
diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Format.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Format.hs
index d9d413e09..0e5dde9be 100644
--- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Format.hs
+++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Format.hs
@@ -52,8 +52,8 @@ functions =
"all extensions supported for `format`"
#? T.unlines
[ "Returns the list of all valid extensions for a format."
- , "No distinction is made between input and output, and an"
- , "extension have an effect when reading a format but not when"
+ , "No distinction is made between input and output; an extension"
+ , "can have an effect when reading a format but not when"
, "writing it, or *vice versa*."
]
]