Commit graph

1571 commits

Author SHA1 Message Date
John MacFarlane
fe483c653b Split out T.P.Writers.LaTeX.Citation. 2021-03-02 21:57:37 -08:00
John MacFarlane
827ecdd2de Split out T.P.Writers.LaTeX.Lang. 2021-03-02 21:33:58 -08:00
John MacFarlane
2097411e4f Split up T.P.Writers.Markdown...
with T.P.Writers.Markdown.Types and T.P.Writers.Markdown.Inline.
The module was difficult to compile on low-memory system.s
2021-03-02 21:08:13 -08:00
John MacFarlane
7f1b933aaa Make T.P.Readers.LaTeX.Types an unexported module.
[API change]

This is really an implementation detail that shouldn't be
exposed in the public API.
2021-03-01 09:46:43 -08:00
John MacFarlane
382f0e23d2 Factor out T.P.Readers.LaTeX.Macro. 2021-03-01 09:46:43 -08:00
John MacFarlane
d2bb0c7c8d Factor out T.P.Readers.LaTeX.Math. 2021-02-28 21:05:25 -08:00
John MacFarlane
7e83686d31 trypandoc: add 2 second timeout. 2021-02-28 09:24:37 -08:00
John MacFarlane
2faa57e8e9 Factor out T.P.Readers.LaTeX.Citation. 2021-02-28 09:12:09 -08:00
John MacFarlane
08231f5cdd Factor out T.P.Readers.LaTeX.Table. 2021-02-27 21:40:56 -08:00
John MacFarlane
925815bb33 Split off T.P.Readers.LaTeX.Accent.
To help reduce memory demands compiling the main LaTeX reader.
2021-02-27 17:02:44 -08:00
John MacFarlane
cbc3f034ad Use skylighting 0.10.4.
This version of skylighting uses xml-conduit rather than hxt.
This speeds up parsing of XML syntax definitions fourfold, and
removes four packages from pandoc's dependency graph:

hxt-charproperties
hxt-unicode
hxt-regex-xmlschema
hxt
2021-02-27 14:26:10 -08:00
John MacFarlane
9767386676 Use latest skylighting. 2021-02-22 22:25:10 -08:00
John MacFarlane
d7cfa0ef4c Remove weigh-pandoc.
It's not really useful any more, now that our regular
benchmarks include data on allocation.
2021-02-22 22:10:20 -08:00
John MacFarlane
b2b32d9bb2 'make bench': Create csv files for comparison. 2021-02-18 23:22:18 -08:00
Dmitrii Kovanikov
ef741f3842 Allow base64-bytestring-1.2.* 2021-02-18 18:07:23 +01:00
John MacFarlane
80a1d5c9b6 Revert "Add T.P.XML.Light.Cursor."
This reverts commit d8fc497186.
2021-02-16 19:18:01 -08:00
John MacFarlane
d8fc497186 Add T.P.XML.Light.Cursor. 2021-02-16 18:51:41 -08:00
John MacFarlane
d7a4996b1e Split up T.P.XML.Light into submodules. 2021-02-16 18:40:06 -08:00
John MacFarlane
967e7f5fb9 Rename Text.Pandoc.XMLParser -> Text.Pandoc.XML.Light...
..and add new definitions isomorphic to xml-light's, but with
Text instead of String.  This allows us to keep most of the code in
existing readers that use xml-light, but avoid lots of unnecessary
allocation.

We also add versions of the functions from xml-light's
Text.XML.Light.Output and Text.XML.Light.Proc that operate
on our modified XML types, and functions that convert
xml-light types to our types (since some of our dependencies,
like texmath, use xml-light).

Update golden tests for docx and pptx.

OOXML test: Use `showContent` instead of `ppContent` in `displayDiff`.

Docx: Do a manual traversal to unwrap sdt and smartTag.
This is faster, and needed to pass the tests.

Benchmarks:

A = prior to 8ca191604d (Feb 8)
B = as of 8ca191604d (Feb 8)
C = this commit

| Reader  |  A    | B      | C     |
| ------- | ----- | ------ | ----- |
| docbook | 18 ms | 12 ms  | 10 ms |
| opml    | 65 ms | 62 ms  | 35 ms |
| jats    | 15 ms | 11 ms  |  9 ms |
| docx    | 72 ms | 69 ms  | 44 ms |
| odt     | 78 ms | 41 ms  | 28 ms |
| epub    | 64 ms | 61 ms  | 56 ms |
| fb2     | 14 ms | 5  ms  | 4 ms  |
2021-02-16 16:55:20 -08:00
Albert Krewinkel
1942dc5611
Allow tasty 1.4.* 2021-02-14 14:43:32 +01:00
Albert Krewinkel
8ffd4159d6
Jira: require jira-wiki-markup 1.3.3
* Modified the Doc parser to skip leading blank lines. This fixes
  parsing of documents which start with multiple blank lines.
  (#7095)

* Prevent URLs within link aliases to be treated as autolinks.
  (#6944)

Fixes: #7095
Fixes: #6944
2021-02-12 17:15:12 +01:00
John MacFarlane
8ca191604d Add new unexported module T.P.XMLParser.
This exports functions that uses xml-conduit's parser to
produce an xml-light Element or [Content].  This allows
existing pandoc code to use a better parser without
much modification.

The new parser is used in all places where xml-light's
parser was previously used.  Benchmarks show a significant
performance improvement in parsing XML-based formats
(especially ODT and FB2).

Note that the xml-light types use String, so the
conversion from xml-conduit types involves a lot
of extra allocation.  It would be desirable to
avoid that in the future by gradually switching
to using xml-conduit directly. This can be done
module by module.

The new parser also reports errors, which we report
when possible.

A new constructor PandocXMLError has been added to
PandocError in T.P.Error [API change].

Closes #7091, which was the main stimulus.

These changes revealed the need for some changes
in the tests.  The docbook-reader.docbook test
lacked definitions for the entities it used; these
have been added. And the docx golden tests have been
updated, because the new parser does not preserve
the order of attributes.

Add entity defs to docbook-reader.docbook.

Update golden tests for docx.
2021-02-10 22:04:11 -08:00
Albert Krewinkel
d202f7eb77
Avoid unnecessary use of NoImplicitPrelude pragma (#7089) 2021-02-07 10:02:35 -08:00
Albert Krewinkel
f7be8d0964
pandoc.cabal: use common stanza to reduce duplication (#7086) 2021-02-07 08:33:43 -08:00
Albert Krewinkel
ebb8f23b66 Use hslua-module-path 0.1.0 2021-02-02 21:04:30 -08:00
Albert Krewinkel
61b108d527 Lua: add module "pandoc.path"
The module allows to work with file paths in a convenient and
platform-independent manner.

Closes: #6001
Closes: #6565
2021-02-02 21:04:30 -08:00
John MacFarlane
02d3c71e72 BibTeX writer: use doclayout and doctemplate.
This change allows bibtex/biblatex output to wrap as other
formats do, depending on the settings of `--wrap` and `--columns`.

It also introduces default templates for bibtex and biblatex,
which allow for using the variables `header-include`, `include-before`
or `include-after` (or alternatively the command line options
`--include-in-header`, `--include-before-body`, `--include-after-body`)
to insert content into the generated bibtex/biblatex.

This change requires a change in the return type of the unexported
`T.P.Citeproc.writeBibTeXString` from `Text` to `Doc Text`.

Closes #7068.
2021-02-01 18:05:20 -08:00
John MacFarlane
b239c89a82 BibTeX writer fixes. Closes #7067.
+ Require citeproc 0.3.0.7, which correctly titlecases when titles
  contain non-ASCII characters.
+ Correctly handle 'pages' (= 'page' in CSL).
+ Correctly handle BibLaTeX 'langid' (= 'language' in CSL).
+ In BibTeX output, protect foreign titles since there's no language
  field.
2021-02-01 11:23:07 -08:00
John MacFarlane
a9adb29648 Require citeproc 0.3.0.6. 2021-01-30 19:09:08 -08:00
John MacFarlane
fe06437ba4 Use tasty-bench instead of criterion for benchmarks.
It is much lighter-weight.
2021-01-30 18:01:14 -08:00
John MacFarlane
f5e3c1dad6 Use citeproc 0.3.0.5. 2021-01-22 11:06:35 -08:00
John MacFarlane
83d7804b8f
Merge pull request #7042 from tarleb/jats-element-citations
JATS writer: use element citations
2021-01-22 10:39:58 -08:00
Albert Krewinkel
b4b3560191
JATS writer: allow to use element-citation 2021-01-22 19:35:08 +01:00
John MacFarlane
fa952c8dbe Add biblatex, bibtex as output formats (closes #7040).
* `biblatex` and `bibtex` are now supported as output
  as well as input formats.

* New module Text.Pandoc.Writers.BibTeX, exporting
  writeBibTeX and writeBibLaTeX. [API change]

* New unexported function `writeBibtexString` in
  Text.Pandoc.Citeproc.BibTeX.
2021-01-22 10:08:43 -08:00
John MacFarlane
07c98eae50 Use citeproc >= 0.3.0.4. 2021-01-15 14:17:17 -08:00
John MacFarlane
4a223e68f4 Use commonmark 0.1.1.3. 2021-01-11 12:23:55 -08:00
Albert Krewinkel
68fa437999
JATS writer: fix citations (#7018)
* JATS writer: keep code lines at 80 chars or below

* JATS writer: fix citations
2021-01-10 15:35:48 -08:00
John MacFarlane
c83811773e Bump to 2.11.4.
API change: export getReferences from T.P.Citeproc.
2021-01-10 10:16:15 -08:00
Albert Krewinkel
4f34345867
Update copyright notices for 2021 (#7012) 2021-01-08 09:38:20 -08:00
David Martschenko
385b6a3b21
Implement defaults file inheritance (#6924)
Allow defaults files to inherit options from other defaults files by
specifying them with the following syntax:
`defaults: [list of defaults files or single defaults file]`.
2021-01-05 10:15:59 -08:00
John MacFarlane
886faa3cbc Bump to 2.11.3.2, update changelog and man page 2020-12-29 12:48:55 -08:00
John MacFarlane
5d8b57444e Use citeproc 0.3.0.3.
Fixes an issue in author-only citations when both an
author and translator are present.
2020-12-29 10:43:50 -08:00
John MacFarlane
a7a162ea55 Update test for new citeproc and require it in cabal. 2020-12-28 14:40:23 -08:00
John MacFarlane
19d4e43605 Require texmath 0.12.1. 2020-12-27 22:57:14 -08:00
Albert Krewinkel
8f402beab9
LaTeX writer: support colspans and rowspans in tables. (#6950)
Note that the multirow package is needed for rowspans.
It is included in the latex template under a variable,
so that it won't be used unless needed for a table.
2020-12-20 18:04:54 -08:00
John MacFarlane
37ba5d5dfe Bump to 2.11.3.1 and update changelog and man page. 2020-12-18 15:29:57 -08:00
John MacFarlane
aa37970969 Use citeproc 0.3.0.1. 2020-12-18 15:08:23 -08:00
John MacFarlane
591bb2bace Add test/writer.asciidoctor, tables.asciidoctor to extra-source-files. 2020-12-18 11:27:41 -08:00
John MacFarlane
29e7fef729 Include missing jats test files in pandoc.cabal.
See #6961.
2020-12-18 08:02:36 -08:00
John MacFarlane
9ec3d6ee97 Use skylighting 0.10.2.
Cloess #6625.
2020-12-17 09:32:13 -08:00
John MacFarlane
914cf0b602 Fix citeproc regression with duplicate references.
- Use dev version of citeproc, which handles duplicate
  ids better, preferring the last one in the list
  and discarding the rest.
- Ensure that inline citations take priority over external
  ones.

See jgm/citeproc#36.

This restores the behavior of pandoc-citeproc.
2020-12-16 15:37:40 -08:00
John MacFarlane
b4b4e32307 Properly handle boolean values in writing YAML metadata.
(Markdown writer.)
This requires doctemplates >= 0.9.
Closes #6388.
2020-12-15 23:45:34 -08:00
John MacFarlane
2ce14997ad Require binary >= 0.7.
Needed for runGetOrFail.
2020-12-13 10:33:46 -08:00
Albert Krewinkel
ccd235e31f
LaTeX writer: extract table handling into separate module. 2020-12-12 16:48:28 +01:00
John MacFarlane
248a2a1db5 cabal: remove -Werror=missing-home-modules.
It causes problems using cabal repl.
2020-12-10 10:27:31 -08:00
John MacFarlane
1fd642dd30 Move executable to app directory.
Otherwise we have problems with cabal repl.
2020-12-10 10:08:24 -08:00
John MacFarlane
a3eb87b2ea Add sourcepos extension for commonmarke
* Add `Ext_sourcepos` constructor for `Extension`.
* Add `sourcepos` extension (only for commonmark).
* Bump to 2.11.3

With the `sourcepos` extension set set, `data-pos` attributes are added
to the AST by the commonmark reader. No other readers are affected.  The
`data-pos` attributes are put on elements that accept attributes; for
other elements, an enlosing Div or Span is added to hold the attributes.

Closes #4565.
2020-12-10 08:59:55 -08:00
John MacFarlane
0dd228593f Use latest citeproc release. 2020-12-09 09:34:15 -08:00
John MacFarlane
1489bb8414 Use skylighting 0.10.1. 2020-11-24 21:26:25 -08:00
Albert Krewinkel
41237fcc0e
HTML reader: extract table parsing into separate module 2020-11-24 14:17:35 +01:00
Albert Krewinkel
f9258371dd HTML reader: extract submodules
Reducing module size should reduce memory use during compilation.

This is preparatory work to tackle support for more table features.
2020-11-23 10:12:20 +01:00
John MacFarlane
3f278f580e Remove 'static' flag.
This isn't really necessary and can be misleading
(e.g. on macOS, where a fully static build isn't
possible). cabal's new option
`--enable-executable-static` does the same. On stack
you can add something like this to the options for your
executable in package.yaml:

    ld-options: -static -pthread
2020-11-18 21:08:24 -08:00
John MacFarlane
e17f970ed0 Use citeproc 0.2 2020-11-18 17:49:30 -08:00
John MacFarlane
46bbdad838 Don't allow macos builds with 'static' flag.
Closes #6771.
2020-11-18 15:41:48 -08:00
Albert Krewinkel
94c9028819 JATS writer: move Table handling to separate module
This makes it easier to split the module into smaller parts.
2020-11-17 09:46:30 +01:00
John MacFarlane
79907e5f17 Bump to 2.11.2 for next release (minor API change in Logging). 2020-11-15 08:34:45 -08:00
John MacFarlane
cfb017c76b Bump to 2.11.1.1 and update changelog. 2020-11-07 11:12:19 -08:00
John MacFarlane
e6abf3b8ed Use citeproc 0.1.1.1.
Closes #6813.
2020-11-05 21:23:57 -08:00
John MacFarlane
9de386352a Require latest commonmark, commonmark-extensions.
Fixes a bug with `autolink_bare_uris` and commonmark.
2020-11-05 16:58:36 -08:00
John MacFarlane
391f6e5f80 Use latest commonmark, commonmark-extensions. 2020-11-05 15:05:11 -08:00
John MacFarlane
b5e9c2a7a6 Use citeproc 0.1.1. 2020-11-04 11:15:48 -08:00
John MacFarlane
f502c8d944 Bump version to 2.11.1 and update changelog. 2020-11-02 22:20:44 -08:00
John MacFarlane
992657efaa Use latest commonmark, commonmark-extensions.
This fixes a bug with nested blocks in footnotes with the
`footnote` extension to `commonmark`.  See jgm/commonmark-hs#63.
2020-11-01 10:48:47 -08:00
John MacFarlane
f20ec6b329 Bump to 2.11.0.4. 2020-10-22 22:06:38 -07:00
John MacFarlane
2059c05f0e Require citeproc >= 0.1.0.3.
In the previous release we pointed to this with cabal.project
and stack.yaml, but jumped the gun because citeproc 0.1.0.3
had not yet been officially released.
2020-10-22 21:45:38 -07:00
John MacFarlane
4731fa1d3f Bump to 2.11.0.3 and update changelog. 2020-10-22 17:35:43 -07:00
John MacFarlane
d199abb380 Bump version to 2.11.0.2 2020-10-19 16:32:39 -07:00
Albert Krewinkel
ae4e9d3b38
Relax upper bound on hslua, allow hslua-1.3.* 2020-10-16 21:41:05 +02:00
John MacFarlane
3c8b3eba17 Require citeproc 0.1.0.2. 2020-10-15 13:00:37 -07:00
John MacFarlane
0646873964 Version to 2.11.0.1 2020-10-13 22:47:56 -07:00
John MacFarlane
1122d22a2c Use citeproc 0.1.0.1. 2020-10-13 22:44:05 -07:00
John MacFarlane
b438f0c7a7 pandoc.cabal - recognize new formats in description. 2020-10-10 22:20:56 -07:00
John MacFarlane
eff6b8f27d Use latest citeproc. 2020-09-27 16:03:31 -07:00
John MacFarlane
09d39e0e98 ALlow bytestring 0.11.x. 2020-09-23 22:27:20 -07:00
John MacFarlane
e0984a43a9 Add built-in citation support using new citeproc library.
This deprecates the use of the external pandoc-citeproc
filter; citation processing is now built in to pandoc.

* Add dependency on citeproc library.
* Add Text.Pandoc.Citeproc module (and some associated unexported
  modules under Text.Pandoc.Citeproc).  Exports `processCitations`.
  [API change]
* Add data files needed for Text.Pandoc.Citeproc:  default.csl
  in the data directory, and a citeproc directory that is just
  used at compile-time.  Note that we've added file-embed as a mandatory
  rather than a conditional depedency, because of the biblatex
  localization files. We might eventually want to use readDataFile
  for this, but it would take some code reorganization.
* Text.Pandoc.Loging: Add `CiteprocWarning` to `LogMessage` and use it
  in `processCitations`. [API change]
* Add tests from the pandoc-citeproc package as command tests (including
  some tests pandoc-citeproc did not pass).
* Remove instructions for building pandoc-citeproc from CI and
  release binary build instructions.  We will no longer distribute
  pandoc-citeproc.
* Markdown reader: tweak abbreviation support.  Don't insert a
  nonbreaking space after a potential abbreviation if it comes right before
  a note or citation.  This messes up several things, including citeproc's
  moving of note citations.
* Add `csljson` as and input and output format. This allows pandoc
  to convert between `csljson` and other bibliography formats,
  and to generate formatted versions of CSL JSON bibliographies.
* Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`. [API
  change]
* Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`. [API
  change]
* Added `bibtex`, `biblatex` as input formats.  This allows pandoc
  to convert between BibLaTeX and BibTeX and other bibliography formats,
  and to generated formatted versions of BibTeX/BibLaTeX bibliographies.
* Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and
  `readBibLaTeX`. [API change]
* Make "standalone" implicit if output format is a bibliography format.
  This is needed because pandoc readers for bibliography formats put
  the bibliographic information in the `references` field of metadata;
  and unless standalone is specified, metadata gets ignored.
  (TODO: This needs improvement. We should trigger standalone for the
  reader when the input format is bibliographic, and for the writer
  when the output format is markdown.)
* Carry over `citationNoteNum` to `citationNoteNumber`.  This was just
  ignored in pandoc-citeproc.
* Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter.
  [API change] This runs the processCitations transformation.
  We need to treat it like a filter so it can be placed
  in the sequence of filter runs (after some, before others).
  In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`,
  so this special filter may be specified either way in a defaults file
  (or by `citeproc: true`, though this gives no control of positioning
  relative to other filters).  TODO: we need to add something to the
  manual section on defaults files for this.
* Add deprecation warning if `upandoc-citeproc` filter is used.
* Add `--citeproc/-C` option to trigger citation processing.
  This behaves like a filter and will be positioned
  relative to filters as they appear on the command line.
* Rewrote the manual on citatations, adding a dedicated Citations
  section which also includes some information formerly found in
  the pandoc-citeproc man page.
* Look for CSL styles in the `csl` subdirectory of the pandoc user data
  directory.  This changes the old pandoc-citeproc behavior, which looked
  in `~/.csl`.  Users can simply symlink `~/.csl` to the `csl`
  subdirectory of their pandoc user data directory if they want
  the old behavior.
* Add support for CSL bibliography entry formatting to LaTeX, HTML,
  Ms writers.  Added CSL-related CSS to styles.html.
2020-09-21 10:15:50 -07:00
John MacFarlane
89c577befb Bump to 2.11. 2020-09-21 10:15:49 -07:00
Albert Krewinkel
ba591ba365
pandoc.cabal: sort build depends alphabetically (#6691) 2020-09-21 09:28:25 -07:00
Albert Krewinkel
acbea6b8c6
Lua filters: add SimpleTable for backwards compatibility (#6575)
A new type `SimpleTable` is made available to Lua filters. It is
similar to the `Table` type in pandoc versions before 2.10;
conversion functions from and to the new Table type are provided.

Old filters using tables now require minimal changes and can use,
e.g.,

    if PANDOC_VERSION > {2,10,1} then
      pandoc.Table = pandoc.SimpleTable
    end

and

    function Table (tbl)
      tbl = pandoc.utils.to_simple_table(tbl)
      …
      return pandoc.utils.from_simple_table(tbl)
    end

to work with the current pandoc version.
2020-09-20 15:48:31 -07:00
Albert Krewinkel
b2decdfd13
CI: bump tested GHC versions to 8.8.4 and 8.10.2
Besides being newer, GHC version 8.10.2 comes preinstalled on GitHub
Actions environments; using it slightly speeds up CI tests.
2020-09-20 22:57:51 +02:00
Albert Krewinkel
c9e7ccba6f
pandoc.cabal: allow hslua 1.2 again
Sporadic test failures also happen with hslua-1.1.*, so there is no need
to exclude the newer version.

This reverts commit 315b5a4836.
2020-09-20 09:20:59 +02:00
John MacFarlane
1dd9f8b654 Use released pandoc-types 1.22. 2020-09-19 09:58:16 -07:00
Albert Krewinkel
a400d0dc62
HTML writer: render table footers if present
Part of: #6314
2020-09-12 21:49:01 +02:00
Christian Despres
22babd5382
[API change] Rename Writers.Tables and its contents (#6679)
Writers.Tables is now Writers.AnnotatedTable. All of the types and
functions in it have had the "Ann" removed from them. Now it is
expected that the module be imported qualified.
2020-09-12 08:50:36 -07:00
Albert Krewinkel
315b5a4836
pandoc.cabal: disallow hslua 1.2
See #6674
2020-09-11 09:50:33 +02:00
Christian Despres
10c6c411f9
Add Writers.Tables helper functions and types, add tests for those (#6655)
Add Writers.Tables helper functions and types, add tests for those

The Writers.Tables module contains an AnnTable type that is a pandoc
Table with added inferred information that should be enough for
writers (in particular the HTML writer) to operate on without having
to lay out the table themselves.

The toAnnTable and fromAnnTable functions in that module convert
between AnnTable and Table. In addition to producing an AnnTable with
coherent and well-formed annotations, the toAnnTable function also
normalizes its input Table like the table builder does.

Various tests ensure that toAnnTable normalizes tables exactly like
the table builder, and that its annotations are coherent.
2020-09-05 14:36:51 -07:00
John MacFarlane
81fe8ebf36 LaTeX reader: Factored out siunitx stuff into separate module. 2020-09-02 10:10:55 -07:00
John MacFarlane
613828e497 Use skylighting 0.10. 2020-08-30 22:54:36 -07:00
Albert Krewinkel
333c553548
Relax version constraints for hslua, hslua-module-text
Allow `hslua-1.2.*` and `hslua-module-text-0.3.*`.
2020-08-15 13:52:37 +02:00
John MacFarlane
57417feaf4 Use commonmark >= 0.1.0.2. Closes #6589. 2020-08-05 12:58:29 -07:00
Felix Yan
48487f287f
Remove duplicated exceptions (#6591) 2020-08-05 12:12:01 -07:00
John MacFarlane
57e29610ac Use skylighting 0.9. 2020-07-31 08:56:59 -07:00
John MacFarlane
ac1f45c553 Update changelog and bump to 2.10.1. 2020-07-23 17:30:57 -07:00
John MacFarlane
c37a56e060 Use commonmark-0.1.0.1.
Partially addresses #6556.
2020-07-23 16:36:44 -07:00
John MacFarlane
942e3ee1f9 RST reader: fix csv tables with multiline cells.
Closes #6549.
2020-07-21 10:20:15 -07:00
John MacFarlane
e17b4718d4 Use commonmark-extensions, commonmark-pandoc 0.2. 2020-07-19 22:51:59 -07:00
John MacFarlane
d6b7b1dc77 Remove use of cmark-gfm for commonmark/gfm rendering.
Instead rely on the markdown writer with appropriate extensions.

Export writeCommonMark variant from Markdown writer.
This changes a few small things in rendering markdown,
e.g. w/r/t requiring backslashes before spaces inside
super/subscripts.
2020-07-19 22:51:59 -07:00
John MacFarlane
0db4702042 Use commonmark-hs to parse commonmark/gfm...
...instead of cmark-gfm (a wrapper around a C library).

We can now support many more pandoc extensions for
commonmark and gfm.

Add fenced_code_attributes to gfm/commonmark extensions.
2020-07-19 22:51:59 -07:00
John MacFarlane
c2cc4a0504 CI: Drop testing on ghc 8.0.2. 2020-07-19 22:51:59 -07:00
Michael Hoffmann
09ea10e2b1 Escape starting periods in ms writer code blocks
If a line of ms code block output starts with a period (.), it should
be prepended by '\&' so that it is not interpreted as a roff command.

Fixes #6505
2020-07-08 23:52:28 +02:00
John MacFarlane
6716d1c702 Bump version to 2.10. Update tested-with.
We need a major version bump because of the new pandoc-types.
2020-06-22 16:59:20 -07:00
Albert Krewinkel
064303e2c9
Jira writer: always escape braces
Braces are now always escaped, even within words or when surrounded by
whitespace. Jira and Confluence treat braces specially.

Package jira-wiki-markup must be version 1.3.2 or later.

Fixes: #6478
2020-06-22 16:30:11 +02:00
John MacFarlane
112e98def6 Use latest skylighting. 2020-06-19 15:31:31 -07:00
Laurent P. René de Cotret
e8f532780b
Remove unused dependency vector (#6462) 2020-06-15 10:03:41 -07:00
Albert Krewinkel
16889a01b9
Jira reader: require jira-wiki-markup 1.3.1 or later
This solves the following problems of the Jira reader:

 * Two consecutive markup chars are now parsed verbatim; styled text
   must not be empty.
 * Styled text may not contain newlines.
 * Links to anchors are now parsed as links.

Fixes: #6343
Fixes: #6325
Fixes: #6407
2020-06-14 11:46:59 +02:00
John MacFarlane
287a3fcc51 Allow http-client 0.7. 2020-05-28 11:25:01 -07:00
Felix Yan
46cb70a30c
Allow aeson 1.5 (#6400)
Builds fine and all tests pass here.
2020-05-25 22:02:54 -07:00
John MacFarlane
1e031ae63a Allow tasty 1.3.x. 2020-05-21 09:57:24 -07:00
Lila
57fa394eb0
Bump cabal-version to 2.2 (#6377)
In b3cfdc2c7 the license was changed to GPL-2.0-or-later which is an
SPDX expression, however cabal only interprets the license field as an
SPDX expression if cabal-version is 2.2 or later.

Starting with 2.2 cabal-version also has to be the first statement in
the .cabal file.
2020-05-18 14:29:43 -07:00
Lila
b3cfdc2c7a Correct license listed in cabal
`GPL-2` is interpreted as GPLv2 only, however the actual license is GPLv2 or later
2020-05-13 22:27:44 +02:00
John MacFarlane
46179d5b3e Use latest skylighting.
This adds `aria-hidden="true"` to the empty a elements, which
helps people who use screen readers.
2020-05-12 14:37:07 -07:00
John MacFarlane
3324412d72 Allow base64-bytestring 1.1. 2020-04-25 12:55:17 -07:00
John MacFarlane
61771e2c9b Use pandoc-types 1.21, new texmath. 2020-04-19 08:17:32 -07:00
Albert Krewinkel
62cf21cbaa
API change: use new type PandocLua for all pandoc Lua operations
The new type `PandocLua` is an instance of the `PandocMonad` typeclass
and can thus be used in a way similar to `PandocIO`.
2020-04-17 23:05:44 +02:00
Albert Krewinkel
eceb8eaf47
Class: generalize PandocIO functions to MonadIO 2020-04-17 23:05:31 +02:00
Albert Krewinkel
fb54f3d679
API change: use PandocError for exceptions in Lua subsystem
The PandocError type is used throughout the Lua subsystem, all Lua
functions throw an exception of this type if an error occurs. The
`LuaException` type is removed and no longer exported from
`Text.Pandoc.Lua`. In its place, a new constructor `PandocLuaError` is
added to PandocError.
2020-04-17 21:52:48 +02:00
John MacFarlane
a9ef15bbd5 Revert 0e48a02 and dependency on base-noprelude...
which hasn't been updated for ghc 8.10.
See discussion at #6187.
2020-04-17 09:50:55 -07:00
Cédric Couralet
34775b4128
Add an option to disable certificate validation (#6156)
This commit adds the option `--no-check-certificate`, which disables certificate
checking when resources are fetched by HTTP.

Co-authored-by: Cécile Chemin <cecile.chemin@insee.fr>
Co-authored-by: Juliette Fourcot <juliette.fourcot@insee.fr>
2020-04-13 14:58:42 -07:00
John MacFarlane
58cd731e51 Require doctemplates 0.8.2. 2020-04-12 22:25:31 -07:00
John MacFarlane
3f7f741297 Allow haddock-library 1.9.x. 2020-04-06 21:01:04 -07:00
Albert Krewinkel
c3f539364a
Jira: support citations, attachment links, and user links
Closes: #6231
Closes: #6238
Closes: #6239
2020-04-04 14:27:27 +02:00
Albert Krewinkel
d867cac8ca
Jira reader: resolve parsing issues of blockquote, color
Parsing problems occurring with block quotes and colored text have been
resolved.

Fixes: #6233
Fixes: #6235
2020-04-03 13:25:52 +02:00
Felix Yan
f6615ad85e
Allow hslua 1.1 (#6243)
Builds fine and all tests pass.
2020-04-01 08:52:14 -07:00
Albert Krewinkel
ff9be6b384
Jira writer: convert spans with class underline to inserted text
Spans with class `underline` as converted into Jira text marked as
`+inserted+`, i.e. surrounded by plus-signs.
2020-03-31 09:57:59 +02:00
Albert Krewinkel
09a5a1f447
Jira reader: fix multiple parsing problems
Multiple parsing problems are resolved, including issues with empty
table cells, faulty recognition of closing emphasis characters, and
parsing of image attributes.

Fixes: #6212
Fixes: #6219
Fixes: #6220
2020-03-28 15:57:00 +01:00
John MacFarlane
e1d302b3ef Bump QuickCheck upper bound. 2020-03-27 22:23:13 -07:00
John MacFarlane
b5a3c3292a Bump version to 2.9.1. 2020-03-23 14:38:58 -07:00
Albert Krewinkel
2a042ff711
Text.Pandoc.Class: extract submodules PandocIO, PandocPure 2020-03-22 14:59:38 +01:00
Albert Krewinkel
44f8c2725e
Jira reader: fix parsing of tables without preceding blankline
A bug was fixed which caused faulty parsing if a table was not preceded
by a newline and the first table cell had no space after the initial `|`
characters.

Fixes: #6198
2020-03-19 21:27:35 +01:00
Albert Krewinkel
81d46435f6
Jira reader: fix parsing of strikeout, emphasis
A bug was fixed which caused non-emphasized text containing digits and/or
non-special symbols (like dots) to sometimes be parsed incorrectly.

Fixes: #6196
2020-03-18 21:32:05 +01:00
Albert Krewinkel
a5fa55969f
Use implicit Prelude (#6187)
* Use implicit Prelude

The previous behavior was introduced as a fix for #4464. It seems that
this change alone did not fix the issue, and `stack ghci` and `cabal
repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded
for these versions. Given this, it seems cleaner to revert to the
implicit Prelude.

* PandocMonad: remove outdated check for base version

Only base versions 4.9 and later are supported, the check for
`MIN_VERSION_base(4,8,0)` is therefore unnecessary.

* Always use custom prelude

Previously, the custom prelude was used only with older GHC versions, as
a workaround for problems with ghci. The ghci problems are resolved by
replacing package `base` with `base-noprelude`, allowing for consistent
use of the custom prelude across all GHC versions.
2020-03-15 09:45:44 -07:00
Albert Krewinkel
ec49643d64
Subdivide Text.Pandoc.Class into small modules (#6106)
* Extract CommonState into submodule

* Extract PandocMonad into submodule

* PandocMonad: ensure all functions have Haddock documentation
2020-03-14 20:49:36 -07:00
Albert Krewinkel
11b5f1e40b
Update copyright year (#6186)
* Update copyright year

* Copyright: add notes for Lua and Jira modules
2020-03-13 09:52:47 -07:00
Albert Krewinkel
7eb9914841
Jira reader: support colored inline text, indented lists
* Support for colored inlines has been added.
* Lists are now allowed to be indented; i.e., lists are still recognized
  if list markers are preceded by spaces.

Closes: #6183, #6184
2020-03-13 09:52:28 +01:00
John MacFarlane
33fcac40d5 Use latest texmath. 2020-02-15 09:12:56 -08:00
John MacFarlane
3a181f0a97 Add Text.Pandoc.Image with unexported svgToPng. 2020-02-12 21:57:00 -08:00
Albert Krewinkel
f5ea5f0aad
Introduce new format variants for JATS (#6067)
New formats:

- `jats_archiving` for the "Archiving and Interchange Tag Set",
- `jats_publishing` for the "Journal Publishing Tag Set", and
- `jats_articleauthoring` for the "Article Authoring Tag Set."

The "jats" output format is now an alias for "jats_archiving".

Closes: #6014
2020-02-12 20:36:02 -08:00
John MacFarlane
f9514ccb9e Add Text.Pandoc.Readers.CSV (readCSV).
This adds csv as an input format.
The CSV table is converted into a pandoc simple table.

Closes #6100.
2020-01-31 21:14:21 -08:00
John MacFarlane
3b4dc3a2b0 Use skylighting 0.8.3.2. 2020-01-21 17:57:23 -08:00
Albert Krewinkel
672a4bdd1d Lua filters: allow filtering of element lists (#6040)
Lists of Inline and Block elements can now be filtered via `Inlines` and
`Blocks` functions, respectively. This is helpful if a filter conversion
depends on the order of elements rather than a single element.

For example, the following filter can be used to remove all spaces
before a citation:

    function isSpaceBeforeCite (spc, cite)
      return spc and spc.t == 'Space'
       and cite and cite.t == 'Cite'
    end

    function Inlines (inlines)
      for i = #inlines-1,1,-1 do
        if isSpaceBeforeCite(inlines[i], inlines[i+1]) then
          inlines:remove(i)
        end
      end
      return inlines
    end

Closes: #6038
2020-01-15 14:26:00 -08:00
John MacFarlane
9009bda179 Update versions for doclayout, doctemplates.
Closes #6031.  The new version of doclayout fixes a
memory leak that affected `--include-in-header` with
large files (and possibly other cases involving extremely
long lines).
2020-01-13 08:39:25 -08:00
John MacFarlane
e4b2252a94 Bump to 2.9.1.1, update manual. 2020-01-05 11:15:52 -08:00
John MacFarlane
7ba55d7405 Improve pandoc man page generation.
Use before and after includes rather than special template.
2019-12-22 21:30:01 -08:00
Albert Krewinkel
89bbfa1891
pandoc.cabal: remove redundancies in extra-source-files 2019-12-18 08:05:19 +01:00
John MacFarlane
a70e62f0ac Add Jira to list of input formats in cabal description. 2019-12-17 21:08:48 -08:00
Albert Krewinkel
96c80b156d Add jira reader (#5913)
Closes #5556
2019-12-17 21:07:46 -08:00
John MacFarlane
1bc20fae0d Bump to 2.9.1. 2019-12-17 12:13:09 -08:00
John MacFarlane
a098278505 Bump version to 2.9 because of API change in Templates, Class. 2019-12-11 10:54:15 -08:00
John MacFarlane
0bfe478a69 Use external emojis package.
Moved the emoji-specified code into an external package
we can depend on.
2019-12-08 17:27:18 -08:00
John MacFarlane
5295607de7 Use doctemplates 0.8. 2019-12-07 12:31:05 -08:00
John MacFarlane
892995c6de Bump to 2.8.1 2019-12-05 12:25:40 -08:00
John MacFarlane
6c435a17cd Move data/emoji.json to emoji.json, add to extra-source-files.
This doesn't really belong in data-files as it's not loaded
dynamically.
2019-12-03 16:38:19 -08:00
John MacFarlane
0d0ec98dd5 Generate Emoji module with TH.
- Add Text.Pandoc.Emoji.TH.
- Replace long literal list in Text.Pandoc.Emoji with one-liner
  generating it from data/emoji.json using TH.
- Add Makefile target to download data/emoji.json.
- Remove tools/emoji.hs.
2019-11-27 21:31:53 -08:00
John MacFarlane
e479a88722 Bump to 2.8.0.1 and update changelog and manual. 2019-11-26 21:18:31 -08:00
John MacFarlane
ec219f911e Use skylighting 0.8.3. 2019-11-26 10:41:43 -08:00
John MacFarlane
659ee98176 Add unexported Text.Pandoc.Readers.Metadata.
For YAML metadata parsing. A step in the direction of #5914.
No API change.
2019-11-24 11:50:28 -08:00
John MacFarlane
7fb9432ae1 Update to doctemplates 0.7.2, update template docs.
This adds the `nowrap` filter.
2019-11-24 09:53:45 -08:00
John MacFarlane
06124fb863 Use doctemplates 0.7.1 2019-11-18 17:46:43 -08:00
John MacFarlane
3645f9babe Fixed some test locations and put test data files in extra-source-files. 2019-11-14 06:21:00 -08:00
despresc
90e436d496 Switch to new pandoc-types and use Text instead of String [API change].
PR #5884.

+ Use pandoc-types 1.20 and texmath 0.12.
+ Text is now used instead of String, with a few exceptions.
+ In the MediaBag module, some of the types using Strings
  were switched to use FilePath instead (not Text).
+ In the Parsing module, new parsers `manyChar`, `many1Char`,
  `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`,
  `mantyUntilChar` have been added: these are like their
  unsuffixed counterparts but pack some or all of their output.
+ `glob` in Text.Pandoc.Class still takes String since it seems
  to be intended as an interface to Glob, which uses strings.
  It seems to be used only once in the package, in the EPUB writer,
  so that is not hard to change.
2019-11-12 16:03:45 -08:00
John MacFarlane
4f1224dc0b Use latest doclayout.
Closes #5863.
2019-10-30 21:26:21 -07:00
Florian Klink
c6e936dec2 docbook reader: fix nesting of chapters and sections (#5864)
* Set dbBook to true when traversing a chapter too.
  Currently, a `<title/>` in a chapter and in a `<section/>` below that
  chapter have the same level if they're not inside a `<book/>`.

  This can happen in a multi-file book project. Also see the example at
  https://tdg.docbook.org/tdg/4.5/chapter.html

  Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr>

* Add docbook-chapter test

  This tests nested `<section/>` and makes sure `<title/>` in the first
  `<section/>` below `<chapter/>` is one level deeper than the `<chapter/>`'s
  `<title/>`, also when not inside a `<book/>`.

  Co-authored-by: Félix Baylac-Jacqué <felix@alternativebit.fr>
2019-10-30 08:51:33 -07:00
John MacFarlane
1fe9742263 Changes to build with new doctemplates/doclayout.
The new version of doctemplates adds many features to pandoc's
templating system, while remaining backwards-compatible.
New features include partials and filters.  Using template filters,
one can lay out data in enumerated lists and tables.

Templates are now layout-sensitive: so, for example, if a
text with soft line breaks is interpolated near the end of
a line, the text will break and wrap naturally.  This makes
the templating system much more suitable for programatically
generating markdown or other plain-text files from metadata.
2019-10-29 22:21:35 -07:00
John MacFarlane
a0aeb135b3 Minor template & test changes for latest dev doctemplates. 2019-10-14 23:42:29 -07:00
John MacFarlane
7388cd3e7a Improve parsing of --defaults.
- Add FromYAML instances to Opt and to all subsidiary types.
- Remove the use of HsYAML-aeson, which doesn't give good
  position information on errors.
- Rename some fields in Opt to better match cli options or
  reflect what the ycontain [API change]:

  + optMetadataFile -> optMetadataFiles
  + optPDFEngineArgs -> optPDFEngineOpts
  + optWrapText -> optWrap
- Add IpynbOutput enumerated type to Text.Pandoc.App.Opts.
  Use this instead fo a string for optIpynbOutput.
- Add FromYAML instance for Filter in Text.Pandoc.Filters.

With these changes parsing of defaults files should be
complete and should give decent error messages.

Now (unlike before) we get an error if an unknown field
is used.
2019-10-10 23:21:18 -07:00
John MacFarlane
3351dcfc45 Add HsYAML-aeson to build-depends 2019-10-09 11:01:33 -07:00
John MacFarlane
aceee9ca48 Options.WriterOptions: Change type of writerVariables to Context Text.
This will allow structured values.

[API change]
2019-10-09 11:01:33 -07:00
John MacFarlane
8fb9a0d168 Remove derive_json_via_th flag; always use TH.
This cuts down on code duplication and reduces the chance
for errors.  See #4083.
2019-10-07 21:23:50 -07:00
John MacFarlane
b235a187dc Make derive_json_via_th flag false by default 2019-10-07 17:33:41 -07:00
John MacFarlane
4ca1db0643 Require haddock-library >= 1.8 2019-10-04 07:20:48 -07:00
John MacFarlane
20c87962e3 Use texmath 0.11.3 2019-10-03 21:59:06 -07:00
John MacFarlane
4f75fed976 Don't use -Wnoncanonical-monadfail-instances which is deprecated in ghc 8.8. 2019-10-03 21:30:03 -07:00
John MacFarlane
78ff2234f4 Allow latest haddock-library. 2019-10-03 21:30:03 -07:00
John MacFarlane
383023374b Use latest skylighting. 2019-10-03 11:11:23 -07:00
John MacFarlane
4212c09296 Use skylighting >= 0.8.2.2. 2019-09-30 22:48:10 -07:00
John MacFarlane
e02a913137 Markdownify changelog -> changelog.md. 2019-09-28 10:46:41 -07:00
John MacFarlane
c6aab850b5 Require doctemplates 0.6.1. 2019-09-27 22:36:58 -07:00
John MacFarlane
fe72c9bbe4 Use latest skylighting.
This addresses #5776 for now, though ultimately we need a
new release of regex-pcre-builtin or some other solution.
2019-09-25 17:36:17 -07:00
John MacFarlane
251e2b2d6d Use latest texmath. 2019-09-24 15:14:13 -07:00
John MacFarlane
dfb2a07539 Allow latest Diff. 2019-09-24 11:22:08 -07:00
John MacFarlane
4b6a76c196 pandoc.cabal: repeat ghc-options in all stanzas. 2019-09-23 09:49:36 -07:00
John MacFarlane
c2836b1c11 Require latest texmath. 2019-09-22 12:06:11 -07:00
Nikolay Yakimov
9b6ee81c19 [Docx Writer] Re-use Readers.Docx.Parse for StyleMap (#5766)
* [Docx Parser] Move style-parsing-specific code to a new module

* [Docx Writer] Re-use Readers.Docx.Parse.Styles for StyleMap

* [Docx Writer] Move Readers.Docx.StyleMap to Writers.Docx.StyleMap

It's never used outside of writer code, so it makes more sense to scope it under writers really.
2019-09-22 12:00:35 -07:00
John MacFarlane
b64410ff9c Use HsYAML-0.2.0.0
Most of this is due to @vijayphoenix (#5704), but it
needed some revisions to integrate with current
master, and to use the released HsYAML.

Closes #5704.
2019-09-22 10:38:15 -07:00
Vanessa McHale
8f5ab97569 Add to other-extensions field for use by cabal solver (#5728) 2019-09-08 22:28:17 -07:00
John MacFarlane
e26ef34c04 Add dependency on skylighting-core in cabal file.
Closes #5729.
2019-09-05 17:36:37 -07:00
John MacFarlane
1c35167c3a Small cleanups in Makefile. 2019-09-05 17:34:47 -07:00
John MacFarlane
bb362fd76c Add partial styles.html in HTML5 template.
Avoid duplication in HTML templates by using styles.html partial.
Change indentation of styles in template.
2019-09-05 12:39:50 -07:00
John MacFarlane
e9ba29e57f Use doctemplates 0.6. 2019-09-02 11:14:14 -07:00
Albert Krewinkel
cd4b8f66bb Cabal cleanup (#5693)
* pandoc.cabal: remove conditionals for ghc < 8.0. Support for GHC 7.10 has been dropped.
* pandoc.cabal: compile with `-Wcpp-undef` when possible
* pandoc.cabal: compile with `-fhide-source-paths` if possible
2019-08-26 17:04:30 -07:00
John MacFarlane
1ee6e0e087 Use new doctemplates, doclayout.
+ Remove Text.Pandoc.Pretty; use doclayout instead. [API change]
+ Text.Pandoc.Writers.Shared: remove metaToJSON, metaToJSON'
  [API change].
+ Text.Pandoc.Writers.Shared: modify `addVariablesToContext`,
  `defField`, `setField`, `getField`, `resetField` to work with
  Context rather than JSON values. [API change]
+ Text.Pandoc.Writers.Shared: export new function `endsWithPlain` [API
  change].
+ Use new templates and doclayout in writers.
+ Use Doc-based templates in all writers.
+ Adjust three tests for minor template rendering differences.
+ Added indentation to body in docbook4, docbook5 templates.

The main impact of this change is better reflowing of content
interpolated into templates.  Previously, interpolated variables
were rendered independently and intepolated as strings, which could lead
to overly long lines.  Now the templates interpolated as Doc values
which may include breaking spaces, and reflowing occurs
after template interpolation rather than before.
2019-08-25 14:24:31 -07:00
Owen McGrath
92debe4b9e Change optMetadataFile type from Maybe to List (#5702)
Changed optMetadataFile from `Maybe FilePath` to `[FilePath]`. This allows
for multiple YAML metadata files to be added. The new default value has
been changed from `Nothing` to `[]`.

To account for this change in `Text.Pandoc.App`, `metaDataFromFile` now
operates on two `mapM` calls (for `readFileLazy` and `yamlToMeta`) and a fold.

Added a test (command/5700.md) which tests this functionality and
updated MANUAL.txt, as per the contributing guidelines.

With the current behavior, using `foldr1 (<>)`, values within files
specified first will be used over those in later files. (If the reverse
of this behavior would be preferred, it should be fixed by changing
foldr1 to foldl1.)
2019-08-24 09:41:25 -07:00
John MacFarlane
cbccf17375 Require pandoc-types 1.17.6. 2019-08-23 11:05:55 -07:00
Albert Krewinkel
813e1fc7e0
Lua: add module for AST element sequence traversal
Lua filters must be able to traverse sequences of AST elements and to
replace elements by splicing sequences back in their place. Special
`Walkable` instances can be used for this; those are provided in a new
module `Text.Pandoc.Lua.Walk`.
2019-08-16 20:52:15 +02:00
Albert Krewinkel
903d2f98c6
pandoc.cabal: add cabal.project to extra-source-files. 2019-08-15 19:28:17 +02:00
John MacFarlane
c452744520 Version bump to 2.8 because of type changes for templates. 2019-08-05 10:29:12 -07:00
John MacFarlane
b35fae6511 Use doctemplates 0.3, change type of writerTemplate.
* Require recent doctemplates.  It is more flexible and
  supports partials.
* Changed type of writerTemplate to Maybe Template instead
  of Maybe String.
* Remove code from the LaTeX, Docbook, and JATS writers that looked in
  the template for strings to determine whether it is a book or an
  article, or whether csquotes is used. This was always kludgy and
  unreliable.  To use csquotes for LaTeX, set `csquotes` in your
  variables or metadata. It is no longer sufficient to put
  `\usepackage{csquotes}` in your template or header includes.
  To specify a book style, use the `documentclass` variable or
  `--top-level-division`.
* Change template code to use new API for doctemplates.
2019-07-28 19:25:45 -07:00
John MacFarlane
1187ca3517 Templates: Change type of renderTemplate'.
Return value is now Text rather than being polymorphic.
This makes room for upcoming removal of the TemplateTarget
class from doctemplates.

Other code modified accordingly, and should compile with
both current and upcoming version of doctemplates.
2019-07-23 21:40:24 -07:00
John MacFarlane
6355552abc Version to 2.7.4. 2019-07-16 11:04:48 -07:00
John MacFarlane
021e967914 Require skylighting 0.8.2 (fix bug with long integer literals). 2019-07-14 10:10:13 -07:00
John MacFarlane
b9e7490074 Require skylighting 0.8.1.2.
This fixes a regression for C character escapes.
2019-07-14 09:52:08 -07:00
John MacFarlane
23ddb47520 Use latest skylighting. 2019-06-13 10:20:59 -07:00
Albert Krewinkel
20503894f3
MANUAL.txt, pandoc.cabal: mention Jira as possible target format 2019-06-06 08:09:42 +02:00
Albert Krewinkel
1c36857465 Add jira writer (#5548)
This adds support for Atlassian's jira markup.

Closes #2497
2019-06-05 17:52:23 -04:00
John MacFarlane
dddad515e8 Update pandoc-citeproc and skylighting versions. 2019-06-04 09:01:50 -07:00
Albert Krewinkel
3097ee100e
pandoc.mediabag module: add items function iterating over mediabag
A new function `pandoc.mediabag.items` was added to Lua module
pandoc.mediabag. This allows users to lazily iterate over all media bag
items, loading items into Lua one-by-one. Example:

    for filename, mime_type, content in pandoc.mediabag.items() do
      -- use media bag item.
    end

This is a convenient alternative to using `mediabag.list` in combination
with `mediabag.lookup`.
2019-05-29 23:17:12 +02:00
John MacFarlane
e871d65b67
Merge pull request #5526 from tarleb/richer-version-type
Lua: add Version type to simplify comparisons
2019-05-29 12:05:04 -04:00
Albert Krewinkel
505f5bf5d9
Lua: add Version type to simplify comparisons
Version specifiers like `PANDOC_VERSION` and `PANDOC_API_VERSION` are
turned into `Version` objects. The objects simplify version-appropriate
comparisons while maintaining backward-compatibility.

A function `pandoc.types.Version` is added as part of the newly
introduced module `pandoc.types`, allowing users to create version
objects in scripts.
2019-05-29 10:07:43 +02:00
John MacFarlane
3593dcda61 Use skylighting 0.8. 2019-05-27 12:15:43 -07:00
Albert Krewinkel
6208d4e7fc Improve output of Lua tests (#5499)
This makes use of tasty-lua, a package to write tests in Lua
and integrate the results into Tasty output. Test output becomes
more informative: individual tests and test groups become visible
in test output. Failures are reported with helpful error messages.
2019-05-20 12:52:28 -04:00
John MacFarlane
9ff2de0fd4 Bump to 2.7.3 2019-05-17 23:04:09 -07:00
Mauro Bieg
1d033a2691 add test/tables.xwiki to git and pandoc.cabal (#5498) 2019-05-12 10:37:37 -04:00
Albert Krewinkel
786594b23b Lua: add pandoc.system module (#5468)
The `system` Lua module provides utility functions to interact with the
operating- and file system. E.g.

    print(pandoc.system.get_current_directory())

or

    pandoc.system.with_temporary_directory('tikz', function (dir)
      -- write and compile a TikZ file with pdflatex
    end)
2019-05-04 01:06:30 -04:00
Albert Krewinkel
4d16239100
CI: test with GHC 8.6.5 2019-05-01 21:28:37 +02:00
Herbert Valerio Riedel
75b2db9a84 Don't advertise base-4.8 support anymore (#5455)
Problem is that blaze-html provides the Semigroup instance for Html
conditionally only for base >= 4.9
2019-04-17 14:19:21 -07:00
John MacFarlane
1e6c6b449f Allow QuickCheck 2.13. 2019-04-17 08:26:55 -07:00
John MacFarlane
d50f2a0bf6 Update copyright year 2019-04-09 09:16:19 -07:00
John MacFarlane
0e37ed9f50 Use cmark-gfm 0.2.0. 2019-04-09 09:15:49 -07:00
John MacFarlane
cfcc2a3f3e Bump to 2.7.2, update changelog. 2019-04-05 15:10:18 -07:00
Jesse Rosenthal
b99188c44c Update pandoc.cabal with new pptx files. 2019-04-05 09:15:49 -04:00
John MacFarlane
312b4b69b6 Add templates/default.xwiki to cabal data files. 2019-04-03 08:20:05 -07:00
John MacFarlane
976929a4a4 Add test/writer.xwiki to cabal extra-source-files. 2019-04-02 16:45:28 -07:00
John MacFarlane
4ed247ec87 Add xwiki to cabal description 2019-04-02 16:45:20 -07:00
Derek Chen-Becker
45944b51a0 Add XWiki Support (#4167)
Add XWiki Support

Closes #1800
2019-04-02 17:27:02 -06:00
John MacFarlane
2138ef8239 ipynb reader: avoid introducing spurious .0 on integers in metadata. 2019-03-27 16:52:17 -07:00
John MacFarlane
3ecc8d154b Drop support for ghc < 8. 2019-03-27 11:38:24 -07:00
John MacFarlane
957314143f Improve pdfSize in ImageSize.
Improves fix to #4322.
2019-03-20 12:25:09 -07:00
John MacFarlane
cdad322a98 Use cmark-gfm-0.1.8. 2019-03-13 21:16:51 -07:00
John MacFarlane
1749a5924b Updated tested-with. 2019-03-13 20:58:54 -07:00
John MacFarlane
28394f8d8c Bump to 2.7.1 2019-03-13 20:57:58 -07:00
John MacFarlane
514a729946 Revise last commit, adding an upper bound for cmark-gfm. 2019-03-13 15:51:41 -07:00
John MacFarlane
1e4bc70280 Exclude cmark-gfm-hs 0.1.7, which is buggy. 2019-03-13 15:48:40 -07:00
John MacFarlane
3eb50cc2e9 Require texmath 0.11.2.1 2019-03-02 16:29:59 -08:00
John MacFarlane
4774cf507e Bump version to 2.7. 2019-03-02 15:06:53 -08:00
John MacFarlane
0bed0ab5a3 Use XDG data directory for user data directory.
Instead of `$HOME/.pandoc`, the default user data directory is
now `$XDG_DATA_HOME/pandoc`, where `XDG_DATA_HOME` defaults to
`$HOME/.local/share` but can be overridden by setting the environment
variable.

If this directory is missing, then `$HOME/.pandoc` is searched
instead, for backwards compatibility.  However, we recommend
moving local pandoc data files from `$HOME/.pandoc` to
`$HOME/.local/share/pandoc`.

On Windows the default user data directory remains the same.

Closes #3582.
2019-03-02 15:03:59 -08:00
John MacFarlane
be14a95f07 Use latest skylighting.
This should fix #5328.
2019-02-27 22:14:01 -08:00
Albert Krewinkel
331d6224a1
T.P.Lua: split StackInstances into smaller Marshaling modules 2019-02-16 12:08:22 +01:00
John MacFarlane
b1c964d725 Bump to 2.6.1. 2019-02-10 14:26:33 -08:00
John MacFarlane
b6cf490efd Use latest skylighting. 2019-02-10 08:06:53 -08:00
John MacFarlane
1cdbb896f6 Added simple ipynb reader/writer tests.
Closes #5274.
2019-02-09 14:53:30 -08:00
TG
568b25d33a Adds Asciidoctor sprcific writer and tests 2019-02-09 08:21:53 -08:00