diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-12-11 10:29:49 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-12-11 10:53:24 -0800 |
commit | 817d2048da08f44ab4a9efae7c761aff99e3d959 (patch) | |
tree | 9cac429837d46e5e7b52506a740b61eb97c8b0ec /test/odt/native/image.native | |
parent | 4e7ac069b9d79146c3d39a8514bbdbf81f51118e (diff) | |
download | pandoc-817d2048da08f44ab4a9efae7c761aff99e3d959.tar.gz |
Improved template API and fixed a bug. Closes #5979.
* Text.Pandoc.Templates [API change]
+ Add Monad wrappers `WithDefaultPartials` and `WithPartials`.
Wrapping these around an instance of `PandocMonad` gives
us different instances of `TemplateMonad`, with different
search behavior in retrieving partials.
To compile a template and limit partial search to pandoc's
data files, use `runWithDefaultPartials (compileTemplate ...)`.
To compile a template and allow partials to be found locally
(either on the file system or via HTTP, in the event that
the main template has an absolute URL), ue
`runWithPartials (compileTemplate ...)`.
+ Export `getTemplate`, which seeks a template locally,
or via HTTP if the template has an absolute URL, falling
back to the data files if not found.
+ Export `compileDefaultTemplate` -- does `getDefaultTemplate`
and compiles the result, raising an error on failure.
* Text.Pandoc.Class [API change]
+ Remove `TemplateMonad` instances for `PandocIO` and `PandocPure`.
These were too limiting and caused a bug whereby a local
partial could be used even when the default template was requested.
We now rely on instances provided in the Templates module.
Text.Pandoc.App.OutputSettings
+ Simplify template retrieval code.
Diffstat (limited to 'test/odt/native/image.native')
0 files changed, 0 insertions, 0 deletions