Commit Graph
17054 Commits
Author SHA1 Message Date
John MacFarlane d8b5541d61 Typst reader: allow @refs to become citations...
if there is no corresponding label in the document.
2023-12-09 22:51:35 -08:00
John MacFarlane cafca39ec7 Typst reader: collapse adjacent cite elements. 2023-12-09 15:50:01 -08:00
John MacFarlane cf0a050434 Typst reader: fix temporary regression in cite. 2023-12-09 15:28:54 -08:00
John MacFarlane d5e7c0ed1d Typst writer: handle supplements in cite. 2023-12-09 14:56:04 -08:00
John MacFarlane 3d482c2539 Update RELEASE-CHECKLIST. 2023-12-09 10:59:48 -08:00
John MacFarlane 35d44bb666 Link pandoc-cli version to pandoc version.
Henceforth pandoc-cli's version will be synchronized with pandoc's, and
pandoc-cli will depend on an exact pandoc version.

This will avoid confusion by ensuring that `cabal install pandoc-cli-X.Y.Z`
installs pandoc version X.Y.Z.  It will make things more straightforward
for upstream packagers (see #9232).

Note also that the man pages included in this package are for a specific
pandoc version.

This scheme does not follow the Haskell PVP, but that should cause no
harm, because this package does not expose a library.
2023-12-09 10:56:35 -08:00
John MacFarlane c2c45f1c6a Remove tested-with from pandoc-cli.cabal. 2023-12-09 10:20:34 -08:00
John MacFarlane c132122128 cabal - update tested-with. 2023-12-09 10:16:42 -08:00
John MacFarlane fdc0e86802 Add note to cabal description about how to install the cli tool. 2023-12-09 10:04:33 -08:00
John MacFarlane 55227a2027 Move man pages to pandoc-cli package.
Closes #9245.
2023-12-09 09:55:13 -08:00
John MacFarlane eb3a1b11d1 Typst reader: change cite (only one key allowed, a label).
This is a typst 0.9 breaking change.
2023-12-08 22:07:12 -08:00
John MacFarlane d57f3d576e Typst reader: support quote element. (typst 0.9) 2023-12-08 21:54:39 -08:00
John MacFarlane fb4cea44b9 Docx writer: Use different style for block quotes in notes.
Using "Footnote Block Text" for the style name, so it can be
given a different font size if footnotes are.

Closes #9243.
2023-12-08 13:34:33 -08:00
John MacFarlane 901359bf46 Docx writer: allow embedded fonts to be used in reference.docx.
Closes #6728.
2023-12-08 13:16:59 -08:00
John MacFarlane e46c3e68d2 Update typst-hs commit and typst writer test. 2023-12-08 13:10:33 -08:00
John MacFarlane 09d0208da3 Bump typst-symbols in stack.yaml. 2023-12-08 10:06:26 -08:00
John MacFarlane 5cea532790 Use dev texmath. 2023-12-08 10:04:54 -08:00
John MacFarlane 5bd301ef45 Typst writer/template: support --toc-depth as in other writers.
Closes #9242.
2023-12-07 14:39:21 -08:00
John MacFarlane e7348b4f76 pandoc-server: Switch from base64 to base64-bytestring.
See #9233.
2023-12-06 09:11:28 -08:00
John MacFarlane 8b523749ae Revert "Use base64 instead of base64-bytestring."
This reverts commit 6625e9655e.

base64 is currently buggy on 32-bit systems. Closes #9233.
2023-12-06 08:05:53 -08:00
John MacFarlane dbbd70d4f8 Add tests for alerts gfm <-> docbook. 2023-12-05 16:52:49 -08:00
John MacFarlane fe351f1fd5 Fine-tuning on alerts.
Added a test to show that we can convert smoothly between
gfm, rst, and asciidoc alerts.
2023-12-05 09:38:47 -08:00
John MacFarlane 64bc8ab9c2 Revise commonmark-hs dependency again. 2023-12-05 09:09:40 -08:00
John MacFarlane 511366f8e5 Update tag for commonmark-hs. 2023-12-05 09:03:25 -08:00
John MacFarlane 6b1d6f0e7e Update commonmark-hs tag. 2023-12-05 08:55:21 -08:00
John MacFarlane fe03d4d133 Add alerts extension.
This enables GitHub style markdown alerts as a commonmark extension.

<https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts>

This extension is now default for `gfm`.
It can't be used with `markdown`, only with `commonmark` and variants.
2023-12-04 22:13:04 -08:00
John MacFarlane ff56d43b50 Use dev commonmark-extensions, commonmark-pandoc. 2023-12-04 19:52:43 -08:00
John MacFarlane 970189bc1d Use skylighting, skylighting-core 0.14.1. 2023-12-04 09:25:11 -08:00
John MacFarlane 41da8ad9e0 HTML5 writer footnote changes (aria-role, element type).
* To conform to validator's expectations, `doc-footnote` role is used
  with `aside` and `doc-endnotes` with `section`.
* `aside` is used only for notes at ends of sections or blocks;
  if all the notes come at the end of the document, `section` is
  used so we can have the `doc-endnotes` role.
2023-12-04 09:22:58 -08:00
John MacFarlane dbdb4d9c1f Typst writer: put inline image dimensions on enclosing box, not image.
Closes #9104.
2023-12-04 08:42:12 -08:00
John MacFarlane f8ba1280c6 Revert "Use latest dev skylighting, skylighting-core."
This reverts commit 780f4f569c.
2023-12-04 08:06:52 -08:00
John MacFarlane 780f4f569c Use latest dev skylighting, skylighting-core. 2023-12-04 07:59:13 -08:00
dependabot[bot] 251bfa8e94 Bump cachix/install-nix-action from 23 to 24 (#9234)
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 23 to 24.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v23...v24)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-03 20:42:21 -08:00
John MacFarlane 80ea048bb2 LaTeX reader: handle otherlanguage environment...
...and language-name environments like
`\begin{french}...\end{french}`.
Closes #9202.
2023-11-29 21:22:03 -08:00
Stephan Meijer 2e8ecb3fba Docx reader: unwrap content of shaped textboxes...
* #9214 text in shape format test document

* #9214 support Text in Shape Format

* #9214 remove irrelevant code
2023-11-29 18:59:09 -08:00
John MacFarlane eff1790bbc Use latest dev typst-hs. 2023-11-29 14:28:02 -08:00
John MacFarlane 9901aa2a40 Docx reader: Improve handling of w:sym.
Add T.P.Readers.Docx.Symbols. This gives us a table to use to
resolve characters included in docx via w:sym element.

Use this table to resolve characters when symbol fonts are specified.

Closes #9220.
2023-11-28 11:50:26 -08:00
John MacFarlane 4259d64d25 Correct comment. 2023-11-28 10:23:56 -08:00
John MacFarlane 6149cec27a Update command test for SVG embedding changes. 2023-11-25 11:39:22 -05:00
John MacFarlane fc3d202e3f SelfContained: improve treatment of embedded SVGs.
- Ensure unique ids for elements by prefixing SVG id.
- Ensure SVG `id` attribute except when `use` element is used.
- Remove `width`, `height` attributes from svg element when `use`
  element is used. Instead, add `width` and `height` 100% to the
  `use` element. This seems to get the sizing right.

Closes #9206.

Ref: #8948.
2023-11-25 11:35:10 -05:00
John MacFarlane f7f2a016d9 Shared.renderTags': use minimized tag for rect. 2023-11-25 10:58:43 -05:00
John MacFarlane 6c4f938192 Shared.renderTags': allow svg path element to be minimized. 2023-11-25 00:03:53 -05:00
John MacFarlane a2a0f73eb8 LaTeX writer: handle identifiers inside heading contents.
`\phantomsection` can't be used in this case, so we need `\hypertarget`.
Closes #9209.
2023-11-22 23:24:55 -05:00
John MacFarlane 49e64c1451 Man reader: properly handle .sp macro inside lists and block quotes.
Closes #9201.
2023-11-19 10:45:05 -08:00
Hikaru Ibayashi a3fba6d83e LaTeX reader: fix theorem label parsing (#9198)
Closes #8872.

In the current implementation , theorem labels in `theoremEnvironment` are
determined by the `LastLabel` in the current state.
This approach works well when the `\label{label_name}` is placed at the end
of the theorem body. However, when a label is placed at the beginning of the
theorem (another common practice) and additional labels follow in the theorem body,
`theoremEnvironment` incorrectly picks the last label (e.g., `\label{item2}` in #8872).

This patch addresses the issue by extracting the label extraction independently of the `LastLabel` state.
2023-11-17 18:49:03 -08:00
John MacFarlane 267b84e1d9 Ensure we use .svg not .svgz as extension for image/svg+xml mime type.
See #9195.
2023-11-17 10:26:09 -08:00
John MacFarlane 1880d75e7c T.P.Class.IO.openURL improvements for data uris.
- Only treat as base64 if ';base64' is present.
- Otherwise treat as UTF-8 (not 100% reliable but should cover most
  other cases).
- Strip off ';base64' (or ';charset=...' or whatever) from mime type.

This last change addresses #9195 (problems with data URIs in
conversion to docx).
2023-11-17 10:13:22 -08:00
John MacFarlane 3591733e19 Typst writer: better handling of tables with captions.
We now put these in a figure with a caption argument.

Closes #9194.
2023-11-15 21:17:06 -08:00
John MacFarlane 13e1b49224 HTML reader: Fix handling of invalidly nested sublists.
This revises the fix to #8150 (and the test case) and closes #9187.

HTML in the (invalid) form:

    <ul>
      <li>L1</li>
      <ul>
        <li>L1.1</li>
      </ul>
    </ul>

is treated by browsers like

    <ul>
      <li>L1
        <ul>
          <li>L1.1</li>
        </ul>
      </li>
    </ul>

not

    <ul>
      <li>L1
      <li><ul>
          <li>L1.1</li>
        </ul>
      </li>
    </ul>

as pandoc previously assumed.

This change will give a similar treatment to

    <ul>
      <li>L1</li>
      <p>foobar</p>
    </ul>

which also seems to match browser behavior.
2023-11-15 14:40:00 -08:00
John MacFarlane cd48bf4059 Markdown reader: don't change newlines to spaces in math.
Preserve them: otherwise we can get unwanted results if there's
a `%` comment. Closes #9193.
2023-11-15 10:06:22 -08:00