Commit graph

1900 commits

Author SHA1 Message Date
John MacFarlane
c3cf339f1d RST writer: support all standard metadata ("bibliographic") fields. 2022-03-01 13:20:31 -08:00
John MacFarlane
b94ad5b2ed DocBook reader: improve info parsing.
Simplify metadata parsing code.
Handle abstract as block-level content.
Report skipped info elements with `--verbose`.

See #7747.
2022-02-28 10:19:04 -08:00
John MacFarlane
97c4f3f237 LaTeX reader: rudimentary support for vbox.
Closes #7939.
2022-02-27 23:24:30 -08:00
John MacFarlane
7f6021d7b2 Markdown writer: don't produce redundant header identifier...
when the `gfm_auto_identifiers` extension is set.

Closes #7941.
2022-02-26 11:37:46 -08:00
John MacFarlane
8ceea05c75 Markdown reader: remove restriction on identifiers...
so they no longer need to begin with a letter. Closes #7920.
2022-02-23 10:04:15 -08:00
Albert Krewinkel
d6916e2a40
Tests: improve location reporting of failing tests 2022-02-23 09:20:06 +01:00
Dimitris Apostolou
2f521081ad
Fix typos (#7934) 2022-02-22 09:05:39 -08:00
Lucas V. R
3bc3e96837 Org reader: More flexible LaTeX environments
Looking at the definition of `org-element-latex-environment-parser`, one
sees that Org allows arbitrary arguments to LaTeX environments. In fact,
it parses every char just after `\begin{xxx}` until `\end{xxx}` as
content for the environment, so all the following examples are valid
environments:

```org
\begin{equation} e = mc^2 \end{equations}
```
```org
\begin{tikzcd}[ampersand replacement=\&]
	A \& B \\
	C \& D
	\arrow[from=1-1, to=1-2]
	\arrow["f", from=2-1, to=2-2]
\end{tikzcd}
```
2022-02-21 16:04:14 +01:00
John MacFarlane
6fe8014a2c LaTeX reader: Handle \label and \ref for footnotes.
Closes #7930.
2022-02-19 11:55:46 -08: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
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
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
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
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
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
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
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
d40d94ebd9 EndNote reader: add nocite as the other bib format readers do. 2022-02-04 23:51:12 -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
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
60caa0a1e1 Docx reader: add bibliographic entries for zotero ADDIN.
Bibliographic data embedded in citation items is added
to the `references` metadata field.

Closes #7840.
2022-02-03 22:08:46 -08:00
John MacFarlane
f854e31bc8 Add zoreto test with +citations.
So far, though, we still don't include the references in
the metadata.
2022-02-03 21:29:04 -08:00
John MacFarlane
9625e17e86 Add zotero citation test with docx-citations. 2022-02-03 21:06:48 -08:00
Albert Krewinkel
46e5937628
Custom writer: default to single quotes for strings
Makes the code more consistent and makes it easier to use double quotes
in strings, which is the usual quoting style used for HTML attributes.

Closes: #7487
2022-01-31 11:33:31 +01:00
John MacFarlane
c348c4d4fe Use [x] not [X] for asciidoctor checklists.
See #7798.
2022-01-29 17:47:35 -08:00
Albert Krewinkel
a6fa3df114
HTML writer: avoid duplicate "style" attributes on table cells
Fixes: #7871
2022-01-28 18:20:14 +01:00
Even Brenden
d36a16a4df Don't read files outside of user data directory
If a file path does not exist relative to the working directory, but
it does exist relative to the user data directory, and it exists outside
of the user data directory, do not read it. This applies to readDataFile
and readMetadataFile in PandocMonad and, by extension, any module that
uses these by passing them relative paths.
2022-01-28 08:51:27 -08:00
John MacFarlane
a9f901cf6b CommonMark reader: fix source position after YAML metadata.
Closes #7863.
2022-01-23 22:13:58 -08:00
John MacFarlane
24fa3ffddb Fix compiler warnings. 2022-01-21 17:28:02 -08:00
John MacFarlane
9e0d146837 Update command tests to distinguish stderr and test exit status. 2022-01-21 15:01:50 -08:00
Even Brenden
7df29e495f
Search for metadata files in $DATADIR/metadata (#7851)
If files specified with `--metadata-file` are not found in the working
directory, look in `$DATADIR/metadata`.

Expose new `readMetadataFile` function from Text.Pandoc.Class
[API change].

Expose new `PandocCouldNotFindMetadataFileError` constructor for
`PandocError` from Text.Pandoc.Error [API change].

Closes #5876.
2022-01-21 12:00:45 -08:00
John MacFarlane
52b78b10c8 Avoid putting a frame around speaker notes in beamer.
If speaker notes (a Div with class 'notes') occur right
after a section heading, but above slide level, the
resulting `\note{..}` caommand should not be wrapped in
a frame, as that will cause a spurious blank slide.

Closes #7857.
2022-01-20 19:09:44 -08:00
John MacFarlane
ef8135b4a7 HTML writer: don't break lines inside code elements.
With the new (default) line wrapping of HTML, in
conjunction with the default CSS which includes
`code { whitespace: pre-wrap; }`, spurious line
breaks could be introduced into inline code.

Closes #7858.
2022-01-20 09:17:34 -08:00
John MacFarlane
6723891c72 Markdown writer: handle explicit column widths with pipe tables.
If a table has explicit column width information *and* the
content extends beyond the `--columns` width, we need to
adjust the widths of the pipe separators to encode this width
information.

Closes #7847.
2022-01-19 09:36:48 -08:00
Albert Krewinkel
b794b534a5
Remove unused file test/command/jats.csl 2022-01-19 10:12:32 +01:00
Michael Hoffmann
e146b1ff3b
Docx writer: Separate tables even with RawBlocks between (#7844)
Adjacent docx tables need to be separated by an empty paragraph. If
there's a RawBlock between tables which renders to nothing, be sure to
still insert the empty paragraph so that they will not collapse
together.

Fixes #7724
2022-01-18 14:28:28 -08:00
Nikolai Korobeinikov
b683b8d48a
Support checklists in asciidoctor writer (#7832)
The checklist syntax (similar to `task_list` in markdown) seems to be
an asciidoctor-only addition.

Co-authored-by: ricnorr <ricnorr@yandex-tream.ru>
2022-01-16 11:05:19 -08:00
Mauro Bieg
9e60142cc9
CSS in HTML template: adjust #TOC and h1 on mobile (#7835) 2022-01-16 09:22:43 -08:00
John MacFarlane
c6cf78a033 Improve on fix to #7506.
Don't boldface code in output formats that can represent
it as monospace.

Define aliases for VI, VB, VBI as well.
2022-01-15 12:57:26 -08:00
John MacFarlane
c40727bfbb Man writer: use custom font V for inline code.
The V font is defined conditionally, so that it renders
like CB in output formats that support that, and like B
in those that don't (e.g. the terminal).

We could just redefine C, but this would affect code
blocks, too, and putting them all in boldface looks ugly,
I think.

Possible drawback: fragments created by pandoc's man
writer will presuppose a nonstandard V font.

Closes #7506.
Supersedes 253467a549.
2022-01-15 12:39:19 -08:00
John MacFarlane
253467a549 Man writer: Use boldface for inline code.
Closes #7506.

This also allows us to get rid of some special casing
on definition lists that ensured that options in code
spans would be boldface.  (If this change is ever reverted,
we'll need that again.)
2022-01-15 12:07:18 -08:00
John MacFarlane
e532bceb8a Add test for #7826 notes-after-punctuation. 2022-01-13 08:41:05 -08:00
Michael Hoffmann
5001fd3f4d
Docx writer: Handle bullets correctly in lists by not reusing numIds (#7822)
Make sure that we only create one bullet per list item in docx.  In
particular, when a div is a list item, its contained paragraphs will
now no longer wrongly get individual bullets.

This is accomplished by making sure that for each list, we only use
the associated numId once.  Any repeated use would add incorrect
bullets to the document.

Closes #7689
2022-01-11 15:48:41 -08:00
John MacFarlane
7bf1191686 HTML writer: don't break attributes values when wrapping. 2022-01-10 10:40:49 -08:00
John MacFarlane
6f739cdb4d Fix regression: allow blank lines in HTML attributes.
The commit 7a9832166e
had the effect that blank lines would be collapsed
in HTML attributes.

We also roll back a change that collapsed multiple
spaces into one.
2022-01-10 10:29:25 -08:00
Lucas Viana
fb91a91615 Org reader: support alphabetical (fancy) lists
This adds support for alphabetical lists in org by enabling the
extension Ext_fancy_lists, mimicking the behaviour of Org Mode when
org-list-allow-alphabetical is enabled.

Enabling Ext_fancy_lists will also make Pandoc differentiate between the
delimiters of ordered lists (periods or closing parentheses). Org does
this differentiation by default when exporting to some formats (e.g.
plain text) but does not in others (e.g. html and latex), so I decided
to copy Pandoc's markdown reader behaviour.
2022-01-09 09:39:27 -08:00