Commit graph

15282 commits

Author SHA1 Message Date
John MacFarlane
5b84c0f09d Change --metadata-file parsing...
...so that, when the input format is not markdown or a markdown
variant, pandoc's markdown is used.  When the input format is
a markdown variant, the same format is used.  Reason for the change:
it doesn't make sense to run the markdown parser with a set of
extensions designed for a non-markdown format, and this dramatically
limits what people can do in metadata files.

Refines #6832.  Closes #7926.

Perhaps this can be reconsidered if we come up with a way
of specifying an arbitrary format for the metadata file (#5914).
2022-02-18 09:35:38 -08:00
Albert Krewinkel
910296b745
Lua: Use pandoc-lua-marshal 0.1.5.
-   Allow any type of callable object as argument to List
    functions `filter`, `map`, and `find_if`. These previously
    required the argument to be of type `function`, which was too
    restrictive.

-   Inline: the type of Image captions is now `Inlines` instead
    of `List`.
2022-02-17 16:00:20 +01:00
John MacFarlane
dc534caf7a Add tests for #7919.
Together with the update in commonmark-hs and previous changes,
this closes #7919.
2022-02-13 17:43:30 -08:00
John MacFarlane
139bcb9614 Use latest dev commonmark-extensions. 2022-02-13 13:33:54 -08:00
John MacFarlane
85136b064f Markdown reader: allow one-column pipe tables with pipe on right.
See #7919.

We still need to implement this for gfm (commonmark).
This must be done via changes in commonmark-hs.
2022-02-13 13:06:49 -08:00
John MacFarlane
495ae605e3 Use latest dev commonmark, commonmark-extensions. 2022-02-13 12:47:51 -08:00
John MacFarlane
f3b0f19d7a Ensure that you don't get PDF output to terminal.
`-t pdf` should behave like `-t docx` and give an error
unless the output is redirected.
2022-02-13 00:26:54 -08:00
Albert Krewinkel
e1b7f3a63d
JATS reader: improve handling of fn-group elements (#7914)
Footnotes in `<fn-group>` elements are collected and re-inserted into
the document as proper footnotes in the place where they are referenced.

Fixes: #6348
2022-02-12 17:39:02 -08:00
John MacFarlane
4b1cddd292 Depend on latest commonmark.
This resolves an issue with commonmark_x's support of
strikeout.
2022-02-12 15:31:06 -08:00
John MacFarlane
3fa827ecf2 Document way to get list in block quote in slide shows.
This works around the convention that a list in a block
quote is incremental.

Closes #7916.
2022-02-12 13:55:24 -08:00
damon-sava-stanley
01ec1ac43a
Put id attributes on TOC entries #7907 (#7913)
Naming scheme of id is "toc-" + id of linked to header/section.
In Shared, will effect HTML, Markdown, Powerpoint, and RTF.
2022-02-11 21:37:00 -08:00
John MacFarlane
899feec4d3 RST reader: fix treatment of headerless simple tables.
We were producing a header with blank cells rather than no
header.  Closes #7902.
2022-02-11 09:42:24 -08:00
John MacFarlane
e8c1c6adb1 Clean up import list. 2022-02-11 09:29:55 -08:00
damon-sava-stanley
d3716eaeb6
Add DokuWiki table alignment for #5202 (#7908)
Closes #5202.

Within each cell, determine the cell alignment as per
https://www.dokuwiki.org/wiki:syntax#tables. The current approach, as
per the issue treats the first row's alignment as determining
that of the entire column. Given this, it wastes some work in
determining an alignment for every cell.
2022-02-11 08:58:29 -08:00
John MacFarlane
61996682ff --self-contained: issue warning rather than failing...
with an error, if a resource can't be found.
Closes #7904.
2022-02-10 21:39:15 -08:00
John MacFarlane
97d83e383a LaTeX reader: support \today.
Closes #7905.
2022-02-10 19:17:20 -08:00
John MacFarlane
03c6025379 Add command test for #7884. 2022-02-09 12:31:18 -08:00
John MacFarlane
7a888e8603 Fix parsing of epub footnotes.
Closes #7884.
2022-02-09 11:47:34 -08:00
Albert Krewinkel
7dc59aa26a
PDF: allow custom writer as format if engine is explicitly specified (#7901)
Closes #7898.
Note that it may be necessary to explicitly specify a template on the command line.
2022-02-09 10:16:41 -08:00
mjfs
63deba49d4
Docx: single numbering ID for examples - fixes #7895 (#7900)
This change ensures that example list items all belong to a single
number sequence, so that if items are added or deleted in a word
processor, the other items will renumber automatically.
2022-02-09 10:15:01 -08:00
John MacFarlane
93b1dbfdac HTML reader: give warnings and emit empty note...
when parsing `<a epub:type="noteref">` and the identifier
doesn't correspond to anything in the note table.

Previously we just silently skipped these cases.

See #7884.
2022-02-07 09:22:05 -08:00
Albert Krewinkel
4864761ad8
Custom writer: produce stacktrace if Writer function fails 2022-02-07 09:45:32 +01:00
Albert Krewinkel
7d3db1dd2d
Lua docs: fix typos, missing links 2022-02-07 09:30:12 +01:00
John MacFarlane
2b3433404e Remove sample RIS custom reader (since we now have a native one). 2022-02-06 19:13:34 -08:00
Albert Krewinkel
0f0b042139 Custom writer: support new-style Writer function. 2022-02-06 16:37:39 -08:00
Albert Krewinkel
f738c451d7 Lua: move custom writer code into Lua hierarchy. 2022-02-06 16:37:39 -08:00
Albert Krewinkel
49f1e7608e Lua: add module pandoc.layout to format and layout text 2022-02-06 16:01:24 -08:00
Lucas V. R
ae846381c3 Org reader: allow comments above property drawer
The Org Manual page at https://orgmode.org/manual/Property-Syntax.html
says (as of 2022-02-03):

"Property blocks defined before first headline needs to be located at
the top of the buffer, allowing only comments above."

This commit allows comments above.
2022-02-06 23:08:27 +01:00
Lucas V. R
61f4771c55 Org reader: allow ":" in property drawer keys
Any non-space character is allowed as property drawer key, including ":"
itself (so it is not really a delimiter). The real delimiter is a space
character, so in a drawer like

:PROPERTIES:
::k:ey:: value
:END:

":k:ey:" is a key with value "value".

This usage can be seen in the Org Manual at
https://orgmode.org/manual/Using-Header-Arguments.html,
where the Org snippet

* Heading
  :PROPERTIES:
  :header-args:clojure:    :session *clojure-1*
  :header-args:R:          :session *R*
  :END:

is listed as an example.
2022-02-06 23:08:27 +01:00
Jan Tojnar
876859f9e9
Docbook writer: Interpret links without contents as cross-references (#7360)
Links without text contents are converted to `<xref>` elements. DocBook
processors will generate appropriate cross-reference text when presented
with an xref element.
2022-02-06 23:05:20 +01:00
Albert Krewinkel
faf99ad356
docs/lua-filters.md: revert changes made in 3169367475
Partially reverts 3169367475. The result is
unpleasant, auto-generating module docs requires a different approach.
2022-02-06 09:43:58 +01:00
John MacFarlane
677f2ca26e Allow use of a RIS bibliography with citeproc. 2022-02-05 23:48:55 -08:00
John MacFarlane
6cc253aab6 RIS reader: support ID and DO fields. 2022-02-05 23:34:44 -08:00
John MacFarlane
3da5440858 Add RIS bibliography format reader.
New module, Text.Pandoc.Readers.RIS, exporting readRIS.

New input format `ris`.

Closes #7894.
2022-02-05 23:25:03 -08:00
John MacFarlane
2fca57522b MANUAL: document EndNote plugin support in docx+citations. 2022-02-05 08:26:42 -08:00
Albert Krewinkel
c962cef309
Lua: set module name before pushing
Using the correct module name is relevant when auto-generating
documentation.
2022-02-05 13:32:02 +01:00
Albert Krewinkel
3169367475
Lua docs: allow to auto-generate Lua module documentations
No documentations are generated for now, this just adds the necessary
code and auto-formats file `doc/lua-filters.md`.
2022-02-05 13:32:02 +01:00
John MacFarlane
d40d94ebd9 EndNote reader: add nocite as the other bib format readers do. 2022-02-04 23:51:12 -08:00
John MacFarlane
f813aca3ea Add endnotexml test to pandoc.cabal extra-source-files. 2022-02-04 23:39:39 -08:00
John MacFarlane
b7f1c97b6a Docx zotero/mendeley/endnote: add comma before locator in suffix. 2022-02-04 23:28:46 -08:00
John MacFarlane
f48890eff0 Support Prefix, Suffix, Pages in endnote ADDINs. 2022-02-04 22:20:51 -08:00
John MacFarlane
19cfe6a907 Got endnote citations working in docx...
Still to do:  prefix, suffix, locator.
2022-02-04 21:54:50 -08:00
John MacFarlane
28349447cb Docx reader: skeleton for endnote citation ADDINs. 2022-02-04 17:02:43 -08:00
John MacFarlane
15316a0058 EndNote: export readEndNoteXMLCitation...
instead of readEndNoteXMLReferences.  This is the function
we'll need in the docx reader.

We still need to implement locator, prefix, and suffix.
2022-02-04 14:02:58 -08:00
John MacFarlane
75c6389e9d Add endnotexml reader test. 2022-02-04 10:36:58 -08:00
John MacFarlane
697aea3717 Add mendeley citation tests. 2022-02-04 10:14:21 -08:00
John MacFarlane
d164e5bb1d Docx reader: parse EN.CITE and EN.REFLIST fields. 2022-02-04 10:04:16 -08:00
John MacFarlane
34897031f4 Add endnote XML reader.
New input format: endnotexml

New reader module: Text.Pandoc.Readers.EndNote, exporting
`readEndNoteXML` and `readEndNoteXMLReferences`. [API change]

This reader is still a bit rudimentary, but it should get
be good enough to be helpful.
2022-02-04 10:03:52 -08:00
John MacFarlane
e07c0e74ce Support embedded Mendeley citations in docx.
These are supported in the same way as Zotero citations,
using the same code.  As with Zotero, enable the `citations`
extension on `docx` to parse these as native citations.

Closes #7840.
2022-02-04 10:00:23 -08:00
John MacFarlane
d40236805d MediaBag: improve detection of absolute paths.
Previously we used System.FilePath's isRelative to
determine when paths are relative (since absolute
paths need to get a new name based on the sha1 hash).
But this has an OS-specific behavior and actually
returns True on Windows for paths like `/media/file.png`.
This ought to fix #7881.
2022-02-04 09:47:07 -08:00