Commit Graph
17867 Commits
Author SHA1 Message Date
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
Evan Silberman 126e3330b9 Parameterize Roff escaping
The existing lexRoff does some stuff I don't want to deal with in mdoc
just yet, like lexing tbl, and some stuff I won't do at all, like
handling macro and text string definitions and switching between modes.
Uses a typeclass with associated type families to reuse most of the
escaping code between Roff (i.e. man) and Mdoc.

Future work could improve on this so that more lexing code could be
shared between Man and Mdoc. Mdoc inherits Roff's surface syntax so
hypothetically it makes sense to lex it into tokens that make sense for
roff. But it happens that the Mdoc parser is much easier to build with
an Mdoc specific token stream. Some discussion in jgm/pandoc#10225 about
the rationale.

Adds a test for the roff \A escape, which I accidentally dropped support
for in an earlier iteration without anything complaining.
2024-12-05 22:57:18 -08:00
John MacFarlane f87116a0b4 Docx reader: improve index reference support.
Support crossrefs.
Clean up and unify switch parsing for fields.
2024-12-05 11:37:09 -08:00
John MacFarlane d07ada43a0 Docx reader: parse index references as empty Spans.
See #10171.
2024-12-05 10:18:48 -08:00
John MacFarlane c34edf6a7e Depend on latest dev texmath, update tests. 2024-12-03 12:17:31 -08:00
John MacFarlane 3255b5dca6 Use latest dev texmath. 2024-12-03 12:01:53 -08:00
John MacFarlane 633929c3f9 Depend on latest dev typst-hs. 2024-12-03 11:21:01 -08:00
John MacFarlane 6021506596 Use dev commonmark-pandoc. 2024-12-03 09:32:51 -08:00
silby 9f6f2c843d Fix comments in TEI writer referring to DocBook (#10430) 2024-12-01 22:09:12 -08:00
John MacFarlane 561e1de8cb Commonmark implicit_figures should check for empty caption...
...and not produce an implicit figure in this case.

Closes #10429.
2024-11-30 09:09:29 -07:00
John MacFarlane 5f4c4ae223 EPUB writer: use standardized filename for cover image...
...instead of the original name.

This avoids problems with e.g. filenames containing spaces.
Closes #10404.
2024-11-24 09:11:52 -08:00
John MacFarlane 7d2bd2c9a0 Markdown writer: issue INFO warning when not rendering table...
...e.g., when `raw_html` is disabled and the table can't be
fit into a supported markdown table format.

Closes #10407.
2024-11-23 10:21:27 -08:00
John MacFarlane 678c791940 MANUAL: clarify what the example of YAML EPUB metadata shows.
Closes #10405.
2024-11-23 10:07:44 -08:00
John MacFarlane f9e424c2f6 Fix stack.yaml. 2024-11-22 10:43:13 -08:00
John MacFarlane 68c65c187a Use latest dev skylighting-core. 2024-11-22 09:37:03 -08:00
silby 1e928814bf Add WebP support to ImageSize (#10397)
Text.Pandoc.ImageSize: Add `Webp` constructor on ImageType.  [API change]
2024-11-22 09:26:29 -08:00
John MacFarlane fabfaabd81 MediaWiki reader: fix indented tables with caption.
Closes #10390.
2024-11-19 09:46:53 -08:00
John MacFarlane 323b7e4d6a Use latest dev skylighting-format-xhtml. 2024-11-19 09:27:00 -08:00
Caleb Maclennan 1e917dd1fc Text.Pandoc.Format: remove duplicate typst entry (#10388) 2024-11-15 20:51:31 +01:00
John MacFarlane bdfe336a63 Use latest dev texmath. 2024-11-13 09:04:05 -08:00
John MacFarlane 5bd609f4ee Use latest dev texmath. 2024-11-13 08:33:24 -08:00
John MacFarlane cf077478d9 Add font-settings.latex partial to pandoc.cabal.
Closes #10379.
2024-11-12 09:11:23 -08:00
Evan Silberman a4b8591150 Respect empty LineBlock lines in ANSI writer 2024-11-11 16:00:47 -08:00
Evan Silberman fdef25eb6e Respect empty LineBlock lines in plain writer
The plain writer behaved as a markdown variant with Ext_line_blocks
turned off, and so empty lines in a line block would get eliminated.
This is surprising, since if there's anything where the intent can be
preserved in plain text output it's empty lines.

It's still a bit surprising to have nbsps in plain text output, as in
the test, where the distinction doesn't really matter, but that'd be an
orthogonal change.
2024-11-11 16:00:47 -08:00
John MacFarlane be734d2543 Remove definitions.typst partial.
Remove unnecessary definition of `endnote`.
Incorporate the one remaining definition into `default.typst`.
2024-11-11 10:23:18 -08:00
John MacFarlane 13d37b4713 Docx reader: don't create multiple paragraphs for title or subtitle.
If there are multiple paragraphs with Title or Subtitle style,
use only the first for metadata.

Note: this is a message-only commit.  The code for this accidentally got
lumped with another change in d5d2821a4d.

Closes #10359.
2024-11-11 09:44:56 -08:00