Commit graph

380 commits

Author SHA1 Message Date
John MacFarlane
1dd9f8b654 Use released pandoc-types 1.22. 2020-09-19 09:58:16 -07:00
John MacFarlane
c41ec933de Use latest skylighting. 2020-09-14 11:05:14 -07:00
John MacFarlane
aa3394af45 stack.yaml - use latest skylighting. 2020-09-14 10:28:08 -07: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
3935c9c5c4 Insignificant whitespace change.
Try to expire cache for macOS CI.
2020-09-03 09:53:50 -07:00
Albert Krewinkel
1b865aaddf
stack.yaml: use skylighting 0.10 2020-08-31 22:44:00 +02:00
John MacFarlane
5734167531 Whitespace change to stack.yaml to reset macos CI cache. 2020-08-14 14:45:25 -07:00
John MacFarlane
57417feaf4 Use commonmark >= 0.1.0.2. Closes #6589. 2020-08-05 12:58:29 -07:00
John MacFarlane
971b861ef2 Use new pandoc-citeproc, rfc5051. 2020-08-02 09:40:24 -07:00
John MacFarlane
57e29610ac Use skylighting 0.9. 2020-07-31 08:56:59 -07:00
John MacFarlane
5c4ff810d1 Use commonmark-extensions 0.2.0.1. 2020-07-24 11:24:34 -07:00
John MacFarlane
c37a56e060 Use commonmark-0.1.0.1.
Partially addresses #6556.
2020-07-23 16:36:44 -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
0df5ea87cf Use released versions of commonmark libraries. 2020-07-19 22:51:59 -07:00
John MacFarlane
3a22fbd11b Trim down githubMarkdownExtensions.
Previously it included all of the following, which make
sense for the legacy markdown_github but not for gfm,
since they are part of base commonmark and thus
can't be turned off in gfm:

- `Ext_all_symbols_escapable`
- `Ext_backtick_code_blocks`
- `Ext_fenced_code_blocks`
- `Ext_space_in_atx_header`
- `Ext_intraword_underscores`
- `Ext_lists_without_preceding_blankline`
- `Ext_shortcut_reference_links`
`
These have been removed from `githubMarkdownExtensions`, though
they're still turned on for legacy `markdown_github`.
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
a7d7c29bf7 Bump hslua in stack.yaml 2020-06-28 10:24:06 -07:00
John MacFarlane
3b25511e47 Use released pandoc-citeproc. 2020-06-23 10:44:22 -07:00
John MacFarlane
c5c8bc96a1 Use released pandoc-types 1.21. 2020-06-22 16:39:04 -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
John MacFarlane
aa9bcce4f9 Bump jira-wiki-markup in stack.yaml. 2020-06-14 23:38:41 -07:00
Mathieu Boespflug
9d076ed7ea
Make it possible to compile using Stack on NixOS (#6439)
On NixOS, it is necessary to compile with `stack --nix`. It is
furthermore necessary to provide zlib headers when `--nix` is enabled.
2020-06-07 17:32:16 -07: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
1918944c99 Add needed dependency to stack.yaml. 2020-05-04 23:01:42 -07:00
John MacFarlane
8d0c124e5f Update dependency versions in stack.yaml. 2020-05-04 14:47:00 -07:00
John MacFarlane
d3ec53b3cc Revert "Use lts-15.11 stack"
This reverts commit b78fb28898.
2020-05-04 14:44:08 -07:00
John MacFarlane
2662a60db2 Revert "Try downgrading HsYAML on stack to 0.2.0.0."
This reverts commit 32d5d6c80b.
2020-05-04 12:14:38 -07:00
John MacFarlane
32d5d6c80b Try downgrading HsYAML on stack to 0.2.0.0.
to deal with the access violation we get in CI windows:
https://github.com/jgm/pandoc/runs/643362477?check_suite_focus=true
2020-05-04 09:35:41 -07:00
John MacFarlane
5b7364d02f Revert "Try using -fexternal-interpreter to avoid access violation on Windows CI."
This reverts commit 58115dd07f.
2020-05-04 08:43:02 -07:00
John MacFarlane
58115dd07f Try using -fexternal-interpreter to avoid access violation on Windows CI. 2020-05-03 23:39:32 -07:00
John MacFarlane
b78fb28898 Use lts-15.11 stack 2020-05-03 21:34:11 -07:00
John MacFarlane
8d09a92d97 Use latest pandoc-types master with underline addition. 2020-04-27 09:35:34 -07:00
John MacFarlane
64e84d8a3e Use dev version of pandoc-citeproc...
so we can use pandoc-types 1.21 with it.
2020-04-19 09:00:18 -07:00
John MacFarlane
61771e2c9b Use pandoc-types 1.21, new texmath. 2020-04-19 08:17:32 -07: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
7accbd585e Use main pandoc-types repository...
now that @despresc's changes have been merged.
2020-04-17 10:05:55 -07:00
Albert Krewinkel
75d7e69532 Use custom pandoc-types repo with new table types 2020-04-15 23:03:22 -04:00
despresc
c7814f31e1 Use the new builders, modify readers to preserve empty headers
The Builder.simpleTable now only adds a row to the TableHead when the
given header row is not null. This uncovered an inconsistency in the
readers: some would unconditionally emit a header filled with empty
cells, even if the header was not present. Now every reader has the
conditional behaviour. Only the XWiki writer depended on the header
row being always present; it now pads its head as necessary.
2020-04-15 23:03:22 -04:00
despresc
d368536a4e Adapt to the removal of the RowSpan, ColSpan, RowHeadColumns accessors 2020-04-15 23:03:22 -04:00
despresc
4e34d366df Adapt to the newest Table type, fix some previous adaptation issues
- Writers.Native is now adapted to the new Table type.

- Inline captions should now be conditionally wrapped in a Plain, not
  a Para block.

- The toLegacyTable function now lives in Writers.Shared.
2020-04-15 23:03:22 -04:00
despresc
7254a2ae0b Implement the new Table type 2020-04-15 23:03:22 -04:00
John MacFarlane
58cd731e51 Require doctemplates 0.8.2. 2020-04-12 22:25:31 -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
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
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
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
9feefa3931 Revert "stack.yaml - switch to lts-15."
This reverts commit a238128a8e.

This version fails on Windows.  We get the following log output:

Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Building all executables for `pandoc' once. After a successful build of all of them, only specified executables will be rebuilt.
pandoc> configure (lib + exe + test)
Configuring pandoc-2.9.2...
pandoc> build (lib + exe + test)
Preprocessing library for pandoc-2.9.2..
Building library for pandoc-2.9.2..
[  1 of 162] Compiling Paths_pandoc
[  2 of 162] Compiling Text.Pandoc.App.FormatHeuristics
[  3 of 162] Compiling Text.Pandoc.Asciify
[  4 of 162] Compiling Text.Pandoc.CSV
[  5 of 162] Compiling Text.Pandoc.Data
C:\Users\runneradmin\AppData\Roaming\stack\snapshots\9b7c3910\lib\x86_64-windows-ghc-8.8.2\texmath-0.12.0.1-LHa5Nt7Y9k12Dq03wVcYbb\HStexmath-0.12.0.1-LHa5Nt7Y9k12Dq03wVcYbb.o: unhandled PEi386 relocation type 0
ghc.exe: unable to load package `texmath-0.12.0.1'
      C:\Users\runneradmin\AppData\Roaming\stack\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.2.exe --builddir=.stack-work\dist\29cc6475 build lib:pandoc exe:pandoc test:test-pandoc --ghc-options " -fdiagnostics-color=always"
2020-02-17 16:52:46 -08:00
John MacFarlane
a238128a8e stack.yaml - switch to lts-15. 2020-02-17 15:59:18 -08:00
John MacFarlane
87b9ee87e6 Use pandoc-citeproc 0.17. 2020-02-15 21:51:39 -08:00
John MacFarlane
33fcac40d5 Use latest texmath. 2020-02-15 09:12:56 -08:00
John MacFarlane
3b4dc3a2b0 Use skylighting 0.8.3.2. 2020-01-21 17:57:23 -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
Albert Krewinkel
96c80b156d Add jira reader (#5913)
Closes #5556
2019-12-17 21:07:46 -08:00
John MacFarlane
4ced99b5db Bump pandoc-citeproc version to 0.16.4.1. 2019-12-11 13:53:45 -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
ec219f911e Use skylighting 0.8.3. 2019-11-26 10:41:43 -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
138d0b1b3e Use released pandoc-citeproc 0.16.4. 2019-11-21 21:40:35 -08:00
John MacFarlane
06124fb863 Use doctemplates 0.7.1 2019-11-18 17:46:43 -08:00
John MacFarlane
787ad00167 Use dev version of doctemplates. 2019-11-17 22:44:40 -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
9c7f75afb5 Change merge behavior for metadata.
Previously, if a document contained two YAML metadata blocks
that set the same field, the conflict would be resolved in favor
of the first. Now it is resolved in favor of the second (due to
a change in pandoc-types).

This makes the behavior more uniform with other things in pandoc
(such as reference links and `--metadata-file`).
2019-11-07 10:48:38 -08:00
John MacFarlane
803ab48a20 Use latest pandoc-citeproc 0.16.3.1 in binary packages. 2019-11-04 09:32:56 -08:00
John MacFarlane
4f1224dc0b Use latest doclayout.
Closes #5863.
2019-10-30 21:26:21 -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
b80bd174a2 Use latest dev doctemplates 2019-10-16 09:25:52 -07:00
John MacFarlane
f1fd120d4a Use latest dev doctemplates. 2019-10-15 22:33:29 -07:00
John MacFarlane
a0aeb135b3 Minor template & test changes for latest dev doctemplates. 2019-10-14 23:42:29 -07:00
John MacFarlane
1985199ce8 stack.yaml - re-add HsYAML-aeson, as pandoc-citeproc uses it 2019-10-11 08:20:27 -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
3aa069e1d5 Change optVariables from [(String, String)] to Context Text.
In Text.Pandoc.App.Opt [API change].
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
ceeb565203 stack.yaml - added some missing flags 2019-10-06 16:53:23 -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
383023374b Use latest skylighting. 2019-10-03 11:11:23 -07:00
John MacFarlane
89c916d830 Use latest skylighting-core.
Closes #5776.
2019-09-30 22:48:10 -07:00
John MacFarlane
4212c09296 Use skylighting >= 0.8.2.2. 2019-09-30 22:48:10 -07:00
John MacFarlane
d98dde07c9 Used released pandoc-citeproc 0.16.3. 2019-09-25 18:03:57 -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
570b96f4e8 Use pandoc-types 1.17.6.1 2019-09-24 09:39:00 -07:00
John MacFarlane
f60ae7f327 Update pandoc-citeproc commit. 2019-09-22 22:09:51 -07:00
John MacFarlane
a846ce9dd4 Add HsYAML-aeson to stack.yaml. 2019-09-22 21:43:30 -07:00
John MacFarlane
74e25c5480 Use latest pandoc-citeproc. 2019-09-22 17:03:40 -07:00
John MacFarlane
ad64ec613d Switch to lts-14 resolver and ghc 8.6. 2019-09-22 12:43:29 -07:00
John MacFarlane
a9d106d1d1 Use released doctemplates 2019-09-22 10:58:04 -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
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
d0bddaf7b9 Use latest pandoc-citeproc. 2019-09-02 21:26:20 -07:00
John MacFarlane
e9ba29e57f Use doctemplates 0.6. 2019-09-02 11:14:14 -07:00
John MacFarlane
ffbd690cbc Simplify stack.yaml after cabal file changes.
We don't need so many local ghc options now that they're
specified in pandoc.cabal.

I've kept `-fhide-source-paths` (in case we move this out
of pandoc.cabal) and `-Wno-missing-home-modules` (which seems
to be needed for `stack ghci` to work).
2019-08-26 17:37:06 -07:00
John MacFarlane
8a26422bfc Use dev version of doctemplates. 2019-08-25 23:49:40 -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