| Age | Commit message (Collapse) | Author |
|
A new command line option `--syntax-highlighting` is provided; it takes
the values `none`, `default`, `idiomatic`, a style name, or a path to a
theme file. It replaces the `--no-highlighting`, `--highlighting-style`,
and `--listings` options.
The `writerListings` and `writerHighlightStyle` fields of the
`WriterOptions` type are replaced with `writerHighlightStyle`.
Closes: #10525
|
|
If `--pdf-engine` is specified or if a PDF is being produced,
we set the `pdf-engine` variable. This allows writers and
templates to behave differently depending on the PDF engine.
|
|
Otherwise we get undesirable results, as the format's native
citation mechanism is used instead of (or in addition to) the
citeproc-generated citations. Closes #10662.
|
|
The intent is to allow bash process substitution: e.g.,
`--template <(echo "foo")`.
Previously pandoc *always* added an extension based on the
output format, which caused problems with the absolute filenames
used by bash process substitution (e.g. `/dev/fd/11`).
Now, if the template has no extension, pandoc will first
try to find it without the extension, and then add the
extension if it can't be found.
So, in general, extensionless templates can now be used.
But this has been implemented in a way that should not cause
problems for existing uses, unless you are using a template
`NAME.FORMAT` but happen to have an extensionless file `NAME` in
the template search path.
Closes #5270.
|
|
|
|
|
|
This computes the sandboxed files from Opt and avoids some
code repetition in T.P.App and T.P.App.OutputSettings.
|
|
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 <[email protected]>
|
|
writerEpubTitlePage, writerChunkTemplate, writerListTables.
|
|
+ Add command line options `--table-caption-position` and
`--figure-caption-position`. These allow the user to specify whether
to put captions above or below tables and figures, respectively.
The following output formats are supported: HTML (and related such
as EPUB), LaTeX (and Beamer), Docx, ODT/OpenDocument, Typst.
+ Text.Pandoc.Options: add `CaptionPosition` and new
`WriterOptions` fields `writerFigureCaptionPosition` and
`writerTableCaptionPosition` [API change].
+ Text.Pandoc.Opt: add `Opt` fields `optFigureCaptionPosition` and
`optTableCaptionPosition` [API change].
+ Docx writer: make table/figure rendering sensitive to caption
position settings.
+ OpenDocument writer: make table/figure rendering sensitive to
caption position settings.
+ Typst writer/template: implement figure caption positions by
triggering a show rule in the default template, which determines caption
positions for figures and tables globally.
+ LaTeX writer: make table/figure rendering sensitive to caption
position settings. Closes #5116.
+ HTML writer/template: make `<figcaption>` placement sensitive to caption
position settings. For tables, `<caption>` must be the first element,
and positioning is determined by CSS, for here we set a variable
which the default template is sensitive to.
|
|
New cli option: `--link-images`. This causes images to be linked
rather than embedded in ODT.
New field in WriterOptions: `writerLinkImages` [API change].
New field in Opt: `optLinkImages` [API change].
Closes #9815.
|
|
|
|
Previously if you did `pandoc -s -t bbb`, it would give you
an error about the missing bbb template instead of saying that
it's not a supported output format.
|
|
The AsciiDoc community now regards the dialect parsed by `asciidoctor`
as the official AsciiDoc syntax, so it should be the target of our
`asciidoc` format.
Closes #8936.
The `asciidoc` output format now behaves like `asciidoctor` used to.
`asciidoctor` is a deprecated synonynm. For the old `asciidoc` behavior
(targeting the Python script), use `asciidoc_legacy`.
The templates have been consolidated. Instead of separate
`default.asciidoctor` and `default.asciidoc` templates, there is
just `default.asciidoc`.
Text.Pandoc.Writers.AsciiDoc API changes:
- `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to.
- `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`.
- New exported function `writeAsciiDocLegacy` behaves like
`writeAsciDoc` used to.
|
|
(That is, whenever we have the filename and are in a
PandocMonad instance.)
This will lead to more informative error messages for UTF8
encoding, indicating the file path and byte offset where the
error occurs. Closes #8884.
|
|
* T.P.Format: export `formatFromFilePaths` [API change]
* Lua: add function `pandoc.format.from_path`
* Update lua-filters.md
* The old T.P.App.FormatHeuristics module has been removed.
This is an alternative to #8693.
|
|
* Add `--chunk-template` CLI option, allowing more control over the
chunk filenames in chunked HTML output.
* Text.Pandoc.App: Add `optChunkTemplate` constructor to Opt [API change].
* Text.Pandoc.Options: add `writerChunkTemplate` contsructor to
WriterOptions [API change].
* Text.Pandoc.Chunks: add Data, Typeable, Generic instances for
PathTemplate.
|
|
`pandoc-version`, `outputfile`, `title-prefix`, `epub-cover-image`,
`curdir`, `dzslides-core` can be overridden by `--variable` on the
command line.
Previously they would create lists in the template Context,
which is not desirable.
|
|
Rationale: we need this splitting level now not just in
EPUB but in chunked HTML.
`--epub-chapter-level` will still function as a deprecated
synonynm. `epub-chapter-level` will also continue to work in
defaults files, ande `epub_chapter_level` will still work for
Lua marshalling.
[API changes]
Text.Pandoc.App.Opt: remove `optEpubChapterLevel`, add
`optSplitLevel`.
Text.Pandoc.Options: remove `writerEpubChapterLevel`, add
`writerSplitLevel`.
|
|
- Add module Text.Pandoc.Writers.ChunkedHTML,
exporting writeChunkedHtml [API change].
- Revised API for Text.Pandoc.Chunks.
`chunkNext`, `chunkPrev`, `chunkUp` are now
just `Maybe Chunk`.
- Fix assignment of navigation elements of Chunks.
- Strip off anchor portion of next and prev links.
- Remove Ord instances for SecInfo, Chunk.
- Derive Show, Eq, Generic for ChunkDoc.
- Add `chunkSectionNumber`, `chunkUnlisted`.
- Automatically unwrap the zip to a directory
if an extensionless output file specified.
- Incorporate images with relative paths below working dir.
|
|
|
|
The new type CustomComponents is exported from T.P.Scripting, and the
ScriptEngine fields are changed. Instead of separate fields for custom
readers and writers, we now have a single function that loads any number
of "components" from a script: these may be custom readers, custom
writers, templates for writers, or extension configs. (Note: it's
possible to have a custom reader and a custom writer for a format
together in the same file.)
Pandoc now checks the folder `custom` in the user's data directory for a
matching script if it can't find one in the local directory. Previously,
the `readers` and `writers` data directories were search for custom
readers and writers, respectively. Scripts in those directories must be
moved to the `custom` folder.
Custom readers used to implement a fallback behavior that allowed to
consume just a string value as input to the `Reader` function. This has
been removed, the first argument is now always a list of sources. Use
`tostring` on that argument to get a string.
Closes #8417.
Signed-off-by: Albert Krewinkel <[email protected]>
|
|
|
|
A new error `PandocNoTemplateError` (code 87) is thrown if a template is
required but cannot be found.
|
|
New command line option: `--epub-title-page=true|false`.
New `writerEpubTitlePage` field on `WriterOptions` [API change].
New `optEpubTitlePage` field on `Opts` [API change].
Closes #6097.
|
|
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).
|
|
|
|
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 default template of a custom writer `/path/to/my-writer.lua` is
expected in the `templates/default.my-writer.lua` data file. Note that
templates are *not* applied automatically to the output of custom
writers; custom writer authors must ensure that the template is applied
if one is present in the writer options.
Closes: #8137
|
|
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.
|
|
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 functions `writeCustom` and `readCustom` are available from module
Text.Pandoc.Lua.
|
|
[API change] Add writerListTables to WriterOptions.
RST writer: Remove sensitivity to "list-table" class in table attributes.
Instead, just check `writerListTables` in writer options.
See #4564.
|
|
[API change]
Previously this lived in an unexported module
T.P.App.CommandLineOptions, under the name `lookupHighlightStyle`.
|
|
Closes #7898.
Note that it may be necessary to explicitly specify a template on the command line.
|
|
This ensures that all writer exported in T.P.Writers are parameterized
and work with any `PandocMonad` type. This is consistent with
T.P.Readers, as `readCustom` is not exported from that module either.
|
|
|
|
+ Add sandbox feature for readers. When this option is used,
readers and writers only have access to input files (and
other files specified directly on command line). This restriction
is enforced in the type system.
+ Filters, PDF production, custom writers are unaffected. This
feature only insulates the actual readers and writers, not
the pipeline around them in Text.Pandoc.App.
+ Note that when `--sandboxed` is specified, readers won't have
access to the resource path, nor will anything have access to
the user data directory.
+ Add module Text.Pandoc.Class.Sandbox, defining
`sandbox`. Exported via Text.Pandoc.Class. [API change]
Closes #5045.
|
|
so we can run this with any instance of PandocMonad and MonadIO,
not just PandocIO.
|
|
[API change] This affects `readFile`, `getContents`, `writeFileWith`,
`writeFile`, `putStrWith`, `putStr`, `putStrLnWith`, `putStrLn`.
`hPutStrWith`, `hPutStr`, `hPutStrLnWith`, `hPutStrLn`, `hGetContents`.
This avoids the need to uselessly create a linked list of characters
when emiting output.
|
|
|
|
* Use implicit Prelude
The previous behavior was introduced as a fix for #4464. It seems that
this change alone did not fix the issue, and `stack ghci` and `cabal
repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded
for these versions. Given this, it seems cleaner to revert to the
implicit Prelude.
* PandocMonad: remove outdated check for base version
Only base versions 4.9 and later are supported, the check for
`MIN_VERSION_base(4,8,0)` is therefore unnecessary.
* Always use custom prelude
Previously, the custom prelude was used only with older GHC versions, as
a workaround for problems with ghci. The ghci problems are resolved by
replacing package `base` with `base-noprelude`, allowing for consistent
use of the custom prelude across all GHC versions.
|
|
* Update copyright year
* Copyright: add notes for Lua and Jira modules
|
|
|
|
This avoids some unnecessary unpacking.
(This is only an internal module so it's not an API change.)
|
|
* 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.
|
|
`Nothing` means: nothing specified.
`Just []` means: an empty list specified (e.g. in defaults).
Potentially these could lead to different behavior: see #5888.
|