Commit Graph
17835 Commits
Author SHA1 Message Date
John MacFarlane 7048254397 Allow extracting data: URIs even in PandocPure (--sandbox).
These don't require IO, so we should allow it in sandboxed
mode.  Closes #10249.
2024-10-01 10:16:23 -07:00
John MacFarlane c3eec896ab Text.Pandoc.Class: export extractURIData.
[API change]
2024-10-01 10:15:50 -07:00
John MacFarlane 4f15b03ad2 RST writer: change bullet list hang from 3 to 2.
This accords with the style in the reference docs.
2024-10-01 09:19:53 -07:00
John MacFarlane 0dc660550d Move beamerarticle code from beamer -> latex template. 2024-10-01 09:06:43 -07:00
John MacFarlane 0d9cfc8ec0 Amend the fix to #10236 to handle list tables.
With this patch, we also reuse bullet list code for list tables,
which simplifies the code.
2024-10-01 08:47:29 -07:00
John MacFarlane f202ae1595 Remove refs to pandoc-discuss from issue templates.
See #10247.
2024-10-01 08:40:54 -07:00
Albert Krewinkel a37035caa1 doc/lua-filters.md: list functions in pandoc.utils alphabetically 2024-10-01 12:24:13 +02:00
Albert Krewinkel 4cf6ddb027 Lua: allow returning a single filter from filter files
It is now possible to return a single filter from a filter file, e.g.

``` lua
-- Switch single- and double quotes
return {
  Quoted = function (q)
    elem.quotetype = elem.quotetype == 'SingleQuote'
      and 'DoubleQuote' or 'SingleQuote'
    return elem
  end
}

The filter must not contain numerical indexes, or it might be treated as
a list of filters.
2024-10-01 12:23:36 +02:00
John MacFarlane 752d57dac1 RST writer: handle cases where indented context starts with block quote.
In these cases we emit an empty comment to fix the point from
which indentation is measured; otherwise the block quote is not
parsed as a block quote.

This affects list items and admonitions.

Cloess #10236.
2024-09-30 16:05:57 -07:00
John MacFarlane b4df43b01f LaTeX writer: better fix for lists in definition lists.
In commit a26ec96d89 we added an
empty `\item[]` to the beginning of a list that occurs first
in a definition list, to avoid having one item on the line with
the label.

This gave bad results in some cases (#10241) and there is a more
idiomatic solution anyway: using `\hfill`.

Closes #10241.
2024-09-30 14:38:36 -07:00
John MacFarlane 4b38cbbf54 Fix invalid XML in test/docx/normalize.docx.
Closes #10242.
2024-09-30 14:32:19 -07:00
John MacFarlane c9c40eee8f Beamer template doesn't need amsmath,amssym.
These are loaded by beamer automatically.
2024-09-29 21:27:01 -07:00
John MacFarlane 2406ec1cdb Remove font-settings.tex partial.
We incorporate this into fonts.tex, and move the beamer theme-setting
commands before both of them.
2024-09-29 21:26:56 -07:00
dependabot[bot] e58f5ab701 Bump cachix/install-nix-action from V28 to 29
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V28 to 29. This release includes the previously tagged commit.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/V28...v29)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-29 20:02:35 -07:00
John MacFarlane 2a6268de67 Refactor latex template using partials.
+ Split out common parts of latex template into partials: common.latex,
  fonts.latex, font-settings.latex, passoptions.latex, hypersetup.latex,
  after-header-includes.latex.
+ Split out old latex template into default.latex and default.beamer.
+ Make default.beamer the default template for beamer.
2024-09-29 14:18:31 -07:00
Albert Krewinkel 7565a90cec Stop depending on package SHA
Pandoc already depends on `crypton-conntection`, and thus transitively
on `crypton`. The latter provides a vast variety of hashing algorithms
and makes the dependency on SHA unnecessary.
2024-09-29 18:36:56 +02:00
John MacFarlane 7a96b253c2 Use dev version of texmath. 2024-09-28 12:16:48 -07:00
John MacFarlane 9a3aed9cee RST writer: fix two issues with list tables.
- Fix alignment of list items corresponding to cells.
- Don't enclose the list table in a `.. table::`; this leads to
  doubled captions.

Closes #10226.
Closes #10227.
Modified test output for #4564.
2024-09-27 09:15:23 -07:00
John MacFarlane f672706c6c MANUAL.txt: fix typo introduced by...
...commit bac631fda8.
2024-09-25 21:54:44 -07:00
John MacFarlane 56fc7d5cfc LaTeX reader: add em, ex, px, mu to list of units for dimension args.
Closes #10212.
2024-09-24 08:53:32 -07:00
John MacFarlane f3fff87b2c EPUB reader: fix links to other files in the epub...
making them internal links to a fragment derived from the
filename.  There was already code to handle links like
`#foo`, but not to handle links like `ch0001.html#foo`.

Closes #10207.
2024-09-22 22:49:02 -07:00
John MacFarlane f4fe61a1af Nix CI: re-add nix_path but with proper name of stable channel. 2024-09-22 12:31:10 -07:00
John MacFarlane 82b186bb58 CI: remove channel from nix build. 2024-09-22 12:26:00 -07:00
John MacFarlane 57d97b4293 CI: try changing Nix build to use nix-stable. 2024-09-22 12:23:54 -07:00
Akash PatelandJohn MacFarlane ca348940e3 Add support for list of figures (lof) and list of tables (lot) (#10029)
Two new command-line options are added:

`--lof[=true|false]`, `--list-of-figures[=true|false]`
`--lot[=true|false]`, `--list-of-tables[=true|false]`

Only docx, latex, and context are supported at this point.

Setting the `lof` and `lot` variables will also work for the formats that are
currently supported.

[API changes]

+ Lua: `list_of_figures` and `list_of_tables` can now be used in writer options.
+ Text.Pandoc.Options:  add `writerListOfFigures` and `writerListOfTables` fields
  to `WriterOptions`.
+ Text.Pandoc.App.Opt: add `optListOfFigures` and `optListOfTables` to `Opt`.

Closes #8245.

Co-authored-by: John MacFarlane <jgm@berkeley.edu>
2024-09-22 11:49:52 -07:00
John MacFarlane 46ebe25b69 Dokuwiki reader: be more forgiving about misaligned lists...
like dokuwiki itself. Closes #8863.
2024-09-21 19:35:12 -07:00
John MacFarlane 98e77e02f6 Improve blockquote parsing in dokuwiki.
Allow for quoted code blocks.
2024-09-21 19:26:32 -07:00
John MacFarlane e452f0ca3f DokuWiki reader: enable smart extension. 2024-09-21 19:26:09 -07:00
John MacFarlane 8d35b794e3 DokuWiki reader: properly parse -- and --- as dashes. 2024-09-21 18:33:34 -07:00
John MacFarlane 7e6a3b063e DokuWiki reader: fix block quote behavior.
Closes #6461.

Blockquotes are not really block containers in DokuWiki;
the lines are interpreted literally (so, e.g., you can't
start a list), and line breaks are added at the ends.
2024-09-21 18:33:28 -07:00
John MacFarlane 16a9df8c6b DokuWiki writer: don't emit <HTML> tags.
The use of these tags is now strongly discouraged for security
reasons, and will be removed.

We previously used them as a fallback for lists that could not
be represented using DokuWiki syntax, e.g. ordered lists with
fancy numbers or lists with multiple blocks in their items.

We also used them for block quotes with multiple blocks as
their contents.

We now use the `<WRAP>` syntax (from the optional WRAP plugin)
to handle lists with multiple blocks as their contents.

A new method of handling block quotes with complex contents
has the side benefit of also handling nested block quotes,
which weren't supported before.

`<HTML>` and `<html>` tags are only for raw HTML blocks and
inlines, and only if the `raw_html` extension is enabled. (It is
now a valid extension for `dokuwiki`, though off by default.)

Closes #7413.
2024-09-21 16:58:01 -07:00
Albert Krewinkel 8aa796f30a Lua: support character styling via pandoc.layout
The `Doc` values produced and handled by the `pandoc.layout` module can
now be styled using `bold`, `italic`, `underlined`, or `strikeout`. The
style is ignored in normal rendering, but becomes visible when rendering
to ANSI output. The `pandoc.layout.render` function now takes a third
parameter that defines the output style, either *plain* or *ansi*.
2024-09-21 15:20:34 +02:00
Albert Krewinkel bff35172e3 Fix stack build 2024-09-21 14:08:35 +02:00
Albert Krewinkel 05aa18420f Lua: update List module
The module now comes with a method `:at(index[, def])` that allows to access
indices, accepts negative indices to count from the end, and will return the
`def` value as a default if the list has no item at the given position.

Furthermore, the list constructor `pandoc.List` now accepts iterators. E.g.,
`pandoc.List(text:gmatch '%S+')` returns the list of words in `text`.

Closes: #9835
2024-09-21 10:10:35 +02:00
Albert Krewinkel 5ccf380dad JATS template: support floats-group
The content of the `floats-group` variable is now rendered in a
`<floats-group>` element when using the *publishing* or *archiving* tag
sets.

Discussion: #10196
2024-09-20 17:36:36 +02:00
Olivier Benz 7b48fd5801 linux/make_artifacts.sh: add riscv64 support 2024-09-19 08:20:27 -07:00
Yehuda Katz bac631fda8 Suggest documentation for syntax highlighting issues on Windows
Suggest documentation to preemptively address user issues like #6704
2024-09-18 11:37:13 -07:00
John MacFarlane 56854c22f4 Make env interpolation work for to and from fields...
...in defaults files. These can contain paths of custom readers and
writers. See #8024.
2024-09-16 09:45:47 -07:00
dependabot[bot] 5e3011fe0c Bump cachix/install-nix-action from V27 to 28
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V27 to 28. This release includes the previously tagged commit.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/V27...V28)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-15 21:52:49 -07:00
John MacFarlane 04825ceb6b Text.Pandoc.PDF: read .toc and .log files from output directory.
When this is different from the input directory, this is
where .toc and .log files are written.

Closes #10186.
2024-09-14 17:19:00 -07:00
Erik Rask 1cdf2672f2 Parse id, class, and tabstyle on tables in DocBook Reader
Add parsing of id (xml:id), class, and tabstyle XML attributes
for table and informaltable in the DocBook reader.
The tabstyle value is put in the 'custom-style' attribute.

fixes #10181
2024-09-14 10:21:53 -07:00
John MacFarlane fe9459c754 Fix test case #10185. 2024-09-14 10:18:52 -07:00
John MacFarlane 8d09a58857 LaTeX writer: avoid error on refs div with empty citations.
If there are no citations, don't emit an empty CSLReferences
environment.

Closes #10185.
2024-09-14 10:12:07 -07:00
John MacFarlane 8c14784f41 HTML writer: don't emit missing title/lang warnings if templates...
does not contain the `pagetitle` or `lang` variables respectively.

Closes #9370.
2024-09-13 20:45:19 -07:00
John MacFarlane fdbfb7a807 T.P.Shared addPandocAttributes - modify for new commonmark-pandoc.
The new commonmark-pandoc version automatically adds the
attribute `wrapper="1"` on all Divs and Spans that
are introduced just as containers for attributes that belong
properly to their contents.  So we don't need to add the
attribute here.

This gives much better results in some cases. Previously the
wrapper attribute was being added even for explicit Divs and
Spans in djot, but it is not needed in these cases.
2024-09-13 09:35:33 -07:00
John MacFarlane 62b7b17472 Use latest djoths. 2024-09-13 09:35:33 -07:00
John MacFarlane 1bb01ece75 Fix stack.yaml. 2024-09-12 09:58:31 -07:00
John MacFarlane 289d8bafcb Use dev djoths. 2024-09-12 08:29:47 -07:00
John MacFarlane f28de2f8ee Use dev commonmark-hs. 2024-09-11 12:01:59 -07:00
Evan Silberman e81c2d4bf8 Fix copy-pasteo in ANSI writer subscripts
The ANSI Superscript writer was copy-pasted and incompletely modified to
create the Subscript output writer and I forgot to call the right
function, so subscripts were getting rendered with superscripted
numbers. Adds a line for this to the ANSI golden test.
2024-09-11 08:44:48 -07:00