Commit Graph
16191 Commits
Author SHA1 Message Date
John MacFarlane c100087029 Chunks: remove unused imports. 2023-01-10 22:50:23 -08:00
John MacFarlane 59125dfdb9 T.P.Chunks: remove Ord instances for SecInfo, Chunk, ChunkedDoc. 2023-01-10 22:27:02 -08:00
John MacFarlane 1fdc27a2c0 Add ChunkedHTML writer.
- 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.
- Derive Show, Eq, Ord, 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.
2023-01-10 21:48:38 -08:00
Albert Krewinkel b55cd83a60 Update copyright years, it's 2023! 2023-01-10 20:28:27 +01:00
John MacFarlane a682e72c03 Add code { hyphens: manual; } to HTML and EPUB CSS.
Closes #8530.
2023-01-06 10:50:48 -08:00
John MacFarlane 0d891afab6 isURI: don't require non-ASCII characters to be escaped.
Closes #8508.
2023-01-05 21:14:02 -08:00
John MacFarlane 7a82686adc Use \toprule\noalign{} instead of \toprule() in LaTeX tables.
And similar for `\midrule` and `\bottomrule`.

This facilitates redefining `\toprule`, `\midrule`, and `\bottomrule`
without needing to gobble the ()s.

Closes #8223.
2023-01-04 13:57:41 -08:00
Olivier Benz c4995fea41 Use ghc4pandoc 9.4.4 docker image 2023-01-04 07:58:41 -08:00
Albert Krewinkel 8862d5e0dd Lua: add functions pandoc.text.toencoding, pandoc.text.fromencoding.
Closes: #8512
2023-01-03 10:35:22 +01:00
John MacFarlane 355794549d epub.css: comment out flex rules.
This fixes commit 3666d79ae7
which closed #8379.
2023-01-02 22:35:17 -08:00
John MacFarlane ce7d1d1c20 Man writer: use UTF-8 by default for non-ascii characters.
Only use groff escapes if `--ascii` has been specified on the
command line (`writerPreferAscii`).

Closes #8507.
2022-12-28 17:16:30 -08:00
John MacFarlane 6c96340bf6 Support "software" type in biblatex <-> CSL conversions.
Closes #8504.
2022-12-22 17:30:44 -08:00
John MacFarlane ee6cf1b8bf Make sure "version" field comes through in biblatex.
See #8504.
2022-12-22 17:08:50 -08:00
John MacFarlane 091ae5d65e Use latest skylighting-format-context. 2022-12-22 09:49:38 -08:00
Albert Krewinkel 528013b2fe Reveal.js template: prevent line-wrapping of parallax options
Fixes: #8503
2022-12-22 12:07:30 +01:00
John MacFarlane 21baefbbbb Fix class name hanging -> hanging-indent in styles.citations.html. 2022-12-21 15:55:23 -08:00
John MacFarlane ce3f5a4976 Use latest dev citeproc. 2022-12-21 15:35:09 -08:00
John MacFarlane 063480accd T.P.Scripting: Refactor the scripting engine.
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 <albert@zeitkraut.de>
2022-12-20 20:58:44 -08:00
John MacFarlane 8553459f61 T.P.Format: Monoid, Semigroup instance for ExtensionsConfig. 2022-12-20 20:58:44 -08:00
Albert Krewinkel 1328e57f08 Shared: use LineBreak as default block sep in blocksToInlines
This change also affects the `pandoc.utils.blocks_to_inlines` Lua
function.

Closes: #8499
2022-12-20 13:39:16 -08:00
Albert Krewinkel c954dfab59 Markdown writer: avoid HTML fallbacks in the generated TOC.
The generated table of contents usually has IDs for each TOC link,
allowing to link back to specific parts of the TOC. However, this leads
to unidiomatic markup in formats like gfm, which do not support
attributes on links and hence fall back to HTML. The IDs on TOC items
are now removed in that case, leading to more aesthetic TOCs.

Closes: #8131
2022-12-20 18:21:16 +01:00
Sven Wick 98667b7b2f Update README.template (#8496) 2022-12-18 18:11:04 -08:00
William RusnackandWilliam Rusnack 20765f41e2 Add Wrapper type documentation to Text.Pandoc.Templates (#8490)
Added more information on the wrappers from the commit
https://github.com/renjianxiongqi/pandoc/commit/f36b5b8a5db8479bcf98827c267840304403bdf0

Co-authored-by: William Rusnack <williamrusnack@gmail.com>
2022-12-18 07:26:12 -08:00
Albert Krewinkel e83120fd2d ConTeXt writer: support syntax highlighting for code. 2022-12-18 15:47:48 +01:00
Albert Krewinkel 8f5af5a06c ConTeXt writer: always use \type for inline code
Inline codes that contained curly braces where previously rendered with
`\mono`; this led to unexpected results when the presentation of `\type`
was customized, as those changes would not have been applied to code
rendered with `\mono`.
2022-12-17 23:53:12 +01:00
Albert Krewinkel a36f12119f Lua: allow table structure as format spec.
This allows to pass structured values as format specifiers to
`pandoc.write` and `pandoc.read`.
2022-12-16 10:43:01 -08:00
Albert Krewinkel db0232fc54 Format: add function diffExtensions. 2022-12-16 10:43:01 -08:00
Albert Krewinkel 038df3b24c Format: use simpler structure for ExtensionsDiff. 2022-12-16 10:43:01 -08:00
Albert Krewinkel 471317f4fe Extensions: add new function disableExtensions.
The function removes all elements in a second set from a base set.
Extensions in the second set that are not in the base set are ignored.
2022-12-16 10:43:01 -08:00
Albert Krewinkel 0d6c2e3e22 ConTeXt writer: fix previous commit for some unlisted sections
Unlist sections even if `--top-level-division` is not defined.
2022-12-16 14:09:09 +01:00
Albert Krewinkel da2d7ce6f5 ConTeXt writer: add support for unlisted, unnumbered headings
Closes: #8486
2022-12-16 13:48:57 +01:00
John MacFarlane 1698af8885 Textile reader: handle empty paragraphs.
Also, if attributes are added explicitly to a paragraph,
put it in a Div with the attributes.

Closes #8487.
2022-12-15 12:38:36 -08:00
Albert Krewinkel 200ad70d9d T.P.App.OutputSettings: remove unused record field outputWriterName 2022-12-14 20:56:33 +01:00
Albert Krewinkel 8ce28fc4d7 T.P.App: cleanup code, extract internal functions 2022-12-14 20:34:39 +01:00
Albert Krewinkel e08958a66d T.P.App: unify check for standalone output 2022-12-14 16:31:52 +01:00
Albert Krewinkel 3be34077f5 MANUAL: fix typo, spacing
Unified spacing in "Variables for ms" section with surrounding sections;
dropped spurious `s` from `install-font.sh` filename.
2022-12-13 12:44:47 +01:00
Albert Krewinkel 928dde57b9 Lua: add pandoc.cli module
Allow processing of CLI options in Lua.
2022-12-12 09:35:21 -08:00
John MacFarlane 09af316f36 Update default CSL with latest chicago-author-date.csl.
This removes some weird punctuation overrides for Portuguese.
Closes jgm/citeproc#123.
2022-12-12 07:54:00 -08:00
John MacFarlane 3439c1ae94 Docx reader: fix handling of oMathPara in w:p with other content.
Closes #8483.

The problem is that oMathPara can either occur at the block-level
(child of w:body) or at the inline level (child of w:p, potentially
with other content). We need to handle both cases.
Previously the code just assumed that if we had a w:p with an oMathPara,
the math would be the sole content.

This patch removes OMathPara as a constructor of BodyPart
and adds it as a constructor of ParPart.
2022-12-11 20:20:28 -08:00
John MacFarlane 5819e36dfa Use skylighting 0.13.1.2 2022-12-08 12:20:18 -08:00
TomBen 18874be79d Fix a tiny typo in lua-filters.md 2022-12-07 21:28:36 -08:00
Albert Krewinkel e0e6087145 Shared: change defaultBlocksSeparator to PARAGRAPH SEPARATOR
This Unicode char (U+2029) is intended as a semantic separator between
paragraphs; it is cleaner and less intrusive than the pilcrow sign that
we used before. This also changes the default `sep` value used in the
`pandoc.utils.blocks_to_inlines` Lua function.
2022-12-08 00:24:07 +01:00
Albert Krewinkel a03b77fbd3 Lua: support -D CLI option for custom writers [API change]
A new error `PandocNoTemplateError` (code 87) is thrown if a template is
required but cannot be found.
2022-12-05 08:52:37 -08:00
John MacFarlane a4ac1ebb95 Fix metadata parsing corner case.
Closes #8465.
2022-12-04 11:14:43 -08:00
John MacFarlane 634696fb87 HTML writer: remove obsolete stuff about mathml-script.
This was a shim we used to include for mathml support.
We don't do anything with this any more, so this is dead code.
2022-12-04 10:20:22 -08:00
John MacFarlane 732ef20546 HTML writer: include math links if there are raw...
commands or environments that can be interpreted as math e.g. by
MathJax.  See #8469.
2022-12-04 10:14:59 -08:00
John MacFarlane aaa3beacc0 EPUB writer: make title page optional.
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.
2022-12-04 09:59:05 -08:00
Albert Krewinkel b34ec00607 doc/lua-filters.md: add documentation for pandoc.format 2022-12-03 16:22:19 +01:00
John MacFarlane c5beb1db45 Avoid using 'error' for unassigned table cells.
Instead, throw a regular pandoc error.  This is not necessarily
a programming error, as it can be triggered by inserting a
cell with ColSpan 0 in the AST.  Unfortunately the types
don't prevent that.

Closes #8468.
2022-12-02 14:47:29 -08:00
John MacFarlane 8b01e200f0 Multiple input files with --file-scope:
fix case where the links are URL-encoded, e.g. with `%20`.

Closes #8467.
2022-12-01 19:20:06 -08:00