'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.
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.
- 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.
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.
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>
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>
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>
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>
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>
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.
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.
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>