Commit Graph
16256 Commits
Author SHA1 Message Date
John MacFarlane 538e63846d Macos release candidate action: fix version.txt. pandoc-cli-0.1 pandoc-lua-engine-0.1 3.0 pandoc-server-0.1 2023-01-18 13:07:54 -08:00
John MacFarlane 28e535926a Regenerate man page. 2023-01-18 12:15:16 -08:00
John MacFarlane f66d5f4215 Fix version for pandoc-lua-marshall in stack.yaml. 2023-01-18 11:26:35 -08:00
John MacFarlane 8a1f4ad513 Add param to tocToList for numberSections.
Otherwise sections are always numbered in the TOC,
even if `--number-sections` is not used.
2023-01-18 11:15:57 -08:00
John MacFarlane 27d2dc6821 Small changelog fixes. 2023-01-18 11:05:09 -08:00
John MacFarlane 2c299d7991 Use released versions of packages. 2023-01-18 11:05:09 -08:00
Albert Krewinkel 71078d6546 AUTHORS.md: cleanup
Removed duplicates: badumont is Bastien Dumont, argent0 is Aner Lucero,
danse is Francesco Occhipinti.
2023-01-18 19:21:19 +01:00
Albert Krewinkel 3a0fc17880 Lua: add function pandoc.format.extensions.
This simplifies the creation of custom readers and writers that are
based on built-in formats.
2023-01-18 08:59:53 -08:00
Ilona Silverwood 671cfcd869 doc/custom-reader.md: rewrite BytestringReader paragraph 2023-01-18 17:24:00 +01:00
Albert KrewinkelandIlona Silverwood 86a7e34a85 MANUAL: improve phrasing in PDF accessibility section
Co-authored-by: Ilona Silverwood <ilonasilverwood@gmail.com>
2023-01-18 17:11:49 +01:00
Albert Krewinkel 39830e1f61 Fix line lengths in Markdown reader, DocBook writer
Trying to limit lines to 80 chars.
2023-01-18 16:02:57 +01:00
John MacFarlane 8a9116e159 Remove superfluous extra-packages in stack.yaml. 2023-01-17 21:35:44 -08:00
John MacFarlane 0eb4f9c03d Use latest dev pandoc-lua-marshall. 2023-01-17 21:32:32 -08:00
John MacFarlane aff768e28b Add some test files to pandoc.cabal. 2023-01-17 21:30:40 -08:00
John MacFarlane 383ac41a76 Regenerate README.md. 2023-01-17 21:29:05 -08:00
John MacFarlane 2b19d29910 Fix spacing errors. 2023-01-17 21:28:49 -08:00
John MacFarlane e8e1b427e1 Update AUTHORS.md. 2023-01-17 21:26:15 -08:00
John MacFarlane 51289eb66f Update man pages. 2023-01-17 21:19:25 -08:00
John MacFarlane 66dcba5215 Update MANUAL.txt date. 2023-01-17 21:18:15 -08:00
John MacFarlane 44c39a8002 Update changelog.md. 2023-01-17 21:16:44 -08:00
John MacFarlane 70e6f51b96 Add FAQ on producing pdf/a.
See #3215.
2023-01-17 19:29:30 -08:00
Albert Krewinkel 45c915f3d8 MANUAL: add section on accessible PDFs, archiving standards
Supersedes, closes: #8312
2023-01-17 07:55:51 -08:00
John MacFarlane be99929bd8 Update provisional changelog. 2023-01-16 22:50:43 -08:00
Albert Krewinkel 5d58f060ac Lua: Add function pandoc.mediabag.write.
Allows to write the complete mediabag or just a specific file to a given
directory.
2023-01-16 10:12:09 -08:00
Albert Krewinkel 6934ba3d24 T.P.Class.IO: export function writeMedia [API change]
This is useful for the `pandoc.mediabag` module.
2023-01-16 10:12:09 -08:00
John MacFarlane ab32bfc697 Use dev citeproc. 2023-01-16 10:10:01 -08:00
Albert Krewinkel 8e688c2b0c Add tests for org tags
These were intended to be part of commit 0cc908519.
2023-01-16 18:21:36 +01:00
John MacFarlane c6551433b2 T.P.Chunks changes.
+ Re-use `toTocTree` in constructing `chunkedTOC`.
  Previously we used an entirely different function toTOCTree'.
+ Improve `tocToList` so that it avoids empty lists of
  items that are omitted because they are below the toc depth.

pandoc-lua-engine:

+ Fix structure tests in light of last change.

T.P.Writers.ChunkedHTML:

+ Reuse `tocToList` in `buildTOC`.

T.P.Writers.EPUB:

+ Adjust EPUB writer for Chunks changes.
2023-01-15 22:32:16 -08:00
Albert Krewinkel cdf8c69fb9 Lua: add module pandoc.structure.
Adds support for table of contents and chunks handling. The function
`make_sections` has been given a friendlier interface and was moved to
the new module; the old `pandoc.utils.make_sections` has been
deprecated.
2023-01-15 10:47:54 -08:00
Albert Krewinkel 932053d970 Export module Text.Pandoc.Slides [API Change] 2023-01-15 10:47:54 -08:00
Albert Krewinkel 89800c3f9e Chunks: export tocToList 2023-01-15 10:47:54 -08:00
Albert Krewinkel ca6d4bfa49 Markdown, CommonMark: add support for wiki links. [API change]
Adds the Markdown/CommonMark extensions `wikilinks_title_after_pipe` and
`wikilinks_title_before_pipe`. The former enables links of style `[[Name
of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are
optional in both variants, so this works for both:
`[[https://example.org]]`, `[[Name of page]]`.

The writer is modified to render links with title `wikilink` as a
wikilink if a respective extension is enabled.

Pandoc will use `wikilinks_title_after_pipe` if both extensions are
enabled.

Closes: #2923
2023-01-15 10:46:55 -08:00
Albert Krewinkel c71d476fa6 ConTeXt writer: support tagging extension [API Change]
Paragraphs are enclosed by `\bpar` and `\epar` commands, and `highlight`
commands are used for emphasis. This results in much better tagging in
PDF output.
2023-01-15 10:03:58 -08:00
Albert Krewinkel 8f394a17f2 Remove Null constructor from docs 2023-01-14 10:10:26 +01:00
John MacFarlane 7a9d8ccaa1 Update provisional changelog. 2023-01-13 21:32:52 -08:00
John MacFarlane 676a6b1f82 Remove block constructor Null from the code base.
It has been removed from pandoc-types.
2023-01-13 15:20:50 -08:00
John MacFarlane b2d93afddb Use latest pandoc-types (removing Null). 2023-01-13 15:10:19 -08:00
John MacFarlane 3376286b7d Update pandoc-lua-engine test: test for Figure, not Null. 2023-01-13 15:08:57 -08:00
John MacFarlane cfa5ef7baa Use latest dev pandoc-lua-marshal. 2023-01-13 15:08:47 -08:00
John MacFarlane 0b02f177fb Use latest dev pandoc-lua-marshal. 2023-01-13 12:59:13 -08:00
Albert Krewinkel 0cc9085198 Org writer: use span attributes tag-name in headers as tags.
This enables round-tripping of tags in Org headings.

Closes: #8513
2023-01-13 19:52:24 +01:00
John MacFarlane aa747f194f Require pandoc-types 1.23, update dependencies.
This fails to build because pandoc-lua-marshal still needs updating.
2023-01-13 10:42:07 -08:00
John MacFarlane 2d72e968e3 Use latest dev pandoc-types. 2023-01-13 10:23:41 -08:00
John MacFarlane 94f23d8aef ChunkedHTML writer: use fetchItem to get resources.
This ensures that they can be gotten from e.g. docx input.
2023-01-13 10:01:26 -08:00
John MacFarlane af708abb04 Use dev jgm/pandoc-types. 2023-01-13 09:40:46 -08:00
Albert KrewinkelandAner Lucero 909ced5153 Support complex figures. [API change]
Thanks and credit go to Aner Lucero, who laid the groundwork for this
feature in the 2021 GSoC project. He contributed many changes, including
modifications to the readers for HTML, JATS, and LaTeX, and to the HTML
and JATS writers.

Shared (Albert Krewinkel):

- The new function `figureDiv`, exported from `Text.Pandoc.Shared`,
  offers a standardized way to convert a figure into a Div element.

Readers (Aner Lucero):

- HTML reader: `<figure>` elements are parsed as figures, with the
  caption taken from the respective `<figcaption>` elements.

- JATS reader: The `<fig>` and `<caption>` elements are parsed into
  figure elements, even if the contents is more complex.

- LaTeX reader: support for figures with non-image contents and for
  subfigures.

- Markdown reader: paragraphs containing just an image are treated as
  figures if the `implicit_figures` extension is enabled. The identifier
  is used as the figure's identifier and the image description is also
  used as figure caption; all other attributes are treated as belonging
  to the image.

Writers (Aner Lucero, Albert Krewinkel):

- DokuWiki, Haddock, Jira, Man, MediaWiki, Ms, Muse, PPTX, RTF, TEI,
  ZimWiki writers: Figures are rendered like Div elements.

- Asciidoc writer: The figure contents is unwrapped; each image in the
  the figure becomes a separate figure.

- Classic custom writers: Figures are passed to the global function
  `Figure(caption, contents, attr)`, where `caption` and `contents` are
  strings and `attr` is a table of key-value pairs.

- ConTeXt writer: Figures are wrapped in a "placefigure" environment
  with `\startplacefigure`/`\endplacefigure`, adding the features
  caption and listing title as properties. Subfigures are place in a
  single row with the `\startfloatcombination` environment.

- DocBook writer: Uses `mediaobject` elements, unless the figure contains
  subfigures or tables, in which case the figure content is unwrapped.

- Docx writer: figures with multiple content blocks are rendered as
  tables with style `FigureTable`; like before, single-image figures are
  still output as paragraphs with style `Figure` or `Captioned Figure`,
  depending on whether a caption is attached.

- DokuWiki writer: Caption and "alt-text" are no longer combined. The
  alt text of a figure will now be lost in the conversion.

- FB2 writer: The figure caption is added as alt text to the images in
  the figure; pre-existing alt texts are kept.

- ICML writer: Only single-image figures are supported. The contents of
  figures with additional elements gets unwrapped.

- HTML writer: the alt text is no longer constructed from the caption,
  as was the case with implicit figures. This reduces duplication, but
  comes at the risk of images that are missing alt texts. Authors should
  take care to provide alt texts for all images.

  Some readers, most notably the Markdown reader with the
  `implicit_figures` extension, add a caption that's identical to the
  image description. The writer checks for this and adds an
  `aria-hidden` attribute to the `<figcaption>` element in that case.

- JATS writer: The `<fig>` and `<caption>` elements are used write
  figures.

- LaTeX writer: complex figures, e.g. with non-image contents and
  subfigures, are supported. The `subfigure` template variable is set if
  the document contains subfigures, triggering the conditional loading
  of the *subcaption* package. Contants of figures that contain tables
  are become unwrapped, as longtable environments are not allowed within
  figures.

- Markdown writer: figures are output as implicit figures if possible,
  via HTML if the `raw_html` extension is enabled, and as Div elements
  otherwise.

- OpenDocument writer: A separate paragraph is generated for each block
  element in a figure, each with style `FigureWithCaption`. Behavior for
  single-image figures therefore remains unchanged.

- Org writer: Only the first element in a figure is given a caption;
  additional block elements in the figure are appended without any
  caption being added.

- RST writer: Single-image figures are supported as before; the contents
  of more complex images become nested in a container of type `float`.

- Texinfo writer: Figures are rendered as float with type `figure`.

- Textile writer: Figures are rendered with the help of HTML elements.

- XWiki: Figures are placed in a group.

Co-authored-by: Aner Lucero <4rgento@gmail.com>
2023-01-13 09:13:27 -08:00
John MacFarlane 8a10300785 HTML style template: put Consolas before Lucida Console for code font.
This is to prevent Lucida Console from being used on Windows, where
there seems to be a spacing issue in some applications, with boldface
glyphs wider than regular ones.

Closes #8543.
2023-01-13 08:47:19 -08:00
John MacFarlane 4db5b05abc Use latest dev citeproc.
This gives us better date sorting in apa style.
2023-01-12 23:24:32 -08:00
Ruqi fdfa9fca68 Refine "blending" rules for MediaWiki links
The rules for "blending" characters outside a link into the link are
described here: https://en.wikipedia.org/wiki/Help:Wikitext#Blend_link

These pose a problem for CJK languages, which generally don't have
spaces after links.

However, it turns out that the blending behavior, as implemented on
Wikipedia, is (contrary to the documentation) only for ASCII letters.
This commit implements that restriction, which fixes the problem for
CJK.  (#8525)
2023-01-12 22:02:56 -08:00
lifeunleaded 4746d0c806 Store "unnumbered" class in DocBook role attribute (#8481)
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

Closes #1402
2023-01-12 19:29:53 -08:00