Commit Graph
17892 Commits
Author SHA1 Message Date
John MacFarlane 484b337b2b Textile reader: improve parsing of spans.
The span needs to be separated from its surroundings by spaces.
Also, a span can have attributes, which we now attach.

Closes #9878.
2024-12-17 23:07:04 -08:00
John MacFarlane 9acff9924f Textile reader: inline constructors don't trigger if closer...
...is preceded by whitespace.

Closes #10414.
2024-12-17 20:37:01 -08:00
John MacFarlane 63a949d730 LaTeX writer: use displayquote for block quotes with csquotes.
Closes #10456.
2024-12-17 20:03:23 -08:00
John MacFarlane e096e06a84 Typst writer: properly handle data: URIs in images.
We need to produce an svg tag and parse it using `image.decode`.
This is slightly roundabout but doesn't require any external
libraries.

Closes #10460.
2024-12-17 17:56:59 -08:00
John MacFarlane 7a66c946e2 Docx writer: use styleIds not styleNames for Title, Subtitle, etc.
This change affects the default openxml template as well as the
OpenXML writer.

Closes #10282 (regression introduced in pandoc 3.5).
2024-12-17 17:33:17 -08:00
John MacFarlane d6edb57797 Text.Pandoc.PDF: fix temp file extension in toPdfViaTempFile.
We used to set this to `.html`, but this seemed inappropriate
once we started using this function for `--pdf-engine=typst`.
So we changed it in pandoc 3.6 to `.source`. But apparently
`wkhtmltopdf` needs it to be `.html`.  So now we have added
a parameter to `toPdfViaTempFile` that allows the extension
to be specified.

Closes #10468.
2024-12-17 17:30:29 -08:00
Thomas Hodgson 7d1962b617 Move nocites from LaTeX preamble to body (#10465)
Closes #10461.

Putting `\nocite` in the preamble works only with biblatex.
2024-12-17 10:17:13 -08:00
Joseph C. Sible 58cc5cc57e Use lastMay instead of reverse 2024-12-14 17:08:53 -08:00
Joseph C. Sible 9bb67d666f Store a function instead of a Boolean
Instead of storing isDisplay and then always choosing displayMath or math
based on that, just store displayMath or math directly.
2024-12-14 17:08:53 -08:00
Joseph C. Sible a63cf069e3 Use <$> instead of >>= and return 2024-12-14 17:08:53 -08:00
Joseph C. Sible 3f49e1a7d8 Put the length in the range expression instead of calling take later 2024-12-14 17:08:53 -08:00
Joseph C. Sible a779963f1a Remove redundant null check
"all f []" is always true, so "null xs || all f xs" can be simplified
to just "all f xs".
2024-12-14 17:08:53 -08:00
Joseph C. Sible 393991afda Use the definition of unsnoc from base
This is more efficient than the existing one.
2024-12-14 17:08:53 -08:00
Joseph C. Sible 02347275e2 Use catMaybes instead of building with maybe and (:) one element at a time 2024-12-14 17:08:53 -08:00
Joseph C. Sible 48d83b6ffe Remove several unnecessary layers of indirection from refs 2024-12-14 17:07:23 -08:00
John MacFarlane d04e490f1d Allow YAML bibliographies to be arrays of references.
Previously, they had to be YAML objects with a `references` key.

Closes #10452.
2024-12-11 19:38:00 -08:00
John MacFarlane 4272e8a7c2 Cosmetic code improvement. 2024-12-11 18:36:07 -08:00
John MacFarlane b0b8f1ff69 Depend on citeproc 0.8.1.2. 2024-12-11 09:00:51 -08:00
John MacFarlane f6d617cb88 Use dev version of citeproc.
Closes #10451.
2024-12-10 14:33:32 -08:00
Albert Krewinkel 0b8312990f stack.yaml: Switch to stackage resolver lts-23.0 2024-12-10 17:59:24 +01:00
Albert Krewinkel a084731070 Lua: support more elements as input to pandoc.utils.stringify.
Elements of type Caption, Cell, TableHead, and TableFoot can now be
stringified.

Fixes: #10450
2024-12-10 11:45:51 +01:00
Albert Krewinkel 64f45fefa7 Lua: add Caption constructor to pandoc module. 2024-12-10 11:06:37 +01:00
Albert Krewinkel 8c96c6e776 doc/lua-filters.md: Fix links to constructors.
This was broken when the respective sections started to be
autogenerated.
2024-12-10 11:06:37 +01:00
John MacFarlane 480e0c9322 Add silby to funding. 2024-12-09 17:06:51 -08:00
John MacFarlane 61aff67b3c Minor tweaks to changelog formatting. 2024-12-07 21:44:28 -08:00
John MacFarlane 8a72b8449d stack.yaml - add crypton-x509-validation 3.6 pandoc-cli-3.6 pandoc-server-0.1.0.10 pandoc-lua-engine-0.4 2024-12-07 19:37:33 -08:00
John MacFarlane 16300a9d8e Add to AUTHORS.md. 2024-12-07 17:58:53 -08:00
John MacFarlane e2dac578c4 stack.yaml - use more recent versions of tls, crypton-connection 2024-12-07 17:56:41 -08:00
John MacFarlane 18931eda90 Add copyright info to two modules missing it. 2024-12-07 17:39:33 -08:00
John MacFarlane 56d552ff42 Regenerate README.md 2024-12-07 17:39:31 -08:00
John MacFarlane 890d7df732 Changelog tweaks. 2024-12-07 17:37:36 -08:00
John MacFarlane 59d4c5e5f2 Date manual and regenerate man pages. 2024-12-07 17:34:04 -08:00
John MacFarlane 9adfc7d16e Depend on new releases of commonmark-extensions, commonmark-pandoc. 2024-12-07 16:19:54 -08:00
John MacFarlane c4aebcc406 Depend on released skylighting, skylighting-core 0.14.4. 2024-12-07 16:04:30 -08:00
John MacFarlane 158716f47a Depend on skylighting-format-blaze-html 0.1.1.3. 2024-12-07 14:09:42 -08:00
John MacFarlane dce53209ad update stack.yaml. 2024-12-07 13:59:23 -08:00
John MacFarlane aaf9223b78 Depend on typst 0.6.1 2024-12-07 13:55:11 -08:00
John MacFarlane 920747918c Depend on released pandoc-lua-marshal 0.3.0. 2024-12-07 13:31:33 -08:00
John MacFarlane 379e0e6b6d Depend on texmath 0.12.8.12 2024-12-07 13:21:59 -08:00
John MacFarlane 809b7da7ca Bump pandoc-lua-engine to 0.4 and depend on it in pandoc-cli. 2024-12-07 12:32:19 -08:00
John MacFarlane 7f26c113b1 Bump pandoc-cli to 0.6, depend on pandoc 0.6. 2024-12-07 12:30:00 -08:00
John MacFarlane ac503ce6fe Bump pandoc-server version to 0.1.0.10 2024-12-07 12:29:15 -08:00
John MacFarlane 20287b0268 Bump to 3.6, update changelog. 2024-12-07 12:28:17 -08:00
John MacFarlane 567e6a15ac Stylistic tweak. 2024-12-07 11:42:34 -08:00
John MacFarlane 9013814c82 Ensure that --sandbox affects --embed-resources.
Previously it did not (contrary to what was implied by the manual),
which means that an image with URL `/etc/passwd` would leak an
encoded version of that file to HTML output with `--self-contained`
or `--embed-resources`, even if `--sandbox` was used.

Thanks to Samuel Mortenson for pointing out the issue.
2024-12-07 11:40:46 -08:00
John MacFarlane 8cf9da6b40 T.P.App.OutputSettings: add sandbox' function.
This computes the sandboxed files from Opt and avoids some
code repetition in T.P.App and T.P.App.OutputSettings.
2024-12-07 11:39:17 -08:00
John MacFarlane e70c2ac2ee Docx reader: handle \b, \i, \y modifiers in XE index entries.
See #10171.
2024-12-07 09:28:53 -08:00
John MacFarlane e9389ab4d5 HTML reader: parse footnotes defined by dpub-aria roles.
Closes #5294.
2024-12-07 08:57:35 -08:00
Evan Silberman 5f35aa678f List mdoc as a reader format in the manual 2024-12-05 22:57:18 -08:00
Evan Silberman 13b3453009 Add mdoc reader
This change introduces a reader for mdoc, a roff-derived semantic markup
language for manual pages. The two relevant contemporary implementations
of mdoc for manual pages are mandoc (https://mandoc.bsd.lv/), which
implements the language from scratch in C, and groff
(https://www.gnu.org/software/groff/), which implements it as roff macros.

mdoc has a lot of semantics specific to technical manuals that aren't
representable in Pandoc's AST. I've taken a cue from the mandoc HTML
output and many mdoc elements are encoded as Codes or Spans with classes
named for the mdoc macro that produced them.

Much like web browsers with HTML, mandoc attempts to produce best-effort
output given all kinds of weird and crappy mdoc input. Part of the
reason it's able to do this is it uses a very accommodating parse tree
and stateful output routines specialized to the output mode, and when it
encounters some macro it wasn't expecting, it can easily give up on
whatever it was outputting and output something else. I've encoded as
much flexibility as I reasonably could into the mdoc reader here, but I
don't know how to be as flexible as mandoc.

This branch has been developed almost exclusively against mandoc's
documentation and implementation of mdoc as a reference, and the
real-world manual pages tested against are those from the OpenBSD base
system. Of ~3500 manuals in mdoc format shipped with a fresh OpenBSD
install, 17 cause the mdoc reader to exit with a parse error. Any
further chasing of edge cases is deferred to future work.

Many of the tests in test/Tests/Readers/Mdoc.hs are derived directly
from mandoc's extensive regression tests.

[API change] Adds readMdoc to the public API
2024-12-05 22:57:18 -08:00