Commit Graph
8084 Commits
Author SHA1 Message Date
Albert Krewinkel 084e246126 [API Change] Remove modules T.P.Writers.Custom and T.P.Readers.Custom.
The functions `writeCustom` and `readCustom` are available from module
Text.Pandoc.Lua.
2022-09-30 08:33:40 -07:00
Albert Krewinkel 14bcb4268b [API Change] Add new error constructor PandocNoScriptingEngine.
The exit code for this error is 89.
2022-09-30 08:33:40 -07:00
Albert Krewinkel 704f337697 [API Change] Export new module Text.Pandoc.Scripting
The module contains the central data structure for scripting engines.
2022-09-30 08:33:40 -07:00
Albert Krewinkel ddaadc88bc [API Change] Rename pandocVersion to pandocVersionText...
and add a new `pandocVersion` value with type `Version`. This is
consistent with the type used for `pandocTypesVersion` and allows to use
the value where a Version type is required.
2022-09-30 08:33:40 -07:00
John MacFarlane e099de1d4d Factor out xml-light into an internal library. 2022-09-29 10:53:16 -07:00
John MacFarlane 931ccd0376 Remove deprecated option --strip-empty-paragraphs. 2022-09-29 10:37:46 -07:00
John MacFarlane 6227144216 Remove deprecated --atx-headers option. 2022-09-29 10:29:29 -07:00
John MacFarlane 48d0bfc675 Add --list-tables option.
[API change] Add writerListTables to WriterOptions.

RST writer: Remove sensitivity to "list-table" class in table attributes.
Instead, just check `writerListTables` in writer options.

See #4564.
2022-09-29 10:20:58 -07:00
danse c974ed0cae rST writer: list tables rendering, closes #4564
When a table is marked with a "list-table" attribute class, it will
now be rendered using the list table syntax documented here
http://docutils.sourceforge.net/docs/ref/rst/directives.html#list-table
2022-09-29 09:56:00 -07:00
John MacFarlane 1393037f4e LaTeX writer: use \includesvg for SVGs...
...and include the `svg` package.
Closes #8334.
2022-09-29 09:31:39 -07:00
Justin Wood 740396d1ed HTML Reader: Tests for 'tt' and 'code' elements (#8330).
tt is a deprecated element in HTML, but is still used in the wild in
some places, support reading it as just another 'code' element.

Commit 4abb9d0ad8 was originally
part of this PR as well.
2022-09-28 14:04:07 -07:00
John MacFarlane 4abb9d0ad8 HTML reader: fix regression for <tt>.
It was no longer being parsed as Code.

See #8330.
2022-09-28 13:45:48 -07:00
John MacFarlane bcf06e7f5e HTML writer: prevent <a> inside <a>.
If a link text contains a link, we replace it with a span.
See #7585.
2022-09-28 08:34:50 -07:00
John MacFarlane e12144d5be T.P.Shared: deprecate makeMeta 2022-09-27 21:26:19 -07:00
John MacFarlane 263579167a T.P.Shared: deprecate notElemText 2022-09-27 21:24:06 -07:00
John MacFarlane 1e2e029048 T.P.Citeproc.MetaValue: remove unused function metaValueToPath 2022-09-27 21:21:06 -07:00
John MacFarlane cc2078530c T.P.Readers.LaTeX.Parsing: remove unused function toksToString 2022-09-27 21:19:11 -07:00
John MacFarlane 26f733f424 T.P.Shared: removed deprecated deLink.
[API change]
2022-09-27 21:08:10 -07:00
John MacFarlane eb371b0555 T.P.Shared: Removed deprecated crFilter.
[API change]
2022-09-27 21:07:51 -07:00
John MacFarlane 21bf9ae885 Remove some dead code (unused definitions) from Odt reader. 2022-09-27 17:59:03 -07:00
John MacFarlane a27e10111a Fix small whitespace things. 2022-09-27 13:03:26 -07:00
John MacFarlane e92f1a5ecf Allow url field in bibtext (input and output).
This field is not officially supported, but many styles
can handle it (<https://www.bibtex.com/f/url-field/>),
and others will ignore it.

Closes #8287.
2022-09-27 09:04:36 -07:00
Albert Krewinkel efecff1f2f pandoc-cli: support -E flag in pandoc-lua 2022-09-27 08:42:27 -07:00
John MacFarlane efea562234 LaTeX writer: ignore languages with no babel equivalent...
instead of generating an invalid command in the preamble.
Closes #8325.
2022-09-26 21:37:38 -07:00
John MacFarlane 3aa24ec161 T.P.Citeproc.Locator: update sub verbo to sub-verbo.
This is a change in the term's canonical name in citeproc.
As a result of this change, `sub verbo` locators have not worked
in pandoc since citeproc 0.7.

This patch fixes `sub verbo`.

Closes #8315.
2022-09-25 19:13:43 -07:00
Albert Krewinkel e3648357cf Use hslua-cli package for pandoc-lua interface 2022-09-23 22:26:37 +02:00
John MacFarlane bb8a046464 Org writer: pass through unknown languages in code blocks.
Previously we whitelisted the language for begin_src, and produced
begin_example if the language was not found on the whitelist.

Closes #8278.
2022-09-22 19:56:22 -07:00
Albert Krewinkel 22fa51ded1 Make pandoc behave like a Lua interpreter when called as pandoc-lua. (#8311) 2022-09-22 14:39:25 -07:00
John MacFarlane bd1d923b86 Split pandoc-server, pandoc-cli into separate packages. (#8309)
This also removes the unnecessary Setup.hs from pandoc.
Cabal does not need this with build-type 'simple'.
2022-09-22 09:47:07 -07:00
Albert Krewinkel b38292c234 LaTeX writer: do not repeat caption on headless tables
The caption of headless tables was repeated on each page that contained
part of the table. It is now made part of the "first head", i.e. the
table head that is printed only once.
2022-09-21 12:03:41 +02:00
Albert Krewinkel 47d09df6a5 LaTeX writer: clarify why \endfirsthead is used for tables 2022-09-21 10:51:04 +02:00
John MacFarlane 47a7cdecb9 Export applyFilter from T.P.Lua.Filter.
Motivation: now we need not have any logic referring to hslua
types (LuaE) in T.P.Filter.Lua.  This restricts the parts of Pandoc
that deal directly with hslua to T.P.Lua (and in tests,
Tests.Lua).

[API changes]

T.P.Lua now exports `applyFilter`, `readCustom`, and `writeCustom`.
The lower-level function `runFilterFile` is no longer exported.
2022-09-20 14:11:22 -07:00
John MacFarlane 7c07e57b60 Add T.P.Lua.Reader, T.P.Lua.Writer.
(Unexported modules, presently.)

These contain the definitions of `readCustom` and `writeCustom`
that were previously in T.P.Readers.Custom and T.P.Writers.Custom.

Motivation is to ensure that all of the Lua-related code is under
the T.P.Lua tree.  This will make it easier to make pandoc-lua
a separate package or put lua support under a flag, if we decide to
do that.
2022-09-20 14:11:13 -07:00
John MacFarlane d7a52e2478 Text.Pandoc.App: export IpynbOutput(..).
[API change]
2022-09-20 10:38:53 -07:00
John MacFarlane 3af93d041a Ms writer: properly format display equations.
Previously they were being translated to eqn as inline equations.
Closes #8308.
2022-09-20 10:22:21 -07:00
John MacFarlane f3e9669e84 Commonmark writer: ensure that we don't have blank lines in raw HTML.
Closes #8307.
2022-09-19 12:03:03 -07:00
John MacFarlane cfbf0f096b Org reader: Allow org-ref v2 citations with & prefix.
Closes #8302.
2022-09-19 10:30:44 -07:00
John MacFarlane c0ff59c272 BibTeX parser: fix handling of % in url field.
`%` does not function as a comment character inside `url`
(where URL-encoding is common).

Commit 6fb2973a58 mistakenly
took this reassignment of `%` to be a general feature of
braced (but not quoted) BibTeX fields.

This commit restores the correct behavior of `%` in braced fields
other than `url`, and corrects the behavior of `%` in `url`
when the value is quoted.

Closes #7678 (again).
2022-09-18 19:17:48 -07:00
John MacFarlane 311a340687 Add prefixes to identifiers with --file-scope. (#8282)
This change only affects the case where `--file-scope` is used
and more than one file is specified on the command line.

In this case, identifiers will be prefixed with a string
derived from the file path, to disambiguate them. For example,
an identifier `foo` in `contents/file1.txt` will become
`contents__file1.txt__foo`.  Links will be adjusted accordingly:
if `file2.txt` links to `file1.txt#foo`, then the link will
be changed to point to `#file1.txt__foo`.  Similarly, a link
to `file1.txt` will point to `#file1.txt`.  A Div with an
identifier derived from the file path will be added around
each file's content, so that links to files will still work.

Closes #6384.

[API change]: Text.Pandoc.Shared exports `textToIdentifier`.
2022-09-18 18:11:40 -07:00
John MacFarlane d79f8386d4 Fix implicit_header_references with duplicate headings.
Documentation says that when more than one heading has the same text,
an implicit reference `[Heading text][]` refers to the first one.
Previously pandoc linked to the last one instead. This patch
makes pandoc conform to the documented behavior.

See #8300.
2022-09-14 22:23:45 +02:00
John MacFarlane eb03cad6ae XWiki writer: use template if it is specified.
Previously templates were ignored completely.

Closes #8296.
2022-09-13 11:14:04 +02:00
Albert Krewinkel 369058d53d T.P.MIME: Removes more unnecessary overrides.
| Ext.  | Old type                 | New type                        |
|-------|--------------------------|---------------------------------|
| fm    | application/x-maker      | application/vnd.framemaker      |
| frame | application/x-maker      | application/vnd.framemaker      |
| gsf   | application/x-font       | application/x-font-ghostscript  |
| java  | text/x-java              | text/x-java-source              |
| kpr   | application/x-kpresenter | application/vnd.kde.kpresenter  |
| kpt   | application/x-kpresenter | application/vnd.kde.kpresenter  |
| ksp   | application/x-kspread    | application/vnd.kde.kspread     |
| kwd   | application/x-kword      | application/vnd.kde.kword       |
| kwt   | application/x-kword      | application/vnd.kde.kword       |
| lha   | application/x-lha        | application/x-lzh-compressed    |
| lhz   | application/x-lhz        | application/x-lzh-compressed    |
| maker | application/x-maker      | application/vnd.framemaker      |
| mif   | application/x-mif        | application/vnd.mif             |
| pl    | text/x-perl              | application/x-perl              |
| pm    | text/x-perl              | application/x-perl              |
| sisx  | x-epoc/x-sisx-app        | application/vnd.symbian.install |
| sitx  | application/x-stuffit    | application/x-stuffitx          |
| skd   | application/x-koan       | application/vnd.koan            |
| skm   | application/x-koan       | application/vnd.koan            |
| skp   | application/x-koan       | application/vnd.koan            |
| skt   | application/x-koan       | application/vnd.koan            |
| tgz   | application/x-gtar       | application/x-tgz               |
| tk    | text/x-tcl               | application/x-tcl               |
| wpd   | application/wordperfect  | application/vnd.wordperfect     |
2022-09-12 11:39:45 +02:00
Albert Krewinkel d327f2a85b T.P.MIME: Remove deprecated overrides (#8292)
This changes the media type that's used for the file extension listed
below. The new types are either IANA approved, or so similar to the
override that is does not seem sensible to keep a separate entry.
2022-09-11 20:46:05 +02:00
Albert Krewinkel 62f5701fb1 Require mime-types 0.1.1
This version has an updated list of media types, which renders some
overrides redundant.
2022-09-11 18:05:41 +02:00
John MacFarlane 35a3fb7e83 Citeproc: Require a digit for an implicit "page" locator...
inside explicit locator syntax `{...}`.

Previously a locator specified as `{}` would be rendered
as `p.` with nothing after it.

Closes #8288.
2022-09-09 10:30:01 -07:00
John MacFarlane 47dcb5720e Docx writer: adjust correct attribute on lang element.
For East Asian languages, we need to adjust `w:eastAsia`
rather than `w:val`.  This allows normal fonts to be used
for any Latin-font text. Similarly, for bidi languages, we need
to adjust `w:bidi` rather than `w:val`.

We treat `he` and `ar` as bidi languages, `zh`, `ja`, `ko`
as East Asian languages.

Closes #7022.
2022-09-05 23:10:48 -07:00
John MacFarlane 86a3467ece HTML writer: only treat . . . as a slide pause in slides...
...and not in regular HTML output.
Closes #8281.
2022-09-05 09:51:59 -07:00
Albert Krewinkel b9a7de32f6 T.P.Mime: Base module on package mime-types. (#8277)
The *mime-types* module is a dependency of *http-client* and therefore
already a transitive dependency of pandoc.
2022-09-04 14:30:57 -07:00
John MacFarlane a312faffa8 JATS reader: handle uri element in references.
Closes #8270.
2022-09-01 13:21:27 -07:00
Albert Krewinkel 635b6e3953 Use dev version of gridtables
This allows to specify a table foot by enclosing it with part separator
lines, i.e., row separator lines consisting only of `+` and `=`
characters. E.g.:

    +------+-------+
    | Item | Price |
    +======+=======+
    | Eggs | 5£    |
    +------+-------+
    | Spam | 3£    |
    +======+=======+
    | Sum  | 8£    |
    +======+=======+

The last row, containing "Sum" and "8£", is the table foot.

Closes: #8257
2022-09-01 09:06:42 +02:00