464 Commits

Author SHA1 Message Date
John MacFarlane 87bc462713 Typst writer: make writer sensitive to typst-label attribute.
If this attribute is set, the writer will output a label.
(This overrides labels based on identifiers, when identifiers
are present.)

Note that labels in typst need not be unique and may be used to
style elements using show rules.  For example, one can attach
an `excerpt` label to all Divs that are excerpts, and style this
using a show rule like `#show <excerpt>: set text(blue)`.

See discussion at #11794.
2026-08-07 10:39:33 -07:00
John MacFarlane 9d6d0d4d06 Add twenty-years-of-pandoc.md.
Changelog - fix pandoc 0.1 release date.

I found the real date in an email to a friend.
2026-08-02 16:48:35 -07:00
John MacFarlane d4e350c25a extras: add link to @tarleb's logo. 2026-07-18 10:16:51 +02:00
Enrico Spinielli 090cb52f0a Fix typo in lua-filters.md (#11724)
Removed duplicated 'using'
2026-06-23 01:46:54 +02:00
John MacFarlane f8d6a6fca2 Update pandoc-server docs with typst-inputs 2026-06-03 16:34:44 +02:00
John MacFarlane 408b177bba Add NAME heading to pandoc-lua, pandoc-server man pages.
Closes #11634.
2026-05-11 12:29:45 +02:00
Albert Krewinkel 62ac67cff4 Lua: Add constructor pandoc.TableBody 2026-04-23 15:19:56 +02:00
Albert Krewinkel e38494be9a doc/lua-filters.md: Re-indent definition list items
This is due to the changes in commit 8ce63ffe2.
2026-04-23 15:19:50 +02:00
John MacFarlane 55fc212b0b Add Panache to extras. 2026-03-21 16:49:34 +01:00
Albert Krewinkel f9fb410cd9 Lua: add new function pandoc.types.Sources.
This provides access to the `Sources` abstraction that pandoc uses for
input files.

Closes: #11441
2026-02-09 22:03:06 +01:00
John MacFarlane 5f398e9698 Fix a couple small documentation errors.
Closes #11408.
2026-01-21 09:54:35 +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
John MacFarlane ee394582c4 doc/custom-writers.md: Fix typo.
Closes #11388.
2026-01-09 17:01:12 +01:00
Albert Krewinkel 8f8ea44d02 Lua: add function pandoc.with_state
The function allows to run a callback with a modified pandoc state. This
provides the ability to temporarily modify the resource path, the user
data directory, and the HTTP request headers.

Closes: #10859
2026-01-02 11:10:09 -05:00
Emmanuel Ferdman 8a76a6fef1 Correct anchor references to pandoc.text module documentation (#11205)
Closes #11111.
2025-10-10 10:14:59 +02:00
Albert Krewinkel 204ea63107 doc/lua-filters.md: remove outdated notes about lpeg/re globals.
The globals hold the same values that are returned by `require 'lpeg'`
and `require 're'`, respectively. This was changed in pandoc 3.3.
2025-09-04 16:40:07 +02:00
Albert Krewinkel e0acb24528 Refactor highlighting options [API Change]
A new command line option `--syntax-highlighting` is provided; it takes
the values `none`, `default`, `idiomatic`, a style name, or a path to a
theme file. It replaces the `--no-highlighting`, `--highlighting-style`,
and `--listings` options.

The `writerListings` and `writerHighlightStyle` fields of the
`WriterOptions` type are replaced with `writerHighlightStyle`.

Closes: #10525
2025-09-02 17:50:47 +02:00
Castedo Ellerman fce2ae101d doc page: add Baseprinter pandoc wrapper to extras 2025-08-26 12:23:36 +02:00
Albert Krewinkel a36654b222 Lua: add function pandoc.structure.unique_identifier.
The function generates element identifiers based on inlines content.
It's primary use case is the programmatic generation of ID, similar to
what the `auto_identifiers` extension provides for many formats.
2025-08-12 21:37:35 +02:00
Albert Krewinkel 68d80cc9d9 Lua: add functions pandoc.text.superscript and subscript.
The functions convert numbers and parentheses to superscript and
subscript, respectively.
2025-08-12 08:47:49 +02:00
Albert Krewinkel 75aee7a23c Lua: use proper interface functions to access the CommonState.
- The `PANDOC_STATE` is no longer a userdata object, but a table that
  behaves like the old object.

- Log messages in `PANDOC_STATE.log` are now in temporal order.
2025-08-01 10:04:14 -07:00
R. N. West (Nat) 9d56205784 docs: Don't encourage returning tables of filters from Lua filters (#11000)
See #10995. Use the `Pandoc:walk` method instead.
2025-07-29 16:16:38 -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 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
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
Sean Soon 2b31cb4a4b doc/lua-filters.md: Add example on using pandoc.Table constructor. (#10956) 2025-07-10 09:46:07 +02: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 2de6f2eb83 doc/lua-filters: fix docs for pandoc.Cite. 2025-06-23 13:02:20 +02:00
Erik Post 6218393698 doc/extras.md: Fix link to pandoc-mode 2025-06-16 10:46:09 -07:00
Albert Krewinkel c92cc277f5 doc/lua-filters.md: add missing docs for pandoc.Caption 2025-05-28 14:00:42 +02:00
Albert Krewinkel e6bd65ee19 doc/lua-filters.md: Re-generate docs
Pandoc now uses fewer spaces when outputting list items.
2025-05-28 13:56:08 +02:00
Albert Krewinkel ce5e2a2efc Lua: add function pandoc.mediabag.make_data_uri.
The function takes a MIME type and raw data from which it creates an
RFC 2397 data URI.

Closes: #10876
2025-05-28 13:19:01 +02:00
Albert Krewinkel 992842d07b Lua: accept filename-contents pairs as env for pandoc.read
Key-value pairs, mapping from filename to contents, can be used to fill
the ersatz file system used in the reader sandbox.
2025-05-14 09:17:24 -07:00
Albert Krewinkel 5b896bc1a9 Lua: allow to pass files to the pandoc.read sandbox
The sandbox is now enabled if the fourth parameter is a list of files.
The files are read and then made available in the sandbox via a mock
file system.
2025-05-14 09:17:24 -07:00
Albert Krewinkel 31f74fac06 Lua: support sandboxed parsing with pandoc.read.
The function `pandoc.read` is now taking an optional fourth parameter
that specifies the environment in which the parser will be run. Passing
the string `sandbox` as the argument causes the reader to run in a
sandbox, thereby preventing all access to the network and file system.

Closes: #10831
2025-05-13 23:38:36 +02:00
Niklas Eicker 82ff661b1a Mention in the docs, that typst:no-figure is a class, not an attribute (#10826) 2025-05-07 14:56:29 -07:00
R. N. West 7930fd143d doc/lua-filters.md: Add missing html_math_method 'katex' 2025-02-24 16:45:13 +01:00
Charles Tapley Hoyt 1eed55f391 Add CRediT roles to JATS
Enable annotating author roles using the Contribution Role Taxonomy
(CRediT) and export this information in conformant JATS

Closes #10152.

Co-Authored-By: Jez Cope <457628+jezcope@users.noreply.github.com>
2025-02-05 21:28:56 -08:00
Albert Krewinkel 6c31896c29 doc/lua-filters: add note about extensions handling in read and write 2025-02-04 10:46:47 +01:00
R. N. West (Nat) 77fca2d61a doc/lua-filters.md: Correct luacheck URL (#10589) 2025-01-31 08:56:47 -08:00
R. N. West 31e36d4fd5 doc/extras.md: Add entry for pandoc-subfigs
https://github.com/rnwst/pandoc-subfigs
2025-01-30 16:51:17 +01:00
R. N. West d8af7b05c7 doc/extras.md: Update diagram Lua filter URL (and description) 2025-01-30 16:51:17 +01:00
R. N. West (Nat) f17de990b4 doc/lua-filters.md: Add static analysis paragraph to debugging section (#10568) 2025-01-29 13:22:04 -08:00
John MacFarlane 4814067f5a lua-filters.md: document system.os return values.
Closes #10523.
2025-01-11 10:25:46 -08: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
Andreas Deininger eeb8b1eb3a Fix typos (#10349) 2024-11-06 10:04:33 -08:00
Albert Krewinkel daef2fd53e doc/libraries.md: Sort list alphabetically 2024-10-23 11:08:00 +02:00
Albert Krewinkel aeb0f2a19b doc/libraries.md: Add newly developed Haskell packages 2024-10-23 11:00:02 +02:00
Albert Krewinkel 734227a59d doc/lua-filters.md: document pandoc.List:iter method
List objects have a new function `iter` that returns an iterator
function that returns the next list item on each call.
2024-10-14 07:15:34 +02:00
Albert Krewinkel a37035caa1 doc/lua-filters.md: list functions in pandoc.utils alphabetically 2024-10-01 12:24:13 +02:00