Commit Graph
8199 Commits
Author SHA1 Message Date
John MacFarlane f53ab3ca8c LaTeX reader: Add unnumbered class for \part*.
Closes  #8447.
2022-11-25 08:59:33 -07:00
Albert Krewinkel 2dec0ff52d Docx writer: support relative image widths.
Image widths given in percent are interpreted to be relative to the text
width. This is similar to the way percent widths are handled in other
writers, e.g. HTML and LaTeX. Previously, percent widths were taken
relative to the image's native size.
2022-11-21 16:32:41 +01:00
John MacFarlane 4b4771f062 Docx reader: Support parsing of highlighted text. 2022-11-19 13:28:10 -08:00
John MacFarlane bb0fd13bcb RST reader: support mark role for round-trip. 2022-11-19 12:44:25 -08:00
John MacFarlane 127ded4fae LaTeX reader: support more soul commands, including \hl. 2022-11-19 12:44:07 -08:00
John MacFarlane 75435381ac Add support for mark extension for highlighted text.
+ Extensions: Add `Ext_mark` extension.
  This is not part of the pandoc extensions by default.
+ Markdown reader: parse `==..==` if `mark` extension enabled.
+ Markdown writer: support `mark` extension.
+ Docx writer: render Span with class `mark` as highlighted.
  Currently yellow is hardcoded.
+ LaTeX writer: support highlighted text for Span with class `mark`.
+ RST writer: use special `mark` role for Span with class `mark`.
+ Update MANUAL.txt.

Closes #7743.
2022-11-19 12:30:12 -08:00
John MacFarlane 144bf90ab9 LaTeX writer: Use soul instead of ulem for strikeout, underline.
This handles things like hyphenation, line breaks, and nonbreaking
spaces better.

Closes #8411.
2022-11-19 12:28:41 -08:00
John MacFarlane afe096d9e3 Markdown writer: escape ! before [.
See #8254.
2022-11-11 10:58:07 -08:00
Wout Gevaert 323be80838 Use 'literal tag' instead of 'text (T.unpack tag)' in tagWithAttrs 2022-11-11 10:12:07 -08:00
Wout Gevaert 0b003de6f1 Change the Mediawiki writer to use the 'new' table structure
Now MediaWiki tables can use colspan and rowspan :D
2022-11-11 10:12:07 -08:00
Wout Gevaert c5dbedcd4e [API change] Add functions htmlAddStyle, htmlAlignmentToString and htmlAttrs to Writers/Shared.hs
The functions htmlAddStyle and htmlAlignmentToString are moved from Writers/HTML.hs, where they were called 'addStyle' and 'alignmentToString' respectively.
The function htmlAttrs is split off from tagWithAttrs in Writers/Shared.hs. It creates a representation of an Attr object, as one would see in a tagWithAttrs (but without the tag)
2022-11-11 10:12:07 -08:00
John MacFarlane 314c2d1d32 Better error when parsing EndNote references fails.
(Tell them that it concerns EndNote references.)
2022-11-10 10:14:59 -08:00
John MacFarlane cb5e3ded12 In --verbose mode add message when running citeproc.
(As with other filters.)
2022-11-09 12:34:56 -08:00
John MacFarlane 1989573074 Ms writer: remove -C option on PSPIC.
Some old versions don't support this option, and since it's
the default it shouldn't be necessary.
2022-11-08 15:20:08 -08:00
John MacFarlane 452fe5aa17 EPUB writer: refactor to use T.P.Chunks. 2022-11-06 21:31:40 -08:00
John MacFarlane 04973586eb Move SecInfo, toTOCTree to T.P.Chunks.
Also add `secPath` to `SecInfo`.
2022-11-06 21:31:40 -08:00
John MacFarlane 9e2df2a718 Add Text.Pandoc.Chunks.
This module provides functions to split Pandoc documents into
chunks to be rendered in separate files, e.g. one per section.

Internal identifiers are rewritten appropriately to point to
the new locations.

See #6122.
2022-11-06 21:31:34 -08:00
John MacFarlane 036aac3851 Fix warnings. 2022-11-06 12:47:01 -08:00
John MacFarlane 2682c79e95 EPUB writer: refactor createChaptersAndRefTable. 2022-11-06 09:54:25 -08:00
John MacFarlane f9ce4ff4d0 T.P.Writers.Shared: refactor toTableOfContents.
We now export `toTOCTree` and `SecInfo`, which provide a more neutral
way of generating TOC information from Blocks, and we use these in
`toTableOfContents`.

This is desirable because some output formats may require a TOC
structure that isn't just a rendered pandoc list.
2022-11-06 09:50:14 -08:00
John MacFarlane 848f6b51b2 Text.Pandoc.App: Change parseOptionsFromArgs and parseOptions... (#8406)
They now return `Either OptInfo Opt`.

Add `OptInfo` type.

Add `handleOptInfo` function.  This performs the IO actions for
things like `--version` that were previously done in `parseOptionsFromArgs`.
An argument for a `ScriptingEngine` has been added, to facilitate
printing custom templates and custom extensions for Lua filters.
(However, at this stage nothing is yet done with it.)

[API change]
2022-11-02 19:07:22 -07:00
John MacFarlane 8718fab964 EPUB writer: add includeTitlePage param to createNavEntry.
So far this isn't used, but it contributes to solving #6097.
2022-11-02 10:20:41 -07:00
John MacFarlane df8e8230c5 EPUB writer: Simplify params for createNavEntry. 2022-11-02 10:16:19 -07:00
John MacFarlane 61d93d2450 ODT reader: handle "section" elements.
Previously these were simply skipped! Closes #8409.
2022-11-02 09:56:22 -07:00
John MacFarlane b3f4a66ec8 ipynb reader: add cell id to attachment filename...
...when storing in the MediaBag. Otherwise attachments with the same name
can overwrite each other.  Closes #8415.
2022-11-02 09:23:09 -07:00
John MacFarlane 0c641c1025 Fix import. 2022-10-31 22:15:09 -07:00
John MacFarlane 9620ce3ea0 Add explicit imports to fix compiler warnings. 2022-10-31 21:20:52 -07:00
John MacFarlane df36019768 First stab at mtl 2.3 compliance.
This will no doubt produce a bunch of warnings and hence CI
failures, which we'll need to work around with explicit imports.
2022-10-31 16:51:51 -07:00
John MacFarlane c7af10fe89 hlint suggestions. 2022-10-30 12:37:19 -07:00
John MacFarlane 8b3be07ae8 hlint suggestions. 2022-10-30 11:02:00 -07:00
John MacFarlane cd6945fb4b Fix an import warning. 2022-10-29 14:34:09 -07:00
John MacFarlane bfdf170330 Use T.P.XML lookupEntity in Jira reader. 2022-10-29 13:15:04 -07:00
John MacFarlane 139f9c064d Re-export lookupEntity from Text.Pandoc.XML [API change]. 2022-10-29 12:01:45 -07:00
John MacFarlane 86a8a8e107 T.P.XML: use lookupEntity from commonmark-hs. 2022-10-29 11:46:08 -07:00
John MacFarlane 512cf5a908 T.P.Parsing.General: change characterReference, charsInBalanced.
`characterReference` now returns a Text (as it should, because some
named references don't correspond to a single Char), and uses
the `lookupEntity` function from commonmark-hs instead of the slow
one from tagsoup.

`charsInBalanced` now takes a Text parser rather than a Char parser
as argument.

[API change]
2022-10-29 11:46:03 -07:00
John MacFarlane e9b3636bc1 Don't fail on inline metadata beginning with newline.
Closes #8358.
2022-10-27 22:04:46 -07:00
John MacFarlane 91436ebbf4 T.P.Writers.Shared toTableOfContents: handle nested Divs better.
Closes #8402.
2022-10-27 12:46:59 -07:00
John MacFarlane 87f4247d9e T.P.PDF: fix papersize on PDF generation via ms.
We need to set an option in pdfroff in addition to including
a macro in the ms file.

With this fix, `-Vpapersize=a4` should be sufficient to
produce A4 PDF via ms.

Closes #8403.
2022-10-27 10:01:26 -07:00
John MacFarlane 246e14e75a LaTeX reader: fix TEXINPUTS handling.
If TEXINPUTS ends with `:`, then the system default TEXINPUTS
is added.  We handle this by just adding the working directory
in this case.

Closes #8392.
2022-10-26 18:51:50 -07:00
John MacFarlane b8047e350c ICML writer: use Contents element for images with raw data...
instead of a link with a data: uri.

Closes #8398.
2022-10-26 09:05:09 -07:00
John MacFarlane f282f0bd37 Remove type alias WriterProperties.
I don't think this aids clarity, and anyway it's not exported.
2022-10-25 10:28:25 -07:00
John MacFarlane 368f3fd71f Rename T.P.Readers.Odt -> T.P.Readers.ODT.
For consistency with Writers.ODT.

Similarly, rename `readOdt` -> `readODT`.

[API change]
2022-10-24 22:58:03 -07:00
John MacFarlane e6866c1543 Rename T.P.Writers.Docbook -> T.P.Writers.DocBook.
Similarly, rename `writeDocbook` -> `writeDocBook`, for
consistency with the DocBook reader's naming.

[API change]
2022-10-24 22:49:25 -07:00
John MacFarlane 4696af3125 ODT reader: fix relative links.
ODT adds a `../` to relative links (see #3524); this needs to be
removed when converting from ODT.
2022-10-24 20:25:09 -07:00
John MacFarlane 8b0519bd3e ODT writer: further refinement to #3524.
Don't alter the link if the path is empty.
2022-10-24 20:24:27 -07:00
John MacFarlane c73ebb8a03 ODT writer:
Revise commit 9496ce818b
so it doesn't change image links. (These should have already been
adjusted.)

See #3524.
2022-10-24 14:35:17 -07:00
John MacFarlane 9496ce818b ODT writer: fix relative links.
Closes #3524.
2022-10-24 10:44:18 -07:00
John MacFarlane 400d4e1387 LaTeX reader: parse short table caption.
See jgm/pandoc-types#103.

This is not too useful yet, because writers don't do anything with
the short caption.
2022-10-21 11:44:12 -07:00
John MacFarlane 23921b2ef1 Text.Pandoc.Parsing: remove nested [API change].
It was not being used, and in fact it was a bad idea from
the beginning, as it had no hope of solving the problem
it was introduced to solve.
2022-10-20 21:05:58 -07:00
John MacFarlane d95befac55 Add custom extensions.
T.P.Extensions [API change]:

+ Add CustomExtension constructor to Extension.
+ Remove Bounded, Enum instances for Extension.
+ Add `extensionsToList` function.
+ Revise `readExtension` so it can handle CustomExtension, and so
  that it returns a Text rather than Maybe Text.
+ Add `showExtension`.

T.P.Format:

+ Revise error checking to handle CustomExtension.
2022-10-20 10:15:30 -07:00