| Age | Commit message (Collapse) | Author |
|
T.P.Extensions [API change]:
+ Add CustomExtension constructor to Extension.
+ Remove Bounded, Enum instances for Extension.
+ Add `extensionsToList` function.
+ Revise `readExtension` so it can handle CustomExtension, and so
that it returns a Text rather than Maybe Text.
+ Add `showExtension`.
T.P.Format:
+ Revise error checking to handle CustomExtension.
|
|
Allows to handle docx and epub files.
|
|
This new module exports `pandocVersion` and `pandocVersionText`,
which are no longer exported from Text.Pandoc.Shared. [API change]
Also, we now set the `pandoc-version` variable centrally rather
than in the writers. One effect is the man writer now emits
a comment with the pandoc version (this was intended before,
judging from the template, but it didn't happen because the
vairable wasn't set).
|
|
Otherwise the `Error running Lua` message can be prepended multiple
times.
|
|
String error messages were incorrectly popped of the stack when
retrieving a PandocError.
|
|
Custom writers can define a default template via a global `Template`
function; the data directory is no longer searched for a default
template.
Writer authors can restore the old lookup behavior with
``` lua
Template = function ()
local template
return template.compile(template.default(PANDOC_SCRIPT_FILE))
end
```
|
|
The functions converts Meta values to template contexts; the intended
use is in combination with `pandoc.template.apply`.
|
|
Like custom readers, like writers, can define the set of supported
extensions by setting a global. E.g.:
``` lua
reader_extensions = {
smart = true,
citations = false,
}
```
|
|
The specialized peeker and pusher function for `Context Text` values
does not go via JSON, and thus keeps Doc values unchanged during
round-tripping.
|
|
The new function applies a context, containing variable assignments, to
a template.
|
|
Custom writers can define the extensions that they support via the
global `writer_extensions`. The variable's value must be a table with
all supported extensions as keys, and their default status as values.
E.g., the below specifies that the writer support the extensions `smart`
and `sourcepos`, but only the `smart` extension is enabled by default:
writer_extensions = {
smart = true,
sourcepos = false,
}
|
|
|
|
|
|
The functions now take a `FlavoredFormat` instead of a text argument.
|
|
The module provides functions and types for format spec parsing and
processing.
The function `parseFormatSpec` was moved from Text.Pandoc.Extensions to
the new module and renamed to `parseFlavoredFormat`. It now operates in
a PandocMonad and is based on the updated types.
|
|
Ensures a cleaner module dependency graph.
|
|
Errors are reported in Lua in the same words in which they would be
reported in the terminal.
|
|
The module provides functions to query the set of extensions supported
by formats, and the set of extension enabled per default.
|
|
|
|
This makes T.P.Class more self-contained, and suitable for extraction
into a separate package if desired.
[API changes]
- T.P.Data is now an exported module, providing `readDataFile`,
`readDefaultDataFile` (both formerly provided by T.P.Class),
and also `getDataFileNames` (formerly unexported in
T.P.App.CommandLineOptions).
- T.P.Translations is now an exported module (along with
T.P.Translations.Types), providing `readTranslations`,
`getTranslations`, `setTranslations`, `translateTerm`,
`lookupTerm`, `readTranslations`, `Term(..)`, and `Translations`.
- T.P.Class: `readDataFile`, `readDefaultDataFile`, `setTranslations`,
and `translateTerm` are no longer exported.
`checkUserDataDir` is now exported.
- Text.Pandoc now exports Text.Pandoc.Data and `setTranslations`
and `translateTerm`.
|
|
New-style custom Lua writers can now define an alternative entry function
`BinaryWriter`. If a function with that name is defined, then pandoc
will treat the returned string as binary output. This allows to generate
formats like docx and odt with custom writers.
|
|
The `T.P.Lua.writeCustom` function changed to allow either a TextWriter
or ByteStringWriter to be returned. The global variables
`PANDOC_DOCUMENT` and `PANDOC_WRITER_OPTIONS` are no longer set when the
writer script is loaded. Both variables are still set in classic writers
before the conversion is started, so they can be used when they are
wrapped in functions.
|
|
The function can be used to convert a classic writer into a new-style
writer by setting it as the value of `Writer`:
``` lua
Writer = pandoc.write_classic
```
or to fully restore the old behavior:
``` lua
function Writer (doc, opts)
PANDOC_DOCUMENT = doc
PANDOC_WRITER_OPTIONS = opts
load(PANDOC_SCRIPT_FILE)()
return pandoc.write_classic(doc, opts)
end
```
|
|
|
|
The flag 'lua53` must now be used with that package if pandoc is to be
compiled against Lua 5.3.
|