Commit Graph
18724 Commits
Author SHA1 Message Date
John MacFarlane 48cb073500 flake.nix - mostly cosmetic cleanup 2026-02-01 14:50:50 +01:00
John MacFarlane 4b26f50118 Add support for compiling pandoc.wasm.
'make pandoc.wasm' will compile a wasm version of pandoc.

This also adds a 'repl' flag to pandoc-lua-engine, so that
support for a Lua repl can be disabled for the wasm build.

A new wasm directory contains:

- pandoc.js, a JavaScript wrapper for pandoc.wasm
- index.html + index.js, a web app exposing all of pandoc's
  functionality in a GUI interface
- a set of illustrative examples that can be loaded from the web app

Most of the code in index.html and index.js has been produced in
interaction with Claude code.
2026-02-01 14:50:50 +01:00
John MacFarlane 8efe9bcb4a Change SignPath policy to release-signing. 2026-01-31 15:22:04 +01:00
John MacFarlane 8cdb31d6e0 T.P.Error: define displayException for PandocError.
This is a behavior change, not an API change, since there
was already a definition that defaulted to using Show.
The change here is that we use renderError for a more human-readable
version.
2026-01-31 10:59:13 +01:00
John MacFarlane 8263ea2bf7 Add tests for #8024. 2026-01-31 10:54:59 +01:00
Jacob Larkin 89d78b3ab7 Enhance variable expansion in defaults files
- Factor out expansion logic into expandVars and expandEnv for better
  maintainability and reuse.
- Ensure the '.' variable correctly resolves to the directory of the
  current defaults file, enabling relative paths in inherited defaults.
- Expand environment variables in 'data-dir' and use the expanded
  path when resolving child defaults.
- Allow environment variable expansion within 'defaults' file paths.

These changes make the defaults system more flexible for hierarchical
configurations without breaking backward compatibility.

Closes #8024.
2026-01-31 10:54:59 +01:00
John MacFarlane 818c840e10 Allow defaults files to be either JSON or YAML. 2026-01-31 10:32:51 +01:00
John MacFarlane 828382ba65 Revise change to --extract-media.
An earlier change added the feature that if the specified file
ends in .tar, a tar archive is created instead of a directory.
This has now been changed to create a zip archive if the filename
ends in .zip.
2026-01-30 19:43:32 +01:00
John MacFarlane 0e779d93fd MANUAL.txt: Fix defaults.yaml example for wrap. 2026-01-30 14:11:28 +01:00
John MacFarlane 60cf41f393 Remove statement in manual that alerts only work with gfm/commonmark. 2026-01-27 12:46:58 +01:00
John MacFarlane c8aa6c2a38 Markdown reader: support alerts extension for pandoc markdown.
It is not enabled by default.

Closes #9716.
2026-01-27 12:44:43 +01:00
John MacFarlane cab682ba58 HTML writer: Include all classes on highlighted code elements.
Previously, only the language class was included, and the
others were dropped.

Closes #11423.
2026-01-27 12:00:31 +01:00
John MacFarlane 8191d06aff DocBook reader: omit empty title when not required.
Closes #11422.

This affects example and sidebar elements.
2026-01-27 10:20:31 +01:00
John MacFarlane 675e0c4506 MANUAL.txt: Small rewrite of syntax-highlighting info. 2026-01-25 13:53:42 +00:00
John MacFarlaneandClaude Opus 4.5 f0991cfcbb Reveal.js writer: add idiomatic highlight.js support.
Closes #11420.

When using `--syntax-highlighting=idiomatic` with reveal.js output,
pandoc now generates HTML compatible with reveal.js's built-in
highlight.js plugin:

- Code blocks use `<pre><code class="language-X">` format
- The template loads highlight.js CSS, JS, and RevealHighlight plugin
- Theme defaults to "monokai", configurable via `highlightjs-theme`
   variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 13:53:38 +00:00
John MacFarlane d62fa112c1 Use latest dev djoths 2026-01-24 16:00:41 +01:00
John MacFarlane 6212407eea MediaWiki writer: improve blank space around div elements.
This is merely cosmetic.

Closes #11417.
2026-01-24 14:53:08 +00:00
John MacFarlaneandClaude Opus 4.5 154b36a05e MediaWiki writer: use Doc Text instead of Text for document construction.
This refactors the writer to use Text.DocLayout combinators (vcat, hcat,
literal, blankline, cr, chomp) for building output, following the pattern
used by other text format writers (RST, Markdown, Man). This enables
better control over line spacing and paragraph separation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:32:24 +00:00
John MacFarlaneandClaude Opus 4.5 52120f92a6 Docx writer: replace generic XML traversal with direct path navigation.
Instead of using Data.Generics `everywhere` to traverse the entire XML
tree when setting language attributes, navigate directly to the known
path w:docDefaults/w:rPr/w:lang. This is more efficient and removes the
dependency on Data.Generics (mkT, everywhere).

The new `modifyAtPath` helper function takes a list of predicates that
match element names at each level of the path and modifies only the
target element.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 23:34:03 +01:00
John MacFarlaneandClaude Opus 4.5 94efb21520 Docx writer: refactor writeDocx into helper functions.
Extract 15 helper functions from the monolithic writeDocx function
to improve code clarity and maintainability. The function is now
organized into clear phases with well-typed helpers for each task:

- loadArchives: Load reference and distribution archives
- extractPageLayout: Extract page dimensions from template
- extractRelationships: Parse and augment document relationships
- mkLangTransformer: Build language transformer for XML elements
- mkFootnotesEntry, mkCommentsEntry: Create XML entries
- mkContentTypesEntry, mkDocumentRelsEntry: Create manifest entries
- mkStylesEntry, mkNumberingEntry: Create document formatting entries
- mkCorePropsEntry, mkCustomPropsEntry: Create property entries
- mkPackageRelsEntry: Create package-level relationships
- collectReferenceEntries: Collect auxiliary entries from reference

Also adds module-level constants stdAttributes and settingsElementNames
for clarity. No functional changes; all existing tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 23:34:03 +01:00
Lima User d8fcdbbd22 Add gnumake and unzip to flake.nix 2026-01-23 23:33:57 +01:00
John MacFarlane 49eb145292 Add tests for #7201, #7582. Rescind claim to have fixed #8715. 2026-01-23 23:28:02 +01:00
John MacFarlane b45f6cf86a HTML slide formats: make . . . pause work in nested blocks.
Closes #8715. Closes #7201. Closes #7582.
2026-01-23 16:31:11 +01:00
John MacFarlane c8ad2752c4 Markdown writer: properly handle tables with footers.
Closes #11416.
2026-01-23 10:51:29 +01:00
Gordon Woodhull 07b9e927ca MANUAL: specify lualatex version for tagging/standard support (#11415) 2026-01-22 23:47:17 +01:00
Gordon WoodhullandClaude Opus 4.5 e07a3f3454 LaTeX writer: Add PDF standard support via DocumentMetadata (#11407)
Add `pdfstandard` metadata variable for specifying PDF standards
(PDF/A, PDF/X, PDF/UA) in LaTeX output. Uses LaTeX's \DocumentMetadata
command which requires LuaLaTeX.

- PDF version requirements are automatically inferred, but can be explicitly
  overridden.
- Automatic tagging for standards that require it (ua-1, ua-2, a-2a, a-3a).
- Warning for unsupported standards
- Documentation in MANUAL.txt (Variables for LaTeX, Accessible PDFs)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 20:00:57 +01:00
John MacFarlane 395fb2db43 Docx reader: look inside v:rect as well as v:shape.
This partially addresses #11412, but it would be nice to
add proper handling of the caption.
2026-01-22 19:23:36 +01:00
John MacFarlane d599154394 Markdown reader: allow superscripted spans.
These were being parsed as inline notes. Now we disallow an
inline note followed by attributes, as this is almost certainly
meant to be a span.

Closes #11409.
2026-01-21 17:04:49 +01:00
John MacFarlane 5f398e9698 Fix a couple small documentation errors.
Closes #11408.
2026-01-21 09:54:35 +01:00
John MacFarlane f2c7a9c0cf ADd tar to stack.yaml. 2026-01-19 13:23:28 +01:00
John MacFarlane 754beea13a Use latest dev texmath. 2026-01-19 13:19:10 +01:00
John MacFarlane 1eab54eb92 Allow --extract-media to extract to a tar archive...
instead of a directory.  This happens when the path given has a
.tar extension.
2026-01-18 19:24:02 +01:00
John MacFarlane 363135f65e Use latest dev asciidoctor-hs 2026-01-17 22:33:43 +01:00
John MacFarlane 05b0fcbfbe Use latest dev texmath. 2026-01-17 14:33:11 +01:00
John MacFarlane 2ce4db75da AsciiDoc writer: export spaces inside delimited constructs like emph. 2026-01-16 00:14:23 +01:00
John MacFarlane cb6f5a3b37 DocBook/JATS reader: don't export surrounding space from inline elements.
Previously we would export leading and trailing space inside
elements like emphasis or ulink so they appeared outside the
resulting pandoc Inline (Emph or Link). This is not really
motivated; DocBook and XML in general treats leading and trailing
whitespace in this context as significant.

These spaces may casue problems for some output formats, e.g.
asciidoc, but these issues should be addressed in the
corresponding writers, as they are in the Markdown writer,
using Text.Pandoc.Writers.Shared.delimited.

Closes #11398.
2026-01-15 10:55:58 +01:00
Albert Krewinkel 9219a313e9 Lua: add function pandoc.utils.documentation (#11383)
Closes #10999.

This is now used to generate much of the Lua API documentation.
2026-01-15 09:59:58 +01:00
Chris Callison-BurchandChris Callison-Burch d14dee0dc2 PPTX writer: support notes field in metadata for title slide (#11396)
This adds support for a `notes` field in the YAML metadata block
that will be used as speaker notes for the title slide in PowerPoint
output.

Previously, there was no way to add speaker notes to the title slide
since it is generated from metadata rather than from content blocks.
The `::: notes` syntax only works for content slides.

Example usage:

    ---
    title: My Presentation
    notes: |
      Welcome everyone to this presentation.
      Remember to introduce yourself.
    ---

Closes #5844 (for PPTX output).

Co-authored-by: Chris Callison-Burch <ccb+github@upenn.edu>
2026-01-14 11:14:30 +01:00
John MacFarlane ca0f375498 release-candidate: sign Windows artifacts with SignPath cert. 2026-01-13 11:41:43 +01:00
John MacFarlane 024c5f182c Allow crypton-x509-system 1.8.* 2026-01-13 11:34:47 +01:00
John MacFarlane 425a53489f release-candidate: Another attempt to get signing working. 2026-01-12 22:09:16 +01:00
John MacFarlane 12b3bc3287 release-candidate: add a diagnostic step. 2026-01-12 21:04:05 +01:00
John MacFarlane fe773dca1f release-candidate CI: remove name on upload-unsigned-artifact. 2026-01-12 19:01:47 +01:00
John MacFarlane 3c415f3e50 More fixes for windows code signing process. 2026-01-12 17:40:30 +01:00
John MacFarlane 8af4ede529 Fix signing step in windows CI. 2026-01-12 15:07:34 +01:00
John MacFarlane 11bf7e88a4 Add SignPath signing step to release-candidate CI. 2026-01-12 14:32:03 +01:00
John MacFarlane e720af09e8 MANUAL.txt: Fix link for bbcode_steam.
Closes #11389.
2026-01-09 17:01:57 +01:00
John MacFarlane ee394582c4 doc/custom-writers.md: Fix typo.
Closes #11388.
2026-01-09 17:01:12 +01:00
Albert Krewinkel cb8739f5b0 Lua: switch to HsLua 2.5 2026-01-08 17:55:04 +01:00
John MacFarlane 8123be654d Markdown writer: Allow display math to start/end with space.
This reverts to earlier < 3.7 behavior.
Closes #11384.
2026-01-08 11:41:35 +01:00