Commit Graph
18319 Commits
Author SHA1 Message Date
John MacFarlane 8735bc03d8 Docx reader: fix stringToInteger.
It previously converted things like `11ccc` to an integer;
now it requires that the whole string be parsable as an integer.

Closes #9184.
2025-07-27 10:43:46 -07:00
John MacFarlane caa2193912 Ensure that the default template for xml is null. 2025-07-26 22:45:11 -07:00
John MacFarlane 9b06dc0075 MANUAL.txt: add xml as input/output format. 2025-07-26 22:45:11 -07:00
John MacFarlane 8f6eed7c72 Associate the .xml extension with the XML reader and writer. 2025-07-26 22:45:11 -07:00
massifrg fe3684632b New xml format exactly representing a Pandoc AST.
This adds a reader and writer for an XML format equivalent to `native`
and `json`.

XML schemas for validation can be found in `tools/pandoc-xml.*`.

The format is documented in `doc/xml.md`.

API changes:

- Add module Text.Pandoc.Readers.XML, exporting `readXML`.
- Add module Text.Pandoc.Writers.XML, exporting `writeXML`.

A new unexported module Text.Pandoc.XMLFormat is also added.
2025-07-26 22:45:11 -07:00
Albert Krewinkel cf11339c1d PDF: Improve error readability when pdf-engine is not supported.
Each supported engine is now printed on a line of its own.
2025-07-25 08:22:25 +02:00
Albert Krewinkel 3dfb25bb6c PDF: allow pdflatex-dev and lualatex-dev as PDF engines
These are the development versions of the LaTeX binaries; installable,
e.g., with `tlmgr install latex-base-dev`.

Closes: #10991
2025-07-25 08:19:27 +02:00
Albert Krewinkel 37b446a54c T.P.PDF: clean up makePDF 2025-07-25 07:53:57 +02:00
John MacFarlane 270fbd54f8 Use latest dev citeproc.
This solves the problem of unwanted capitalization of names
at the beginning of citations in footnotes.

Closes #10983.
2025-07-24 14:51:11 -07:00
John MacFarlane 912f4c7977 Revert a test case that changed due to a reverted citeproc change. 2025-07-24 14:51:11 -07:00
Sean Soon 937e20da0e DocBook reader: Add rowspan support. (#10981) 2025-07-24 23:07:50 +02:00
Ryan Gibb b84fa66fcb Org reader: Recognize "fast access" characters in TODO state definitions (#10990) 2025-07-24 22:40:08 +02:00
Christopher Kenny f000fa168b Add features to typst base template.
This implements the changes suggested in #9956, with the exception of
the filecolor/urlcolor one. These would require adding some regex to
guess the link types. This is theoretically possible to do, but it
wasn't clear to me that this is a good thing to put in a default
template. Happy to adjust if you have thoughts on this.

Closes #9956.

Some things to note:

I'm converting colors by passing them as content, as I was seeing pandoc
escape # if that was included.

I set the default fonts for math and code ("raw") to fonts that are
bundled with Typst. These need not be those fonts if there are more
familiar pandoc preferences.
2025-07-24 10:45:28 -07:00
John MacFarlane ebf41dd539 Fix stack.yaml. 2025-07-23 23:32:48 -07:00
John MacFarlane a4872aa223 Use dev texmath. 2025-07-23 18:46:12 -07:00
John MacFarlane 00e02e110b Use latest dev citeproc. 2025-07-23 16:08:34 -07:00
John MacFarlane 521bbb2e0c Fix CI again. 2025-07-23 16:07:09 -07:00
John MacFarlane 84bda29902 CI: another stab at preventing ghc 9.10, 9.12 from erroring. 2025-07-23 15:25:15 -07:00
John MacFarlane 54aef76773 CI: don't warn on unused imports in ghc 9.10+.
For now I want to avoid having to put in lots of CPP.
2025-07-23 15:20:34 -07:00
John MacFarlane 1778cc29a6 Ensure that all modules have explicit export lists. 2025-07-23 14:20:01 -07:00
John MacFarlane fb28952bec Revise Makefile and CI treatment of --ghc-options.
Previously we set `--ghc-options` in Makefile and CI; but this
overrides the ghc-options set in the pandoc.cabal file.

Better to add options one-by-one using `--ghc-option`.

We no longer use GHC_OPTIONS and just put these extra options
in CABAL_OPTIONS.
2025-07-23 14:10:43 -07:00
John MacFarlane 7ec7efeee7 Use latest dev citeproc.
Closes #10983 by allowing `nocase` spans to be used to suppress
capitalization of initial word in a footnote.
2025-07-23 14:10:43 -07:00
Albert Krewinkel 01a305af58 Lua: add function pandoc.path.exists.
The functions allows to check the existence of file-system objects.
2025-07-23 19:31:03 +02:00
John MacFarlane b683726447 Makefile: add -Wall to ghc options. 2025-07-23 09:09:50 -07:00
John MacFarlane 655ad77de1 Fix CI so that -Wall -Werror works again!
We were only getting the return status for the tests, apparently,
from `cabal test`. So now we run `cabal build` separately.
2025-07-23 08:54:52 -07:00
John MacFarlane b84ab366e6 Fix incomplete pattern matches from new ImageType constructor. 2025-07-23 08:51:49 -07:00
John MacFarlane ad1a7b69c7 T.P.ImageSize: support avif images.
[API change] New Avif constructor on ImageType.

Closes #10979.
2025-07-22 22:54:22 -07:00
John MacFarlane edd48fceb1 Djot writer: fix duplicate attributes before section headings.
Closes #10984.
2025-07-22 20:44:19 -07:00
Albert Krewinkel a45878ff1e Markdown writer: match indents in definition items
Previously, the first line of a definition details item always used a
colon and three spaces instead of respecting the tab-stop setting, which
could lead to round-tripping issues.

Likewise, the indentation of continuation paragraphs in definition lists
now matches the two-characters leader of the first line for Markua
output.

Fixes: #10890
2025-07-22 19:07:08 +02:00
Albert Krewinkel f596612abd Typst: add support for custom and/or translated "Abstract" titles
Closes: #9724
2025-07-21 11:11:25 +02:00
John MacFarlane 20950fdfab Fixed cabal.project stanza for citeproc. 2025-07-20 19:19:15 -07:00
John MacFarlane e037059a3a Fix a test. 2025-07-20 17:50:41 -07:00
John MacFarlane 8d9e124878 Use latest dev citeproc. 2025-07-20 16:24:26 -07:00
John MacFarlane 498ef4bf24 Fix pandoc-citeproc-64 test.
It was meant to test subsequent author substitution, but the
new chicago-author-date doesn't do this. So we use a different CSL.
2025-07-20 15:30:14 -07:00
John MacFarlane c9c0328179 Fix citeproc-87 test.
When we updated to the latest chicago-author-date.csl, this test
no longer tested what it was supposed to; so we use a different csl.
2025-07-20 15:29:55 -07:00
John MacFarlane f4eca1f3fb Use latest dev citeproc and update the default CSL...
from the latest chicago-author-date.csl. (Note that this goes
from the 17th to the 18th edition.)

Update tests.
2025-07-20 00:12:15 -07:00
Albert Krewinkel 9893fe8c65 Lua: add normalize function to *Pandoc* objects
This function performs a normalization of Pandoc documents. E.g.,
multiple successive spaces are collapsed, and tables are normalized such
that all rows and columns contain the same number of cells.

Closes: #10356
2025-07-19 15:42:37 +02:00
John MacFarlane 826f487818 Typst writer: set lang attribute in Divs.
Closes #10965.
2025-07-14 11:52:22 -07:00
John MacFarlane ee4c9352ee Remove code duplication around version info.
Text.Pandoc.App.CommandLineOptions and pandoc-cli/src/pandoc.hs
had similar code for generating version information.

To avoid duplication, we now export `versionInfo` from
Text.Pandoc.App [API change]. (The function is reexported from the
non-public module Text.Pandoc.App.CommandLineOptions.)  This function
has three parameters that can be filled in when it is called by
pandoc-cli.

This change will make it simpler to revise version information.
2025-07-13 22:47:11 -07:00
John MacFarlane cff9ace0db Revert "Export copyrightMessage from Text.Pandoc.App module."
This reverts commit 2cf9b55421.
2025-07-13 22:46:10 -07:00
John MacFarlane 2cf9b55421 Export copyrightMessage from Text.Pandoc.App module.
Export `copyrightMessage` from the unexported module
Text.Pandoc.App.CommandLineOptions
and reexport from Text.Pandoc.App [API change].

This avoids the need for a duplicated version in pandoc-cli, which can
now depend on the library's exported version.
2025-07-13 12:33:32 -07:00
John MacFarlane 2e3cb483e9 Use hardcoded string "pandoc" for program name in --version.
Per GNU guidelines:
https://www.gnu.org/prep/standards/html_node/_002d_002dversion.html
2025-07-13 12:23:56 -07:00
John MacFarlane 9d7996ea2b Update --version copyright dates.
Closes #10961.
2025-07-13 09:05:53 -07:00
Sean Soon 2b31cb4a4b doc/lua-filters.md: Add example on using pandoc.Table constructor. (#10956) 2025-07-10 09:46:07 +02:00
John MacFarlane 07e9ef87cc PDF: Use utf8ToText for LaTeX log messages. 2025-07-09 19:02:15 -04:00
John MacFarlane ca2c82133f PDF: make images from MediaBag available in tmp dir...
for every PDF engine, not just LaTeX/ConTeXt.

This is part of the fix for #10911.
2025-07-07 20:27:24 -04:00
John MacFarlane 55f0f88d83 CI: use windows-2022. windows-2019 is no longer provided. 2025-07-06 16:37:21 -04:00
Albert Krewinkel 6b81649771 Lua: add more UTF-8-aware file operations to pandoc.system.
Functions that expect UTF-8-encoded filenames should make it easier to
write platform-independent scripts, as the encoding of the actual
filename depends on the system.

Additionally, this also adds a generalized method to run commands, and
functions to retrieve XDG directory names.

The new functions are `command`, `copy`, `read_file`, `remove`,
`rename`, `times`, `write_file`, `xdg`.
2025-06-30 09:56:08 -06:00
Albert Krewinkel bffdd13038 pandoc-lua-engine: Allow hslua-2.4.0 in the tests 2025-06-25 17:06:55 +02:00
Albert Krewinkel 2de6f2eb83 doc/lua-filters: fix docs for pandoc.Cite. 2025-06-23 13:02:20 +02:00