| Age | Commit message (Collapse) | Author |
|
The flag 'lua53` must now be used with that package if pandoc is to be
compiled against Lua 5.3.
|
|
|
|
The module Text.Pandoc.Filter.Lua has been merged into Text.Pandoc.Lua.
The function `applyFilter` now has type
``` haskell
applyFilter :: (PandocMonad m, MonadIO m)
=> Environment-> [String]-> FilePath-> Pandoc-> m Pandoc
```
where `Environment` is defined in Text.Pandoc.Filter.Environment.
|
|
and add a new `pandocVersion` value with type `Version`. This is
consistent with the type used for `pandocTypesVersion` and allows to use
the value where a Version type is required.
|
|
|
|
|
|
Motivation: now we need not have any logic referring to hslua
types (LuaE) in T.P.Filter.Lua. This restricts the parts of Pandoc
that deal directly with hslua to T.P.Lua (and in tests,
Tests.Lua).
[API changes]
T.P.Lua now exports `applyFilter`, `readCustom`, and `writeCustom`.
The lower-level function `runFilterFile` is no longer exported.
|
|
(Unexported modules, presently.)
These contain the definitions of `readCustom` and `writeCustom`
that were previously in T.P.Readers.Custom and T.P.Writers.Custom.
Motivation is to ensure that all of the Lua-related code is under
the T.P.Lua tree. This will make it easier to make pandoc-lua
a separate package or put lua support under a flag, if we decide to
do that.
|
|
The function runs the *citeproc* processor on a Pandoc document.
Exposing this functionality to Lua allows to make citation processing
part of a filter or writer, simplifies the creation of multiple
bibliographies, and enables the use of varying citation styles in
different parts of a document.
|
|
The module now has the additional functions `list_directory`,
`make_directory`, and `remove_directory`. This makes it easier to write
cross-platform scripts that need to inspect or modify the file system.
|
|
The set of supported input and output formats is made available to Lua
users.
|
|
This allows to invoke methods like `map` and `includes` on lists like
`PANDOC_WRITER_OPTIONS.extensions`.
|
|
This was a leftover from previous hslua versions that relied heavily on
`Foreign.C.withCString` and the like. However, hslua 2 and later use
bytestring functions to retrieve string values, so this is no longer
needed.
|
|
|
|
The function `takeWhileEnd` was added with bytestring-0.11.3.0, but older
versions should be supported as well.
Fixes the previous commit.
|
|
Modules are now loaded directly; the special pandoc Lua package searcher
is no longer necessary and has been removed.
|
|
The function allows to fill the mediabag with all images in a given
document. Images that cannot be fetched are replaced with a Span
containing the image description.
|
|
Sources, the data type passed to the `Reader` function in custom
readers, are now accepted as input to `pandoc.read`.
|
|
The package is a dependency of hslua; all important modules are
re-exported.
|
|
|
|
Lua 5.4 is used by default after this is merged. Packagers may still include Lua 5.3
instead by building pandoc with `--constraint='hslua <2.2'`.
Differences between 5.3 and 5.4 should not generally affect pandoc Lua filters.
See list of incompatible changes here <https://www.lua.org/manual/5.4/manual.html#8.1>
|
|
|
|
|
|
Using the correct module name is relevant when auto-generating
documentation.
|
|
This allows for some code simplification and improves stability.
|
|
The module provides a `compile` function to use strings as templates.
|
|
|
|
|
|
|
|
|
|
API changes:
- The function T.P.Filter.applyFilters now takes a filter
environment of type `Environment`, instead of a ReaderOptions value.
The `Environment` type is exported from `T.P.Filter` and allows to
combine ReaderOptions and WriterOptions in a single value.
- Global, exported from T.P.Lua, has a new type constructor
`PANDOC_WRITER_OPTIONS`.
Closes: #5221
|
|
Extensions are now available as a list of strings; the track-changes
settings are given as the kebab-case representation used in JSON.
|
|
The function `pandoc.read` is updated to use the same state that was
used while parsing the main input files. This ensures that log messages
are preserved and that images embedded in the input are added to the
mediabag.
|
|
A ReaderOptions element was left on top of the stack when the
`peekReadOptionsTable` function was invoked.
|
|
|
|
Create truly empty table caption and body when these are empty in the
simple table.
Fixes: #7776
|
|
Minor behavior change: plain strings nested in tables are now included
in the result string.
|
|
The function is no longer required for element comparisons; it is now an
alias for the `==` operator.
|
|
The function behaves like the default `type` function from Lua's
standard library, but is aware of pandoc userdata types. A typical
use-case would be to determine the type of a metadata value.
|
|
Ensures the returned lists have the correct type (`Inlines` and
`Blocks`, respectively).
|
|
Omit `false` boolean values, push integers as numbers.
|
|
The default Pandoc object is now non-strict, i.e., only the parts of the
document that are accessed will be marshaled to Lua. A special type is
no longer necessary.
This change also makes it possible to use the global variable with
library functions such as `pandoc.utils.references`, or to inspect the
document contents with `walk()`.
|
|
|
|
List with all cited references of a document.
Closes: #7752
|
|
Retry conversion by passing a string instead of sources when the
`Reader` fails with a message that hints at an outdated function. A
deprecation notice is reported in that case.
|
|
The first argument passed to Lua `Reader` functions is no longer a plain
string but a richer data structure. The structure can easily be
converted to a string by applying `tostring`, but is also a list with
elements that contain each the *text* and *name* of each input source as
a property of the respective name.
A small example is added to the custom reader documentation, showcasing
its use in a reader that creates a syntax-highlighted code block for
each source code file passed as input.
Existing readers must be updated.
|
|
Cell values are now marshaled as userdata objects; a constructor
function for table cells is provided as `pandoc.Cell`.
|
|
- `walk` methods are added to `Block` and `Inline` values; the methods
are similar to `pandoc.utils.walk_block` and
`pandoc.utils.walk_inline`, but apply to filter also to the element
itself, and therefore return a list of element instead of a single
element.
- Functions of name `Doc` are no longer accepted as alternatives for
`Pandoc` filter functions. This functionality was undocumented.
|
|
The new `pandoc.Inlines` function behaves identical on string input, but
allows other Inlines-like arguments as well.
The `pandoc.utils.text` function could be written as
function pandoc.utils.text (x)
assert(type(x) == 'string')
return pandoc.Inlines(x)
end
|
|
The functions convert their argument into a list of Block and Inline
values, respectively.
|