Commit graph

1185 commits

Author SHA1 Message Date
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