Commit graph

318 commits

Author SHA1 Message Date
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
John MacFarlane
5b11ca03e1 Use released pandoc-types. 2019-08-23 12:50:58 -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
John MacFarlane
ec55382f8d Fix stack.yaml. 2019-08-07 08:33:30 -07:00
John MacFarlane
ea3a779f7b Use dev version of pandoc-citeproc. 2019-08-05 10:51:06 -07:00
John MacFarlane
82d94d1452 Use latest doctemplates. 2019-07-29 10:56:43 -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
25939c0838 stack.yaml - use latest skylighting. 2019-07-14 10:40:17 -07:00
John MacFarlane
23ddb47520 Use latest skylighting. 2019-06-13 10:20:59 -07:00
John MacFarlane
dddad515e8 Update pandoc-citeproc and skylighting versions. 2019-06-04 09:01:50 -07:00
John MacFarlane
0be83f24a9 Specify skylighting 0.8 as extra-deps. 2019-05-27 22:28:49 -07:00
John MacFarlane
20144a205e Disable missing-home-modules warning in stack.yaml.
Otherwise 'stack ghci' fails.
2019-05-23 09:47:09 -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
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
John MacFarlane
66ffe1831e Update stack.yaml, use latest pandoc-citeproc and lts-13. 2019-04-18 21:36:39 -07:00
John MacFarlane
0e37ed9f50 Use cmark-gfm 0.2.0. 2019-04-09 09:15:49 -07:00
John MacFarlane
9c7a57d648 stack.yml - remove -Wmissing-home-modules
This seems to cause problems with stack ghci.
2019-03-28 17:02:25 -07:00
John MacFarlane
33476b30f9 stack.yaml: remove RTS options 2019-03-28 08:58:11 -07:00
John MacFarlane
03293a4ac4 Quote RTS options in stack.yaml. 2019-03-27 09:36:27 -07:00
John MacFarlane
9e876fb568 Add nice default ghc options to stack.yaml. 2019-03-27 09:22:24 -07:00
John MacFarlane
cdad322a98 Use cmark-gfm-0.1.8. 2019-03-13 21:16:51 -07:00
John MacFarlane
12e36ba827 Use latest pandoc-citeproc. 2019-03-12 23:27:45 -07:00
John MacFarlane
12afafdf7f Use latest pandoc-citeproc, texmath. 2019-03-07 22:09:22 -08:00
John MacFarlane
70ab78e294 Use latest pandoc-citeproc. Updated cahngelog. 2019-03-02 17:49:55 -08:00
John MacFarlane
3eb50cc2e9 Require texmath 0.11.2.1 2019-03-02 16:29:59 -08:00
John MacFarlane
f152d4d53b Remove workaround for foundation, now that the bug is fixed. 2019-02-27 23:54:53 -08:00
John MacFarlane
be14a95f07 Use latest skylighting.
This should fix #5328.
2019-02-27 22:14:01 -08:00
John MacFarlane
fb5bafd13e Use latest pandoc-citeproc (0.16.1). 2019-02-15 15:05:46 -08:00
John MacFarlane
b6cf490efd Use latest skylighting. 2019-02-10 08:06:53 -08:00
John MacFarlane
4ef23623d3 Use pandoc-citeproc-0.16.0.2 2019-02-07 10:00:21 -08:00
John MacFarlane
5e1dc5809b stack.yaml - use latest pandoc-citeproc. 2019-02-06 10:56:11 -08:00
John MacFarlane
13c1cb82b6 stack.yaml - use latest texmath. 2019-01-30 22:10:20 -08:00
John MacFarlane
18a9c7c0e0 Update stack.yaml to use lts-13. 2019-01-30 14:38:35 -08:00
John MacFarlane
1c8097136b Update pandoc-citeproc commit in stack.yaml. 2019-01-25 06:58:28 -08:00
John MacFarlane
395ea03069 Support ipynb (Jupyter notebook) as input and output format.
[API change]

* Depend on ipynb library.

* Add `ipynb` as input and output format.

* Added Text.Pandoc.Readers.Ipynb (supports both nbformat v3 and v4).

* Added Text.Pandoc.Writers.Ipynb (supports nbformat v4).

* Added ipynb readers and writers to T.P.Readers,
  T.P.Writers, and T.P.Extensions.  Register the
  file extension .ipynb for this format.

* Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error.

* Note: there is no template for ipynb.
2019-01-22 21:45:59 -08:00
John MacFarlane
4dc732f28f Update stack resolver. 2018-12-16 08:19:11 -08:00
John MacFarlane
80e86109a2 Use compatible version of pandoc-citeproc. 2018-12-02 09:33:50 -08:00
John MacFarlane
6513de055a stack.yaml - use skylighting 0.7.5. 2018-12-01 15:54:57 -08:00
John MacFarlane
8ae18138df Use latest dev version of pandoc-citeproc.
IT allows pandoc 2.5.
2018-11-23 10:21:24 -05:00
John MacFarlane
5d8289665a Clean up stack.yaml, allow latest pandoc-citeproc. 2018-11-13 07:53:29 -08:00
John MacFarlane
16af096a68 stack.yaml - use latest versions of packages.
pandoc-citeproc, HsYaml, yaml.
2018-11-11 14:45:59 -08:00
John MacFarlane
123381765c Use latest texmath. 2018-10-24 12:06:37 -07:00
John MacFarlane
4333556bcf stack.yaml - use latest cmark-gfm, pandoc-citeproc. 2018-10-19 20:28:35 -07:00
John MacFarlane
ebdb2deb0d Updated version bounds for containers and haddock-library.
Allow haddock-library 1.7 and containers 0.6.*.

Closes #4974.
2018-10-17 17:30:14 -07:00
John MacFarlane
ab3e41c822 Use pandoc-citeproc 0.14.7. 2018-10-14 14:49:34 -07:00
John MacFarlane
78871c9b96 Use pandoc-citeproc 0.14.6. 2018-10-13 09:37:45 -07:00
John MacFarlane
2e9a8d207b Require skylighting 0.7.4.
Closes #4920.
2018-10-08 22:48:13 -07:00
Albert Krewinkel
9abdbb2783
Lua filters: report traceback when an error occurs
A proper Lua traceback is added if either loading of a file or execution
of a filter function fails. This should be of help to authors of Lua
filters who need to debug their code.
2018-10-01 16:32:11 +02:00
Albert Krewinkel
56fe5b559e
Use hslua v1.0.0 2018-09-24 20:11:27 +02:00
John MacFarlane
47034fd781 Use released version of pandoc-citeproc (0.14.4). 2018-09-16 20:00:26 -07:00
John MacFarlane
5df45fd1fe Use latest texmath. 2018-09-09 14:38:11 -07:00
John MacFarlane
01f39c5991 stack.yaml tweaks.
Use a patched version of foundation until
https://github.com/haskell-foundation/foundation/pull/503
is fixed.

Use latest pandoc-citeproc.
2018-09-06 23:09:17 -07:00
John MacFarlane
97a176aaaa stack.yaml: use latest dev version of pandoc-citeproc. 2018-09-03 23:50:50 -07:00
John MacFarlane
d0072002f5 Use yaml-0.9.0 in stack.yaml. 2018-08-22 13:40:54 -07:00
John MacFarlane
df22464434 Use latest pandoc-citeproc.
This should fix build failure on appveyor.
2018-08-22 08:33:38 -07:00
John MacFarlane
0d9c0b1b5b stack.yaml: use lts 12.6 and latest git pandoc-citeproc. 2018-08-16 22:03:44 -07:00
John MacFarlane
3e35292707 Revert "Try limiting to aeson-pretty-0.8.5."
This reverts commit ceec41072a.
2018-07-14 12:27:07 -07:00
John MacFarlane
ceec41072a Try limiting to aeson-pretty-0.8.5.
That built before on appveyor...
2018-07-14 12:10:21 -07:00
John MacFarlane
71e55f520e Use latest network.
Hopefully this will build on Windows.
See https://ci.appveyor.com/project/jgm/pandoc/build/1.0.2625/job/tfpvh7rxue26phoq
2018-07-13 10:54:21 -07:00
John MacFarlane
23e6e8e221 Add pandoc-citeproc to stack.yaml. 2018-07-13 10:15:29 -07:00
John MacFarlane
f7485f8850 Use lts-12 for stack.yaml, add stack.lts11.yaml.
Also adjusted some minor versions in extra-deps.
2018-07-13 09:51:13 -07:00
John MacFarlane
b153d028ee Add stack.lts10.yaml, switch to lts11 in stack.yaml. 2018-07-13 09:20:28 -07:00
John MacFarlane
e49b8304e4 Use HsYAML instead of yaml for translations, YAML metadata.
yaml wraps a C library; HsYAML is pure Haskell.
Closes #4747.  Advances #4535.
2018-06-29 23:21:25 +02:00