aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-10-05 12:37:30 +0200
committerJohn MacFarlane <[email protected]>2022-12-16 10:43:01 -0800
commita36f12119fe1a0b70a1a3ff65264e94373a490ce (patch)
tree224f9932bf6e1c120db568a6a111f69a9146317a /doc
parentdb0232fc545913a9ea6e81d84fc5ee4d9cc8a185 (diff)
Lua: allow table structure as format spec.
This allows to pass structured values as format specifiers to `pandoc.write` and `pandoc.read`.
Diffstat (limited to 'doc')
-rw-r--r--doc/custom-readers.md14
-rw-r--r--doc/lua-filters.md16
2 files changed, 21 insertions, 9 deletions
diff --git a/doc/custom-readers.md b/doc/custom-readers.md
index 2d9938121..e0b6e4915 100644
--- a/doc/custom-readers.md
+++ b/doc/custom-readers.md
@@ -98,10 +98,10 @@ end
Custom readers can be built such that their behavior is
controllable through format extensions, such as `smart`,
`citations`, or `hard-line-breaks`. Supported extensions are those
-that are present as a key in the global `Extensions` table.
-Fields of extensions that are enabled default have the value
-`true`, while those that are supported but disabled have value
-`false`.
+that are present as a key in the global `Extensions` table. Fields
+of extensions that are enabled default have the value `true` or
+`enable`, while those that are supported but disabled have value
+`false` or `disable`.
Example: A writer with the following global table supports the
extensions `smart`, `citations`, and `foobar`, with `smart` enabled and
@@ -109,9 +109,9 @@ the other two disabled by default:
``` lua
Extensions = {
- smart = true,
- citations = false,
- foobar = false
+ smart = 'enable',
+ citations = 'disable',
+ foobar = true
}
```
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 5cefa28de..762c893f8 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -3495,13 +3495,23 @@ reStructuredText, and Org, then these will be included in the
resulting document. Any media elements are added to those
retrieved from the other parsed input files.
+The `format` parameter defines the format flavor that will be
+parsed. This can be either a string, using `+` and `-` to enable
+and disable extensions, or a table with fields `format` (string)
+and `extensions` (table). The `extensions` table can be a list of
+all enabled extensions, or a table with extensions as keys and
+their activation status as values (`true` or `'enable'` to enable
+an extension, `false` or `'disable'` to disable it).
+
Parameters:
`markup`
: the markup to be parsed (string|Sources)
`format`
-: format specification, defaults to `"markdown"` (string)
+: format specification; defaults to `"markdown"`. See the
+ description above for a complete description of this
+ parameter. (string|table)
`reader_options`
: options passed to the reader; may be a ReaderOptions object or
@@ -3532,7 +3542,9 @@ Parameters:
: document to convert ([Pandoc](#type-pandoc))
`format`
-: format specification, defaults to `'html'` (string)
+: format specification; defaults to `"html"`. See the
+ documentation of [`pandoc.read`](#pandoc.read) for a complete
+ description of this parameter. (string|table)
`writer_options`
: options passed to the writer; may be a WriterOptions object