The sandbox is now enabled if the fourth parameter is a list of files.
The files are read and then made available in the sandbox via a mock
file system.
The function `pandoc.read` is now taking an optional fourth parameter
that specifies the environment in which the parser will be run. Passing
the string `sandbox` as the argument causes the reader to run in a
sandbox, thereby preventing all access to the network and file system.
Closes: #10831
Enable annotating author roles using the Contribution Role Taxonomy
(CRediT) and export this information in conformant JATS
Closes#10152.
Co-Authored-By: Jez Cope <457628+jezcope@users.noreply.github.com>
It is now possible to return a single filter from a filter file, e.g.
``` lua
-- Switch single- and double quotes
return {
Quoted = function (q)
elem.quotetype = elem.quotetype == 'SingleQuote'
and 'DoubleQuote' or 'SingleQuote'
return elem
end
}
The filter must not contain numerical indexes, or it might be treated as
a list of filters.
Two new command-line options are added:
`--lof[=true|false]`, `--list-of-figures[=true|false]`
`--lot[=true|false]`, `--list-of-tables[=true|false]`
Only docx, latex, and context are supported at this point.
Setting the `lof` and `lot` variables will also work for the formats that are
currently supported.
[API changes]
+ Lua: `list_of_figures` and `list_of_tables` can now be used in writer options.
+ Text.Pandoc.Options: add `writerListOfFigures` and `writerListOfTables` fields
to `WriterOptions`.
+ Text.Pandoc.App.Opt: add `optListOfFigures` and `optListOfTables` to `Opt`.
Closes#8245.
Co-authored-by: John MacFarlane <jgm@berkeley.edu>
The `Doc` values produced and handled by the `pandoc.layout` module can
now be styled using `bold`, `italic`, `underlined`, or `strikeout`. The
style is ignored in normal rendering, but becomes visible when rendering
to ANSI output. The `pandoc.layout.render` function now takes a third
parameter that defines the output style, either *plain* or *ansi*.
The module now comes with a method `:at(index[, def])` that allows to access
indices, accepts negative indices to count from the end, and will return the
`def` value as a default if the list has no item at the given position.
Furthermore, the list constructor `pandoc.List` now accepts iterators. E.g.,
`pandoc.List(text:gmatch '%S+')` returns the list of words in `text`.
Closes: #9835
The content of the `floats-group` variable is now rendered in a
`<floats-group>` element when using the *publishing* or *archiving* tag
sets.
Discussion: #10196
The function allows to specify a template with the same argument value
that would be used with the `--template` command line parameter.
Closes: #9854
Co-authored-by: Carsten Gips <cagix@hsbi.de>
The default is now to use a *copy* of the global environment when running a
filter; this ensures better separation when `run_lua_filter` is used multiple
times. A custom environment can be specified via the optional third parameter.
This extends support for fine-grained properties in Typst.
If the `typst:no-figure` class is present on a Table, the table will not be placed in a figure.
If the `typst:figure:kind` attribute is present, its value will be used for the figure's `kind`.
These features are documented in `doc/typst-property-output.md`.
Closes#9777.
The Typst writer will pass on specially marked attributes as raw Typst
parameters on selected elements. This allows extensive customization
using filters.
An attribute with key `typst:PROP` will set the PROP parameter on
the corresponding Typst element.
An attribute with key `typst:text:PROP` will set a parameter on a Typst
`#set text()` rule or a text element.
The feature has been implemented for the following elements:
* span text
* div and div text
* table and table text
* table cell and table cell text
It would be possible to support more elements in the future.
A separate document has been added that provides extensive
documentation and examples of the use of this feature.