Commit graph

1310 commits

Author SHA1 Message Date
John MacFarlane
d8a614d7bb Bump to 2.2.3, update changelog and man page. 2018-08-05 12:40:56 -07:00
John MacFarlane
a007cd7ad6 Bump version to 2.2.2.1. 2018-07-18 19:23:22 -07:00
John MacFarlane
ebd79b6477 Minor cabal file changes.
Requested by 'stack upload.'
Different format for minimum cabal version.
Use of autogen-modules.
2018-07-15 21:43:54 -07:00
John MacFarlane
f44be8c08f Bump to 2.2.2 and update changelog. 2018-07-15 13:44:43 -07:00
John MacFarlane
d6cbc7ba37 Travis: Use system ghc. And use ghc-8.4.3 instead of 8.4.2. 2018-07-13 10:28:29 -07:00
John MacFarlane
d67a88eb12 Bump upper bound for JuicyPixels. 2018-07-13 08:10:25 -07:00
John MacFarlane
8cea6125fb Exclude foundaiton 0.0.21 for ghc 7.10. 2018-07-12 21:59:25 -07:00
John MacFarlane
2437b6d10b Attempt to fix latest ghc 7.10 build failure. 2018-07-12 21:46:37 -07:00
John MacFarlane
2737e4996c Allow criterion 1.5. 2018-07-02 23:29:37 +02:00
John MacFarlane
ce83a128e1 Use ghc 8.4.2 in travis and tested-with.
8.4.1 shipped with the wrong version of mtl, which didn't
match its documented API.
2018-06-30 10:00:28 +02: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
John MacFarlane
39dc3b9a4b Require yaml < 0.8.31 for ghc < 8.0.2.
The 0.8.31 release of yaml adds a constraint to ghc versions 8.0.2
and greater.
2018-06-29 20:09:08 +02:00
John MacFarlane
06bcb7c872 Remove network-uri flag and use 'Network.Socket'.
This removes a compiler warning.
There is no need for the old network-uri flag, since
network 2.6 was released in 2014.
2018-06-28 11:51:52 +02:00
Sergei Trofimovich
dda3882348 pandoc.cabal: fix lower yaml bound up to 0.8.11 (#4727)
`prettyPrintParseException` was added to yaml-0.8.11.

Reported-by: Tom Gillespie
Bug: https://github.com/jgm/pandoc/issues/4726
Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/725
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2018-06-24 13:09:07 +02:00
John MacFarlane
adbaaeaf9b Raise lower bound for yaml library.
Closes #4726.
2018-06-23 10:46:02 +02:00
John MacFarlane
8b4728e284 Use latest pandoc-types (1.17.5). 2018-06-11 11:05:48 -07:00
John MacFarlane
158344d26d Allow aeson-1.4. 2018-06-10 10:24:12 -07:00
John MacFarlane
edcfbccf5d Use skylighting 0.7.2. Adjust tests.
This should fix commercialhaskell/stackage#3719, once
a new release is made.
2018-06-09 13:34:21 -07:00
Felix Yan
cf2d695061 Allow tasty 1.1 (#4685)
All tests pass with tasty 1.1.0.1 here.
2018-06-03 13:59:47 -07:00
John MacFarlane
d32e866449 LaTeX reader: handle includes without surrounding blanklines.
In addition, `\input` can now be used in an inline context,
e.g. to provide part of a paragraph, as it can in LaTeX.

Closes #4553.
2018-06-01 09:25:10 -07:00
John MacFarlane
3181023ca1 Add version bound in custom-setup for Cabal. 2018-05-30 15:12:42 -07:00
John MacFarlane
1e4255ced6 Require cabal-version >= 2.0. This is needed for haddock-library. 2018-05-30 13:16:16 -07:00
John MacFarlane
aff401745c Revert "ALlow compilation with haddock-library 1.4 and above."
This reverts commit 50c71b5bc5.

This was a bad idea, since tests depend on recent haddock-library.
We'd be able to build but fail tests.
2018-05-30 13:13:57 -07:00
John MacFarlane
50c71b5bc5 ALlow compilation with haddock-library 1.4 and above.
haddock-library-1.6 requires Cabal >= 2.0.  This change allows
systems with older Cabal versions to build pandoc.
2018-05-30 13:06:44 -07:00
John MacFarlane
81ed7948da Use haddock-library 1.6.0. 2018-05-20 17:05:23 -07:00
John MacFarlane
933aa3ee84 Require texmath >= 0.11.
Although pandoc compiles with 0.10, the tests assume texmath 0.11.

Closes #4651.
2018-05-14 10:07:13 -07:00
Yan Pas
b0b41cbbe6 Merge branch 'master' into groff_reader 2018-05-12 11:42:39 +03:00
John MacFarlane
ebb60075f5 Bump version to 2.2.1. 2018-05-10 21:45:29 -07:00
John MacFarlane
c3d2572c5f Use texmath-0.11. 2018-05-10 12:10:35 -07:00
Yan Pashkovsky
a337685fe0
Merge branch 'master' into groff_reader 2018-05-09 19:48:34 +03:00
John MacFarlane
1494b20bb4 Document FB2 reader. 2018-04-26 12:35:02 -07:00
Alexander
1927bc9aac Add FB2 reader (#4539) 2018-04-26 12:33:18 -07:00
John MacFarlane
16f36eee43 Removed deprecated ancient HTML math methods.
Removed `--latexmathml`, `--gladtex`, `--mimetex`, `--jsmath`, `-m`,
`--asciimathml` options.

Removed `JsMath`, `LaTeXMathML`, and `GladTeX` constructors from
`Text.Pandoc.Options.HTMLMathMethod` [API change].

Removed unneeded data file LaTeXMathML.js and updated tests.

Bumped version to 2.2.
2018-04-25 17:18:56 -07:00
Jesse Rosenthal
bb428df32b Powerpoint writer: Remove docProps/thumbnail.jpeg in data dir.
This file wasn't used in the production of documents. It's supposed to
be a thumbnail of the current document, and we can't actually produce
that ourselves. It turns out that the file contains a nonfree ICC
color calibration file, so the best thing to do would be to remove it
altogether.

Fixes: #4588
2018-04-24 16:00:15 -04:00
Francesco Occhipinti
9465e5e048 use the -threaded GHC flag when building benchmarks, related to #4130 (#4587) 2018-04-24 12:31:03 -07:00
John MacFarlane
c3d0cc9b8e Bump to 2.1.4. 2018-04-11 17:24:19 -07:00
John MacFarlane
dd4e8c4a7a Bump temporary upper bound to 1.4. 2018-04-11 09:45:17 -07:00
John MacFarlane
9dac007228 Make 'weigh-pandoc' into a benchmark program.
Remove 'weigh-pandoc' flag.  This is now built (and run)
automatically when you build (and run) benchmarks.
2018-03-18 11:52:40 -07:00
John MacFarlane
937bec95a9 Removed old-locale flag and Text.Pandoc.Compat.Time.
This is no longer necessary since we no longer support ghc 7.8.
2018-03-18 11:24:29 -07:00
John MacFarlane
daf731a001 pandoc.cabal: fix up other-extensions and language fields.
language is now consistently Haskell2010, and other-extensions
is consistently NoImplicitPrelude. Everything else to be specified
in the module header as needed.
2018-03-18 10:45:32 -07:00
John MacFarlane
82ff503210 Fix what was missing in last commit. 2018-03-18 09:47:38 -07:00
John MacFarlane
dd53545154 New approach to custom Prelude.
We use no custom Prelude with the latest ghc version (8.4.1),
so we don't have problems with ghci.

See https://ghc.haskell.org/trac/ghc/ticket/10920
https://www.reddit.com/r/haskell/comments/3ryf2p/how_can_you_use_a_custom_prelude_with_ghci/

This may help with #4464.
2018-03-18 09:20:21 -07:00
John MacFarlane
59903ec82c Bump to 2.1.3, update changelog. 2018-03-17 19:00:20 -07:00
John MacFarlane
afb72f1857 Add semigroups dependency to executables...
since custom prelude depends on it.
2018-03-17 17:10:02 -07:00
John MacFarlane
fad8d0d67f Allow earlier versions of haddock-library, use CPP. 2018-03-16 23:18:42 -07:00
John MacFarlane
c166861ee6 Require haddock-libary 1.5 (with tables). 2018-03-16 21:21:41 -07:00
John MacFarlane
424d0df1f2 Use latest pandoc-types. 2018-03-16 21:20:52 -07:00
John MacFarlane
e21b57991e Added custom prelude.
We need this again because of Monoid/Semigroup.
2018-03-16 10:21:54 -07:00
John MacFarlane
bc2f4422b2 License to GPL-2 instead of GPL.
New cabal new-build seems to choke on GPL, even though it's
supposed to be legal.
2018-03-16 08:41:26 -07:00
John MacFarlane
1ac56f99df Bump upper-bound for time, criterion, haddock-library, exceptions. 2018-03-15 23:48:19 -07:00
John MacFarlane
1b37e3b3c0 Require pandoc-types 1.17.4.
And a few tweaks related to the Semigroups/Monoid change.

Closes #4448.
2018-03-13 23:23:04 -07:00
John MacFarlane
2f979e0684 BUmp upper bound for http-types. 2018-03-11 18:01:57 -07:00
John MacFarlane
0e45cc1297 Bump aeson upper bound. 2018-03-07 13:18:09 -08:00
Chris Martin
b16d36397d pandoc.cabal: link to https version of the website (#4433) 2018-03-07 09:37:53 -08:00
Felix Yan
475f46fa7c Allow tasty-quickcheck 0.10 (#4429)
Tests pass with the new test tool.
2018-03-05 09:35:16 -08:00
John MacFarlane
7518e8e00e Allow skylighting 0.7.x. 2018-03-04 12:08:11 -08:00
John MacFarlane
554e9b80bd Bump version to 2.1.2. 2018-03-02 10:54:03 -08:00
Alexander Krotov
83ce0a789d Update tagsoup to 0.14.6 2018-02-28 07:00:14 +03:00
Albert Krewinkel
3560603f10
Set fixed minor version for hslua
The ToLuaStack instance for Set is orphaned. The PVP requires the minor
version to be fixed in this case.
2018-02-27 19:36:52 +01:00
Alexander Krotov
ab1bee58e5 Update tagsoup to 0.14.5 2018-02-27 15:02:59 +03:00
Alexander Krotov
19b4cb16f3 Update tagsoup to 0.14.4
Fixes #4282
2018-02-27 04:31:46 +03:00
Albert Krewinkel
6ed7926bb4
Org reader tests: move citation tests to separate module 2018-02-26 21:18:13 +01:00
John MacFarlane
bbca6f223f Allow exceptions 0.9. 2018-02-26 09:16:59 -08:00
John MacFarlane
6baebcbe86 Removed ghc-prof-options.
As of cabal 1.24, sensible defaults are used.
See
https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-ghc-prof-options.
2018-02-25 23:43:01 -08:00
Yan Pas
fd3676a568 initial 2018-02-25 03:34:17 +03:00
John MacFarlane
6b388971ea Require aeson-pretty 0.8.5. Closes #4394.
`confTrailingNewline` is introduced in this version.
2018-02-22 22:23:11 -08:00
Jesse Rosenthal
574104861f Powerpoint writer: Another attempt at avoiding compiler warnings. 2018-02-18 18:54:16 -05:00
Jesse Rosenthal
6c6ac9f22e Powerpoint writer: Move notes slides into data tree. 2018-02-18 16:31:32 -05:00
John MacFarlane
c501942866 Bump blaze-markup, blaze-html lower bounds to 0.8, 0.9.
This is needed because the type constructor Empty in MarkupM
has changed, and the HTML writer assumes the constructor has
an argument.

Closes #4334.
2018-02-01 10:08:53 -08:00
Jesse Rosenthal
a66bfd9071 Add docx golden tests to cabal file. 2018-01-27 08:09:01 -05:00
Jesse Rosenthal
61f80e795d Tests: Abstract powerpoint tests out to OOXML tests.
There is very little pptx-specific in these tests, so we abstract out
the basic testing function so it can be used for docx as well. This
should allow us to catch some errors in the docx writer that slipped
by the roundtrip testing.
2018-01-25 15:29:50 -05:00
John MacFarlane
4423f81079 Require tagsoup 0.14.3 - closes #4282.
This fixes an HTML tokenization bug whereby comments
were sometimes consumed with open tags.
2018-01-21 10:09:27 -08:00
Jesse Rosenthal
54526525bf Powerpoint writer tests: New test framework for pptx.
Previously we had tested certain properties of the output PowerPoint
slides. Corruption, though, comes as the result of a numebr of
interrelated issues in the output pptx archive. This is a new
approach, which compares the output of the Powerpoint writer with
files that we know to (a) not be corrupt, and (b) to show the desired
output behavior (details below). This commit introduces three tests
using the new framework. More will follow.

The test procedure: given a native file and a pptx file, we generate a
pptx archive from the native file, and then test:

1. Whether the same files are in the two archives

2. Whether each of the contained xml files is the same. (We skip time
   entries in `docProps/core.xml`, since these are derived from IO. We
   just check to make sure that they're there in the same way in both
   files.)

3. Whether each of the media files is the same.

Note that steps 2 and 3, though they compare multiple files, are one
test each, since the number of files depends on the input file (if
there is a failure, it will only report the first failed file
comparison in the test failure).
2018-01-21 12:15:35 -05:00
John MacFarlane
63b10cf157 More stack.yaml fixes for skylighting. 2018-01-18 10:05:41 -08:00
John MacFarlane
e04d648594 Require latest skylighting. 2018-01-18 09:27:00 -08:00
John MacFarlane
1bc2186425 Version to 2.1.1. 2018-01-17 10:21:02 -08:00
Jesse Rosenthal
ae8c0cdba8 Docx reader: Parse instrText info in fldChar tags.
We introduce a new module, Text.Pandoc.Readers.Docx.Fields which
contains a simple parsec parser. At the moment, only simple hyperlink
fields are accepted, but that can be extended in the future.
2018-01-16 13:22:02 -05:00
John MacFarlane
4b7bc40e8b Renaming: Json -> JSON in modules and functions. 2018-01-15 10:46:40 -08:00
John MacFarlane
f114153481
Merge pull request #4227 from tarleb/lua-run-json-filter
Run JSON filters from Lua filters
2018-01-15 11:43:46 -07:00
John MacFarlane
0e16155aaf Remove custom prelude and ghc 7.8 support. 2018-01-14 23:31:49 -08:00
John MacFarlane
2cd5b55d51 Fix cabal to use base-compat with ghc < 7.10. 2018-01-14 22:50:46 -08:00
John MacFarlane
2c00540485 Use base-compat for our custom prelude.
This should give us more complete coverage of newer
base features.

See #4255.
2018-01-14 18:34:26 -08:00
John MacFarlane
cd80b8d76f Allow latest QuickCheck. 2018-01-14 12:24:21 -08:00
Jesse Rosenthal
431f6166fa Powerpoint writer: Refactor into separate modules.
There are two steps in the conversion: a conversion from pandoc to a
Presentation datatype modeling pptx, and a conversion from
Presentation to a pptx archive. The two steps were sharing the same
state and environment, and the code was getting a bit
spaghetti-ish. This separates the conversion into separate
modules (T.P.W.Powerpoint.Presentation, which defineds the
Presentation datatype and goes Pandoc->Presentation)
and (T.P.W.Pandoc.Output, which goes Presentation->Archive).
Text.Pandoc.Writers.Powerpoint a thin wrapper around the two modules.
2018-01-14 09:39:39 -05:00
Albert Krewinkel
5d49cbd35e
Move filter functions to separate module 2018-01-13 00:05:11 +01:00
Albert Krewinkel
6528082401
Lua filters: improve error messages
Provide more context about the task which caused an error.
2018-01-12 21:28:27 +01:00
John MacFarlane
87e16563f4 Bump criterion upper bound. 2018-01-09 14:58:51 -08:00
John MacFarlane
1d8f2edff0 Allow tasty 1.0. 2018-01-08 17:08:46 -08:00
John MacFarlane
ae6ba1533b Use latest skylighting and omit the 'missingincludes' check.
If you use a custom syntax definition that refers to a syntax
you haven't loaded, pandoc will now complain when it is highlighting
the text, rather than at the start.

This saves a huge performance hit from the `missingIncludes` check.

Closes #4226.
2018-01-07 19:24:08 -08:00
Albert Krewinkel
0d935bd081
Update copyright notices to include 2018 2018-01-05 20:39:12 +01:00
Albert Krewinkel
bdb911550c
Bump hslua version to 0.9.5
This version fixes a bug that made it difficult to handle failures while
getting lists or a Map from Lua. A bug in pandoc, which made it
necessary to always pass a tag when using MetaList or MetaBlock, is
fixed as a result. Using the pandoc module's constructor functions for
these values is now optional (if still recommended).
2018-01-04 23:15:28 +01:00
Jesse Rosenthal
76442a791c Powerpoint Writer tests: Add quickcheck tests for content types.
We want to make sure we always have an override for each xml file in
the content types file.
2017-12-29 10:43:36 -05:00
John MacFarlane
8b575dbf84 Filter changes.
* Previously we ran all lua filters before JSON filters.
* Now we run filters in the order they are presented on the
  command line, whether lua or JSON.
* The type of `applyFilters` has changed (incompatible API change).
* `applyLuaFilters` has been removed (incompatible API change).
* Bump version to 2.1.

See #4196.
2017-12-28 16:39:52 -08:00
John MacFarlane
3494b6efd3 Powerpoint writer tests: use IO.
Otherwise we can't find the data files when compiled
with -embed_data_files.
2017-12-28 12:06:38 -08:00
John MacFarlane
d5770b7496 Moved makeCanoncial definition out of ifdef!
Also added slide2 to the default pptx, and reordered
the data files in pandoc.cabal.
2017-12-28 11:03:53 -08:00
John MacFarlane
51b7fe85a8 Added data/docx/word/comments.xml to pandoc.cabal data files. 2017-12-28 10:31:37 -08:00
Jesse Rosenthal
c1fbf7257b PowerPoint writer: Introduce beginning of tests
This is the beginning of a test suite for the powerpoint
writer. Initial tests are for the number of slides.

Note that at the moment it does not test against corruption in
Microsoft PowerPoint; it just tests that certain outcomes work as
expected. More tests will be added.

This test framework uses the PandocPure monad introduced with Pandoc 2.0.
2017-12-28 10:51:03 -05:00
Albert Krewinkel
e5c8b65004
Org reader: support minlevel option for includes
The level of headers in included files can be shifted to a higher level
by specifying a minimum header level via the `:minlevel` parameter. E.g.
`#+include: "tour.org" :minlevel 1` will shift the headers in tour.org
such that the topmost headers become level 1 headers.

Fixes: #4154
2017-12-28 14:16:04 +01:00
Albert Krewinkel
2d443ecb07
Break-up org reader test file
The org reader test file had grown large, to the point that editor
performance was negatively affected in some cases. The tests are spread
over multiple submodules, and re-combined into a tasty TestTree in the
main org reader test file.
2017-12-28 14:15:58 +01:00
John MacFarlane
1ce426a9cb Add custom tests to pandoc.cabal 2017-12-27 10:48:19 -08:00
John MacFarlane
2af478c3b5 Bump to 2.0.6. 2017-12-23 23:20:33 -08:00
John MacFarlane
a848d3e031 Mention JATS output (and input) in MANUAL, README, cabal description. 2017-12-21 22:20:38 -08:00
John MacFarlane
af04881655
Merge pull request #4177 from stencila/jats-xml-reader
Add Basic JATS reader based on DocBook reader
2017-12-21 23:16:03 -07:00
Albert Krewinkel
bd3ea72371
Lua modules: added pandoc.utils module
A new module `pandoc.utils` has been created. It holds utility functions
like `sha1`, which was moved from the main `pandoc` module.
2017-12-21 22:42:59 +01:00
Albert Krewinkel
5ad719c1fb
Lua modules: make a Haskell module for each Lua module
Definitions for the `pandoc.mediabag` modules are moved to a separate
Haskell module.

Change: minor
2017-12-21 22:42:59 +01:00
Albert Krewinkel
ab3c506584
Lua modules: move to dedicated submodule
The Haskell module defining the Lua `pandoc` module is moved to
Text.Pandoc.Lua.Module.Pandoc.

Change: minor
2017-12-21 22:42:59 +01:00
John MacFarlane
117a672c4d Removed default.theme data file.
It is no longer needed now that we have `--print-highlight-style`.
See #4096.
2017-12-21 11:28:38 -08:00
Hamish Mackenzie
5d3c9e5646 Add Basic JATS reader based on DocBook reader 2017-12-20 13:54:02 +13:00
John MacFarlane
3361f85f8e
Merge pull request #4148 from stencila/jats-figures
fig, table-wrap & caption Divs for JATS writer
2017-12-14 13:45:23 -07:00
Albert Krewinkel
4c64af4407
Custom writer: use init file to setup Lua interpreter
The same init file (`data/init`) that is used to setup the Lua
interpreter for Lua filters is also used to setup the interpreter of
custom writers.lua.
2017-12-13 21:15:41 +01:00
Hamish Mackenzie
ec1693505c fig, table-wrap & caption Divs for JATS writer
Support writing <fig> and <table-wrap> elements with <title> and
<caption> inside them by using Divs with class set to on of
fig, table-wrap or cation.  The title is included as a Heading
so the constraint on where Heading can occur is also relaxed.

Also leaves out empty alt attributes on links.
2017-12-13 12:06:22 +13:00
John MacFarlane
4e457868fa Change version to 2.0.5.
Note that we don't need to bump the second number
for an additional module and exported function.
2017-12-11 22:38:38 -08:00
John MacFarlane
a23c93aa74 Version to 2.1 2017-12-11 21:46:40 -08:00
John MacFarlane
7f56d08443 Update cabal description to include powerpoint. 2017-12-11 21:42:59 -08:00
Jesse Rosenthal
b212a51062 Integrate Powerpoint writer into pandoc. 2017-12-11 07:00:17 -05:00
John MacFarlane
5e039d913f Changes for skylighting-0.5.
This fixes a bug in 2.0.4, whereby pandoc could not
read the theme files generated with `--print-highlight-style`.

It also fixes some CSS issues involving line numbers.
Highlighted code blocks are now enclosed in a div with class
sourceCode.

Highlighting CSS no longer sets a generic color for pre
and code; we only set these for class `sourceCode`.

This will close #4133 and #4128.
2017-12-10 21:13:05 -08:00
John MacFarlane
04f08c39ef Add '-threaded' to ghc-options for executable. 2017-12-07 15:25:37 -08:00
Albert Krewinkel
4066a385ac
Lua filters: use script to initialize the interpreter
The file `init.lua` is used to initialize the Lua interpreter which is
used in Lua filters. This gives users the option to require libraries
which they want to use in all of their filters, and to extend default
modules.
2017-12-06 22:50:56 +01:00
Albert Krewinkel
d5b1c7b767
Lua filters: refactor lua module handling
The integration with Lua's package/module system is improved: A
pandoc-specific package searcher is prepended to the searchers in
`package.searchers`. The modules `pandoc` and `pandoc.mediabag` can now
be loaded via `require`.
2017-12-02 23:07:29 +01:00
Albert Krewinkel
a7953a60b9
Bump lower bound of hslua
The release hslua 0.9.3 contains a new function which makes using
Haskell functions as package loaders much easier.
2017-12-04 13:34:10 +01:00
John MacFarlane
b480d0da7a Bump bounds for binary, http-types, tasty-hunit 2017-12-02 23:24:19 -08:00
John MacFarlane
e09e6a6ffa Bump to 2.0.4, update changelog. 2017-12-02 11:17:22 -08:00
John MacFarlane
78982d0581 Update tested-with. 2017-12-02 10:56:56 -08:00
John MacFarlane
7a8c830734 Use latest tagsoup.
This fixes a bug in parsing tags with `&` following.

Closes #4094.  Closes #4088.
2017-11-30 15:59:06 -08:00
Albert Krewinkel
0105a3c293 Add basic lua List module (#4099)
The List module is automatically loaded, but not assigned to a global
variable. It can be included in filters by calling `List = require
'List'`.

Lists of blocks, lists of inlines, and lists of classes are now given
`List` as a metatable, making working with them more convenient. E.g.,
it is now possible to concatenate lists of inlines using Lua's
concatenation operator `..` (requires at least one of the operants to
have `List` as a metatable):

    function Emph (emph)
      local s = {pandoc.Space(), pandoc.Str 'emphasized'}
      return pandoc.Span(emph.content .. s)
    end

Closes: #4081
2017-11-28 17:20:01 -07:00
John MacFarlane
073bcae16c Use skylighting 0.4.4.1.
Closes #4103 (wrong color of unmarked code text when
numerLines is used).
2017-11-27 23:29:19 -08:00
John MacFarlane
51027cff29 Use skylighting 0.4.4. 2017-11-21 20:47:00 -08:00
Justus Sagemüller
185918ea3d Relax http-types dependency. (#4084) 2017-11-21 09:00:30 -08:00
John MacFarlane
f1ea3d6ee6 Version to 2.0.3. 2017-11-20 16:17:03 -08:00
Albert Krewinkel
53aafd6643 Lua filters: preload text module (#4077)
The `text` module is preloaded in lua. The module contains some UTF-8
aware string functions, implemented in Haskell.  The module is loaded on
request only, e.g.:

    text = require 'text'
    function Str (s)
      s.text = text.upper(s.text)
      return s
    end
2017-11-18 13:24:06 -08:00
John MacFarlane
931a1c47c5 Require latest pandoc-types. 2017-11-11 16:26:25 -08:00
John MacFarlane
1c901057bb Bump to 2.0.2. 2017-11-11 15:28:34 -08:00
John MacFarlane
6b75d6e08c Use lua filter to generate man page from MANUAL.
Instead of three Haskell filters.

This is easier and faster.
2017-11-11 15:26:24 -08:00
John MacFarlane
6174b5bea5 Add lua filter functions to walk inline and block elements.
Refactored some code from Text.Pandoc.Lua.PandocModule
into new internal module Text.Pandoc.Lua.Filter.

Add `walk_inline` and `walk_block` in pandoc lua module.
2017-11-11 14:41:11 -08:00
John MacFarlane
32d95aa9f6 Use skylighting 0.4.3.2. 2017-11-04 22:01:03 -07:00
John MacFarlane
f14013bce3 Bump to 2.0.1.1. 2017-11-04 15:51:23 -07:00
John MacFarlane
25f24af068 Use texmath 0.10. 2017-11-03 23:26:37 -07:00
John MacFarlane
d0548fe29c Use latest skylighting. 2017-11-03 11:29:15 -07:00
John MacFarlane
856587ff63 Use latest skylighting; ensure no duplicate ids on code lines.
The line identifiers are built using the code block's identifier
as a prefix. If the code block has null identifier, we use
"cb1", "cb2", etc.

Closes #4031.
2017-11-02 16:03:40 -07:00
John MacFarlane
5df272254d Bump tasty upper bound. 2017-11-02 11:22:19 -07:00
John MacFarlane
1f393f1a8b
Merge pull request #4001 from labdsf/fb2-tests
Add new style FB2 tests
2017-11-01 00:37:29 -04:00
John MacFarlane
8e55bdcaa3 Version to 2.0.1. 2017-10-31 21:28:43 -07:00
John MacFarlane
685e952dc6 Bump to 2.0.0.1. 2017-10-30 22:00:57 -07:00
John MacFarlane
e45f2d1e9f Added creole reader test files to pandoc.cabal. 2017-10-29 14:01:39 -07:00
Alexander Krotov
d99776ea04 Add new style FB2 tests 2017-10-28 21:08:48 +03:00
John MacFarlane
dd1785342a Removed unnecessary build-deps. 2017-10-27 21:38:59 -07:00
Kolen Cheung
3f0ceaf6ee Use CamelCase for JavaScript for uniformity
other instances when javascript is refered to in pandoc is also in CamelCase, the official casing of JavaScript.
2017-10-26 22:43:19 -07:00
John MacFarlane
7d60e9e0eb Bring MANUAL, README, and pandoc.cabal description in sync. 2017-10-26 16:30:37 -07:00
Sascha Wilde
66fd3247ea Creole reader (#3994)
This is feature complete but not very thoroughly tested yet.
2017-10-26 19:19:28 -04:00
John MacFarlane
76886678a6 Use skylighting 0.4.2.
This prevents the problem with extra space around highlighted
code blocks (closes #3996).

Note that we no longer put an enclosing div around highlighted
code blocks.  The pre is the outer element, just as for unhighlighted
blocks.
2017-10-26 15:57:55 -07:00
John MacFarlane
a27dc79073 Updated Glob upper bound. 2017-10-23 11:20:31 -07:00
John MacFarlane
dc92c34827 Use doctemplates 0.2.1: allows $-- line comments in templates.
Closes #3806.
2017-10-20 22:44:49 -07:00
John MacFarlane
181d7370bb Export Text.Pandoc.BCP47 2017-10-17 22:21:32 -07:00
John MacFarlane
99c1481c12 Split list of authors from MANUAL.txt into separate file, AUTHORS.md.
It was getting too long for a man page.
2017-10-17 20:30:20 -07:00
John MacFarlane
c40857b389 Improved handling of include files in LaTeX reader.
Previously `\include` wouldn't work if the included file
contained, e.g., a begin without a matching end.

We've changed the Tok type so that it stores a full SourcePos,
rather than just a line and column.  So tokens keeep track
of the file they came from. This allows us to use a simpler
method for includes, which doesn't require parsing the included
document as a whole.

Closes #3971.
2017-10-16 22:05:34 -07:00
John MacFarlane
2f66d57616 Remove openURL from Shared (API change).
Now all the guts of openURL have been put into openURL from
Class.  openURL is now sensitive to stRequestHeaders in CommonState
and will add these custom headers when making a request.
It no longer looks at the USER_AGENT environment variable,
since you can now set the `User-Agent` header directly.
2017-10-15 22:11:38 -07:00
Albert Krewinkel
2262f005ce
Use hslua v0.9.0 2017-10-05 11:30:44 +02:00
John MacFarlane
fc25e3a5b7 Added ghc 8.2.1 to tested-with stanza. 2017-09-24 13:12:41 -07:00
John MacFarlane
1d6e651e5a Require pandoc-types 1.17.2. 2017-09-24 12:04:15 -07:00
John MacFarlane
04aba6bd51 Use skylighting 0.4. 2017-09-15 09:36:54 -07:00
John MacFarlane
64472a468c FromJSON/ToJSON instances for Reader, WriterOptions.
Depends on skylighting 0.3.5.
2017-09-14 22:38:23 -07:00
John MacFarlane
cbdeed9cfd Require skylighting 0.3.4.1 or higher. 2017-09-09 21:06:07 -07:00
John MacFarlane
3421f3eac7 Removed old beamer template.
We now use the default.latex template for both latex and beamer.
It contains conditionals for the beamer-specific things.

`pandoc -D beamer` will return this template.
2017-09-08 10:48:02 -07:00
John MacFarlane
de93744179 cabal: add custom-setup stanza, lowercase field names. 2017-09-07 10:13:40 -07:00
John MacFarlane
aa90919fe9 Add 'static' Cabal flag, use it for linux statically linked. 2017-09-04 17:07:20 -07:00
John MacFarlane
8fcf66453c RST reader: Fixed ..include:: directive.
Closes #3880.
2017-08-27 17:09:55 -07:00
John MacFarlane
d70b89c0d9 Use pandoc-types 1.17.1. Tests updated for new simpleTable behavior...
with empty headers.
2017-08-20 23:24:51 -07:00
John MacFarlane
b1f6fb4af5 HTML reader: support column alignments.
These can be set either with a `width` attribute or
with `text-width` in a `style` attribute.

Closes #1881.
2017-08-17 12:08:32 -07:00
Albert Krewinkel
9b31835530 Update to hslua-0.8.0
hslua no longer provides lua stack instances for Int and Double, the
necessary instances are added to the Custom writer and the lua filtering
system.
2017-08-16 15:47:05 +02:00
John MacFarlane
319d7ed6ff Changed command test for #2994 so it actually tests the writer. 2017-08-14 00:00:50 -07:00
Albert Krewinkel
3d87e2080a
Delete Text.Pandoc.Lua.SharedInstances
Stack instances for common data types are now provides by hslua. The
instance for Either was useful only for a very specific case; the
function that was using the `ToLuaStack Either` instance was rewritten
to work without it.

Closes: #3805
2017-08-13 17:48:43 +02:00
Albert Krewinkel
2dc3dbd68b Use hslua >= 0.7, update Lua code 2017-08-13 14:23:54 +02:00
John MacFarlane
418bda8128 Docx writer: pass through comments.
We assume that comments are defined as parsed by the
docx reader:

    I want <span class="comment-start" id="0" author="Jesse Rosenthal"
    date="2016-05-09T16:13:00Z">I left a comment.</span>some text to
    have a comment <span class="comment-end" id="0"></span>on it.

We assume also that the id attributes are unique and properly
matched between comment-start and comment-end.

Closes #2994.
2017-08-12 22:59:53 -07:00
John MacFarlane
622c3f2fa6 Change to yaml for translation files. 2017-08-12 12:17:38 -07:00
John MacFarlane
74212eb1b0 Added support for translations (localization) (see #3559).
* readDataFile, readDefaultDataFile, getReferenceDocx,
  getReferenceODT have been removed from Shared and
  moved into Class.  They are now defined in terms of
  PandocMonad primitives, rather than being primitve
  methods of the class.

* toLang has been moved from BCP47 to Class.

* NoTranslation and CouldNotLoudTranslations have
  been added to LogMessage.

* New module, Text.Pandoc.Translations, exporting
  Term, Translations, readTranslations.

* New functions in Class: translateTerm, setTranslations.
  Note that nothing is loaded from data files until
  translateTerm is used; setTranslation just sets the
  language to be used.

* Added two translation data files in data/translations.

* LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage`
  (polyglossia) and `\figurename`.
2017-08-11 22:22:31 -07:00
John MacFarlane
ed4f6b348a Added data file to pandoc.cabal. 2017-08-10 18:26:06 -07:00
John MacFarlane
a5790dd308 RST reader: Basic support for csv-table directive.
* Added Text.Pandoc.CSV, simple CSV parser.
* Options still not supported, and we need tests.

See #3533.
2017-08-10 11:12:41 -07:00
John MacFarlane
14a44f53c8 Build config that works with lts-9.0 and nightly. 2017-08-09 12:14:35 -07:00
John MacFarlane
6e7ef6fbfc Don't put fancy warnings in pandoc.cabal ghc-options. 2017-08-08 22:44:47 -07:00
John MacFarlane
2f0bff0f54 Use extra ghc warnings.
In addition to `-Wall`:
 `-Wincomplete-uni-patterns -Wincomplete-record-updates -Wredundant-constraints -Wcompat -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances`
2017-08-08 20:29:37 -07:00
John MacFarlane
91c989d622 Remove GFM modules; use CMarkGFM for both gfm and commonmark.
We no longer have a separate readGFM and writeGFM;
instead, we'll use readCommonMark and writeCommonMark
with githubExtensions.

It remains to implement these extensions conditionally.

Closes #3841.
2017-08-07 23:11:14 -07:00
John MacFarlane
2c81c4c218 Added gfm (GitHub-flavored CommonMark) as an input and output format.
This uses bindings to GitHub's fork of cmark, so it should parse
gfm exactly as GitHub does (excepting certain postprocessing
steps, involving notifications, emojis, etc.).

* Added Text.Pandoc.Readers.GFM (exporting readGFM)
* Added Text.Pandoc.Writers.GFM (exporting writeGFM)
* Added `gfm` as input and output forma

Note that tables are currently always rendered as HTML
in the writer; this can be improved when CMarkGFM supports
tables in output.
2017-08-07 16:59:31 -07:00
rlpowell
2ae75e23dd Added TikiWiki reader (#3800)
Added TikiWiki reader, including tests and documentation.

It's probably not *complete*, but it works pretty well, handles all
the basics (and some not-so-basics).
2017-07-21 10:09:54 +02:00
John MacFarlane
3a36441b61 Use foldrWithKey instead of deprecated foldWithKey. 2017-07-13 23:37:21 +02:00
John MacFarlane
0feb7504b1 Rewrote LaTeX reader with proper tokenization.
This rewrite is primarily motivated by the need to
get macros working properly.  A side benefit is that the
reader is significantly faster (27s -> 19s in one
benchmark, and there is a lot of room for further
optimization).

We now tokenize the input text, then parse the token stream.

Macros modify the token stream, so they should now be effective
in any context, including math. Thus, we no longer need the clunky
macro processing capacities of texmath.

A custom state LaTeXState is used instead of ParserState.
This, plus the tokenization, will require some rewriting
of the exported functions rawLaTeXInline, inlineCommand,
rawLaTeXBlock.

* Added Text.Pandoc.Readers.LaTeX.Types (new exported module).
  Exports Macro, Tok, TokType, Line, Column.  [API change]
* Text.Pandoc.Parsing: adjusted type of `insertIncludedFile`
  so it can be used with token parser.
* Removed old texmath macro stuff from Parsing.
  Use Macro from Text.Pandoc.Readers.LaTeX.Types instead.
* Removed texmath macro material from Markdown reader.
* Changed types for Text.Pandoc.Readers.LaTeX's
  rawLaTeXInline and rawLaTeXBlock.  (Both now return a String,
  and they are polymorphic in state.)
* Added orgMacros field to OrgState.  [API change]
* Removed readerApplyMacros from ReaderOptions.
  Now we just check the `latex_macros` reader extension.
* Allow `\newcommand\foo{blah}` without braces.

Fixes #1390.
Fixes #2118.
Fixes #3236.
Fixes #3779.
Fixes #934.
Fixes #982.
2017-07-07 12:36:00 +02:00
John MacFarlane
69388d52e3 Use latest texmath. 2017-06-30 20:39:53 +02:00
John MacFarlane
ac9423eccc Moved BCP47 specific functions from Writers.Shared to new module.
Text.Pandoc.BCP47 (unexported, internal module).
`getLang`, `Lang(..)`, `parseBCP47`.
2017-06-25 21:00:35 +02:00
John MacFarlane
9ac0a99292 Added mention of vimwiki raeder more places. 2017-06-20 16:57:39 +02:00
Yuchen Pei
564c77964d Added Vimwiki reader (#3705).
* New module Text.Pandoc.Readers.Vimwiki, exporting readVimwiki [API change].
* New input format `vimwiki`.
* New data file, `data/vimwiki.css`, for displaying the HTML produced by this reader and pandoc's HTML writer in the style of vimwiki's own HTML export.
2017-06-19 22:15:12 +02:00
John MacFarlane
aface549a0 Mention muse reader in README, MANUAL, debian control, cabal description. 2017-06-19 10:50:59 +02:00
Alexander Krotov
a91b9b2a1d Add Muse reader (#3620) 2017-06-19 10:46:02 +02:00
John MacFarlane
6166655b52 Allow QuickCheck 2.10 2017-06-17 23:58:12 +02:00
Bartosz Nitka
ec01d26a1b Relax time and process in preparation for GHC 8.2 (#3739)
GHC 8.2 is very likely to ship with process-1.6.0.0
and time-1.8.0.1.

Consult:
https://ghc.haskell.org/trac/ghc/wiki/Commentary/Libraries/VersionHistory
2017-06-17 23:48:01 +02:00
John MacFarlane
25bfa26554 Fixed weigh-pandoc for Text readers. 2017-06-10 21:10:52 +02:00
John MacFarlane
f43504f9f4 Fixed benchmark to work with Text readers. 2017-06-10 20:57:38 +02:00
John MacFarlane
610f1706b6 Remove cpphs build requirement -- it is no longer needed.
It was required when we used hsb2hs but no longer seemes
needed with file-embed.
2017-06-04 21:01:34 +02:00
John MacFarlane
afb551429b Update criterion upper bound. 2017-05-28 12:35:50 +02:00
Marc Schreiber
03cb05f4c6 Improve SVG image size code.
The old code made some unwise assumptions about
how the svg file would look.

See #3580.
2017-05-20 23:09:08 +02:00
Albert Krewinkel
a27e2e8a4e
Org reader: put tree parsing code into dedicated module 2017-05-16 22:42:34 +02:00
Albert Krewinkel
af4bf91c59
Org reader: add basic file inclusion mechanism
Support for the `#+INCLUDE:` file inclusion mechanism was added.
Recognized include types are *example*, *export*, *src*, and normal org
file inclusion.  Advanced features like line numbers and level selection
are not implemented yet.

Closes: #3510
2017-05-14 12:45:31 +02:00
John MacFarlane
d414b2543a Remove https flag.
Supporting two completely different libraries for fetching
from URLs makes it difficult to trap errors, because of
different error types expected from the libraries.

There's no clear reason not to build with these https-capable
libraires.
2017-05-07 12:49:25 +02:00
Albert Krewinkel
c2567b2bd0 API change: move writer functions to Text.Pandoc.Writers
Writer helper functions were defined in the top-level Text.Pandoc
module. These functions are moved to the Writer submodule as to enable
reuse in other submodules.
2017-04-26 23:28:40 +02:00
Albert Krewinkel
0e107a305f API change: move reader functions to Text.Pandoc.Readers
Reader helper functions were defined in the top-level Text.Pandoc
module. These functions are moved to the Readers submodule as to enable
reuse in other submodules.
2017-04-26 23:28:40 +02:00
John MacFarlane
b68135d34d Allow aeson 1.2.0.0. 2017-04-22 17:59:13 +02:00
John MacFarlane
e30a25701f Use skylighitng >= 0.3.3. 2017-04-22 11:15:09 +02:00
Albert Krewinkel
3aeed816e1
Lua filter: allow shorthand functions for math and quoted
Allow to use functions named `SingleQuoted`, `DoubleQuoted`,
`DisplayMath`, and `InlineMath` in filters.
2017-04-14 23:43:59 +02:00
Albert Krewinkel
0add4253e6
Avoid repeating StackValue instances definitions
The lua filters and custom lua writer system defined very similar
StackValue instances for strings and tuples.  These instance definitions
are extracted to a separate module to enable sharing.
2017-04-14 19:07:55 +02:00
Albert Krewinkel
feb1c1a930
Extract lua helper functions into Lua.Util module 2017-04-14 18:26:42 +02:00
Albert Krewinkel
0516b5127c
Drop dependency on hslua-aeson
Pushing values to the lua stack via custom functions is faster and more
flexible.
2017-04-14 11:21:12 +02:00
Albert Krewinkel
d412c38c71
Ensure correctness of StackValue instances 2017-04-06 21:00:38 +02:00
John MacFarlane
e62fbc1c3c Merge pull request #3550 from tarleb/lua-readers-submodule
Lua module: add readers submodule
2017-04-03 09:47:16 +02:00
John MacFarlane
ff991d1e21 Revert "Revert "Use file-embed instead of hsb2hs to embed data files.""
This reverts commit 1fa15c225b.
2017-04-02 23:10:10 +02:00
John MacFarlane
913db947a9 Text.Pandoc.App: Throw errors rather than exiting.
These are caught (and lead to exit) in pandoc.hs, but
other uses of Text.Pandoc.App may want to recover in another
way.

Added PandocAppError to PandocError (API change).
This is a stopgap:  later we should have a separate constructor
for each type of error.

Also fixed uses of 'exit' in Shared.readDataFile, and
removed 'err' from Shared (API change).

Finally, removed the dependency on extensible-exceptions.

See #3548.
2017-04-02 23:04:48 +02:00
Albert Krewinkel
e7eb21ecca
Lua module: add readers submodule
Plain text readers are exposed to lua scripts via the `pandoc.reader`
submodule, which is further subdivided by format.  Converting e.g. a
markdown string into a pandoc document is possible from within lua:

    doc = pandoc.reader.markdown.read_doc("Hello, World!")

A `read_block` convenience function is provided for all formats,
although it will still parse the whole string but return only the first
block as the result.

Custom reader options are not supported yet, default options are used
for all parsing operations.
2017-04-02 17:28:07 +02:00
John MacFarlane
420e3eb26e Allow a theme file as argument to --highlight-style.
Also include a sample, `default.theme`, in `data/`.
2017-04-01 22:27:00 +02:00
John MacFarlane
48039a1d80 Add JATS to description in pandoc.cabal. 2017-03-30 23:00:12 +02:00
John MacFarlane
6ad486c3c3 Automatically include URI-encoded jats.csl for jats output.
This way people can do

    pandoc -s -t jats --filter pandoc-citeproc

and it will just work.  If they want to specify a stylesheet,
they still can.
2017-03-30 16:43:17 +02:00
John MacFarlane
831e1c5edd Added JATS writer.
* New module Text.Pandoc.Writer.JATS exporting writeJATS.
* New output format `jats`.
* Added tests.
* Revised manual.
2017-03-30 01:16:34 +02:00
John MacFarlane
64fe39c255 Added default.jats template.
This is copied from Martin Fenner's pandoc-jats project:
https://github.com/mfenner/pandoc-jats
2017-03-28 09:38:00 +02:00
John MacFarlane
b2f3d8e759 Add auxiliary files for command test for #3530 to pandoc.cabal.
Otherwise builds fail.
2017-03-27 22:03:38 +02:00
John MacFarlane
1fa15c225b Revert "Use file-embed instead of hsb2hs to embed data files."
This reverts commit 10d91c1479.
2017-03-26 20:48:17 +02:00
John MacFarlane
10d91c1479 Use file-embed instead of hsb2hs to embed data files.
I think template haskell is robust enough now across platforms
that this will work.

Motivation: file-embed gives us better dependency tracking:  if a data
file changes, ghc/stack/cabal know to recompile the Data module.

This also removes hsb2hs as a build dependency.
2017-03-26 17:22:00 +02:00
Albert Krewinkel
1e13e98ecf
Ensure compatibility with hslua 0.5.*
The 0.5.0 release of hslua fixes problems with lua C modules on linux.
The signature of the `loadstring` function changed, so a compatibility
wrapper is introduced to allow both 0.4.* and 0.5.* versions to be used.
2017-03-24 21:31:35 +01:00
John MacFarlane
f0abbe7533 Allow creation of pdf via groff ms and pdfroff.
pandoc -t ms -o output.pdf input.txt
2017-03-23 21:24:01 +01:00
John MacFarlane
6c204ea2bd Initial addition of groff ms writer.
* New module: Text.Pandoc.Writers.Ms.
* New template: default.ms.
* The writer uses texmath's new eqn writer to convert math
  to eqn format, so a ms file produced with this writer
  should be processed with `groff -ms -e` if it contains
  math.
2017-03-23 10:14:16 +01:00
John MacFarlane
2d94d48332 Added two lua test files to extra-source-files in pandoc.cabal.
This was caught by our new .travis.yml, which builds from
an extracted sdist tarball instead of the repository.
2017-03-20 17:32:35 +01:00
Albert Krewinkel
f2f6851713 Lua filters (#3514)
* Add `--lua-filter` option.  This works like `--filter` but takes pathnames of special lua filters and uses the lua interpreter baked into pandoc, so that no external interpreter is needed.  Note that lua filters are all applied after regular filters, regardless of their position on the command line.
* Add Text.Pandoc.Lua, exporting `runLuaFilter`.  Add `pandoc.lua` to data files.
* Add private module Text.Pandoc.Lua.PandocModule to supply the default lua module.
* Add Tests.Lua to tests.
* Add data/pandoc.lua, the lua module pandoc imports when processing its lua filters.
* Document in MANUAL.txt.
2017-03-20 15:17:03 +01:00
John MacFarlane
090165d714 Added test for #256. 2017-03-16 22:31:36 +01:00
John MacFarlane
c93d069d49 Add default abbreviations file (data/abbreviations).
This contains a list of strings that will be recognized by pandoc's
Markdown parser as abbreviations.  (A nonbreaking space will
be inserted after the period, preventing a sentence space in
formats like LaTeX.)

Users can override the default by putting a file abbreviations
in their user data directory (`~/.pandoc` on *nix).
2017-03-16 22:16:41 +01:00
John MacFarlane
cc57e36180 Removed another unused cabal dependency. 2017-03-15 15:20:37 +01:00
John MacFarlane
befaf037ce Removed some unnecessary build-depends. 2017-03-15 15:12:14 +01:00
John MacFarlane
2235c2a8f7 Use tasty-golden for golden tests in Old. 2017-03-15 00:27:39 +01:00
John MacFarlane
6ecc5b96a9 Use tasty for tests rather than test-framework. 2017-03-14 17:07:23 +01:00
John MacFarlane
6bf3f89d69 Better handling of \part in LaTeX.
Closes #1905.

Removed stateChapters from ParserState.

Now we parse chapters as level 0 headers, and parts as level -1 headers.
After parsing, we check for the lowest header level, and if it's
less than 1 we bump everything up so that 1 is the lowest header level.
So `\part` will always produce a header; no command-line options
are needed.
2017-03-13 22:11:10 +01:00
Alexander Krotov
d037c5019d Add Muse writer (#3489)
* Add Muse writer

* Advertise new Muse writer

* Muse writer: add regressions tests
2017-03-10 10:16:27 +01:00
John MacFarlane
c46febaaee Expand \newenvironment macros.
Closes #987.

Depends on still unreleased texmath 0.9.3.
2017-03-10 09:46:32 +01:00
John MacFarlane
9925739ba9 Require skylighting 0.3.1. 2017-03-04 10:33:52 +01:00
John MacFarlane
81028e2dce Bumped syb upper bound. 2017-03-02 10:42:07 +01:00
John MacFarlane
da792c63ca Expose some unexposed modules.
+ Text.Pandoc.Writers.Shared
+ Text.Pandoc.Parsing
+ Text.Pandoc.Asciify
+ Text.Pandoc.Emoji
+ Text.Pandoc.ImageSize

[API change]

These are often helpful to people writing their own
reader or writer modules.  Closes #3260.
2017-02-25 22:07:01 +01:00
John MacFarlane
d199d58124 We need process >= 1.2.3 for readCreateProcessWithExitCode. 2017-02-20 16:51:47 +01:00
John MacFarlane
767bd77ec4 Updated test-with field. 2017-02-20 16:35:19 +01:00
John MacFarlane
59666f79f3 Use latest skylighting (0.3). 2017-02-20 13:31:15 +01:00
John MacFarlane
42e2ac8536 Use new skylighting-0.2. 2017-02-20 00:31:57 +01:00
John MacFarlane
7b6273362a pandoc.cabal: use cpphs if embed_data_files and darwin. 2017-02-12 19:59:47 +01:00
Alexander Krotov
48f809384a Add Org writer unit tests 2017-02-12 17:09:07 +03:00
John MacFarlane
a6c649cfc8 Added --log option to save log messages in JSON format to a file.
See #3392.
2017-02-11 09:59:54 +01:00
John MacFarlane
5e1249481b Added Text.Pandoc.Logging (exported module).
This now contains the Verbosity definition previously
in Options, as well as a new LogMessage datatype that
will eventually be used instead of raw strings for
warnings.

This will enable us, among other things, to provide
machine-readable warnings if desired.

See #3392.
2017-02-10 20:59:54 +01:00
John MacFarlane
0bbea0cc76 Split pandoc.hs into a module, Text.Pandoc.App, and a small program.
The App module provides a function that does a pandoc conversion,
based on option settings.  The program (pandoc.hs) now does nothing
more than parse options and pass them to this function, which can
easily be used by other applications (e.g. a GUI wrapper).

The Opt structure has been further simplified.

API changes:

* New exposed module Text.Pandoc.App
* Text.Pandoc.Highlighting has been exposed.
* highlightingStyles has been moved to Text.Pandoc.Highlighting.
2017-02-05 21:58:45 +01:00
John MacFarlane
ce9ec67970 Added first command test to cabal metadata and repo. 2017-02-04 21:56:32 +01:00
John MacFarlane
7ea4ad11bb Added skeleton for Tests.Command. 2017-02-04 17:38:03 +01:00
John MacFarlane
18ab864269 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
John MacFarlane
99c2a31749 Version bounds: require skylighting 0.1.1.4, bump bounds for blaze-*. 2017-01-31 14:45:36 +01:00
John MacFarlane
ae8ac926a4 Merge branch 'typeclass' 2017-01-29 22:13:03 +01:00
John MacFarlane
484c91ea36 Updated copyright to include 2017. 2017-01-29 21:17:42 +01:00
John MacFarlane
84bd0b027b Bump version to 1.19.2. 2017-01-29 21:08:33 +01:00
John MacFarlane
1b416dd12b Use latest skylighting. 2017-01-29 20:53:22 +01:00
John MacFarlane
ea684d257e Fixed trypandoc. 2017-01-29 20:52:57 +01:00
John MacFarlane
2bac035632 Rely on skylighting 0.1.1.2. 2017-01-28 23:27:59 +01:00
John MacFarlane
8a61d943f5 Fix up benchmarks so they compile. 2017-01-27 11:15:55 +01:00
John MacFarlane
b6c1d491f5 Split writeDocbook into writeDocbook4, writeDocbook5.
Removed writerDocbookVersion in WriterOptions.
Renamed default.docbook template to default.docbook4.
Allow docbook4 as an output format.
But alias docbook = docbook4.
2017-01-26 22:40:57 +01:00
John MacFarlane
190943e1fd EPUB writer: split writeEPUB into writeEPUB2, writeEPUB3.
Also include explicit epub2 output format in CLI tool.
2017-01-26 22:09:21 +01:00
John MacFarlane
fce0a60f0a Provide explicit separate functions for HTML 4 and 5.
* Text.Pandoc.Writers.HTML: removed writeHtml, writeHtmlString,
  added writeHtml4, writeHtml4String, writeHtml5, writeHtml5String.
* Removed writerHtml5 from WriterOptions.
* Renamed default.html template to default.html4.
* "html" now aliases to "html5"; to get the old HTML4 behavior,
  you must now specify "-t html4".
2017-01-25 21:51:26 +01:00
John MacFarlane
01483f91bd Revert "Added page breaks into Pandoc."
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25 17:07:43 +01:00
John MacFarlane
85b9abc7a3 Compile against pandoc-types 1.18.*. 2017-01-25 17:07:43 +01:00
John MacFarlane
2bc0cbc239 Removed tests for Walk; these now live in pandoc-types. 2017-01-25 17:07:43 +01:00
John MacFarlane
3876b91448 Make Extensions a custom type instead of a Set Extension.
The type is implemented in terms of an underlying bitset
which should be more efficient.

API change: from Text.Pandoc.Extensions export Extensions,
emptyExtensions, extensionsFromList, enableExtension, disableExtension,
extensionEnabled.
2017-01-25 17:07:42 +01:00
John MacFarlane
1427252160 Split extensions code from Options into separate Text.Pandoc.Extensions.
API change.
However, Extensions exports Options, so this shouldn't have
much impact.
2017-01-25 17:07:42 +01:00
John MacFarlane
f447e724cc Expose Text.Pandoc.MIME, unexpose Text.Pandoc.CSS 2017-01-25 17:07:42 +01:00
John MacFarlane
35699ee533 Fixed up weigh-pandoc and benchmark-pandoc so they build. 2017-01-25 17:07:41 +01:00
John MacFarlane
6643e401ee Version to 2.0. 2017-01-25 17:07:41 +01:00
John MacFarlane
830be4d632 Refactored math conversion in writers.
* Remove exported module `Text.Pandoc.Readers.TeXMath`
* Add exported module `Text.Pandoc.Writers.Math`
* The function `texMathToInlines` now lives in `Text.Pandoc.Writers.Math`
* Export helper function `convertMath` from `Text.Pandoc.Writers.Math`
* Use these functions in all writers that do math conversion.

This ensures that warnings will always be issued for failed
math conversions.
2017-01-25 17:07:40 +01:00
Jesse Rosenthal
06eb9cfb34 Make Txt2Tags test pass.
We don't have a good way to set things that aren't in the common
state. That will be the next order of business.
2017-01-25 17:07:40 +01:00
Jesse Rosenthal
5a02a81b43 Have to do some work to get the mediabag out. 2017-01-25 17:07:40 +01:00
Jesse Rosenthal
6595318142 Remove Text.Pandoc.Free 2017-01-25 17:07:39 +01:00
Jesse Rosenthal
239880f412 Introduce PandocMonad typeclass.
This can be instantiated by both an IO monad or a pure State monad.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
e24d5a56a7 Implement runTest functions.
These work with a State monad and a Reader monad to produce
deterministic results. It can probably be simplified somewhat.
2017-01-25 17:07:39 +01:00
Jesse Rosenthal
0ab4af2f03 New Free module, with pure versions of IO funcs
Introduce a new module, Text.Pandoc.Free, with pure versions, based on
the free monad, of numerous IO functions used in writers and
readers. These functions are in a pure
Monad (PandocAction). PandocAction takes as a parameter the type of
IORefs in it. It can be aliased in individual writers and readers to
avoid this parameter.

Note that this means that at the moment a reader can only use one type
of IORef. If possible, it would be nice to remove this limitation.
2017-01-25 17:07:39 +01:00
John MacFarlane
937b502923 Use skylighting 0.1.1.
Closes #3363.
2017-01-19 15:56:19 +01:00
John MacFarlane
c56669ec39 Allow vector 0.12.0.0. 2017-01-10 17:05:29 +01:00
John MacFarlane
66fc644ddb Allow aeson 1.1. 2017-01-02 12:13:35 -08:00
John MacFarlane
9d781b1454 Updates to use skylighting rather than highlighting-kate.
So far this just reproduces capacity.

Later we'll be able to add features like warning
messages, dynamic loading of xml syntax definitions,
and dynamic loading of themes.
2016-12-23 18:07:49 -07:00
John MacFarlane
bfb6b61084 Allow directory 1.3. Closes #3325. 2016-12-23 14:14:10 -07:00
John MacFarlane
00e83be0cf Version to 1.19.1 2016-12-10 11:29:48 +01:00
John MacFarlane
9b9ec99ee8 We no longer need the MathMLInHTML.js shim from 2004! 2016-12-09 21:18:02 +01:00
John MacFarlane
ac83d4b806 Use new module from texmath to lookup MS font codepoints.
+ Removed Text.Pandoc.Readers.Docx.Fonts
+ Moved its code to texmath; we now use (from texmath 0.9)
  Text.TeXMath.Unicode.Fonts
+ Use texmath 0.9 (currently from git).
+ Updated epub tests because texmath now handles more mathml.
2016-11-30 00:43:55 +01:00
John MacFarlane
92a78d7d79 Version to 1.19. 2016-11-27 17:49:54 +01:00
John MacFarlane
aabf10b8bd Added weigh-pandoc for memory usage diagnostics.
See #3169.
2016-11-18 14:03:33 +01:00
John MacFarlane
3a255447fe Version to 1.18. 2016-10-26 12:24:55 +02:00
John MacFarlane
bb20f919c3 Added INSTALL.md, incorporating INSTALL + installing page from website. 2016-10-25 16:36:17 +02:00
John MacFarlane
738806112b Allow binary formats to be written to stdout unless tty output.
Only works on posix.  On Windows, pandoc works as before and
requires an output file parameter for binary formats.

Closes #2677.
2016-10-23 22:16:00 +02:00
John MacFarlane
4851986187 Merge pull request #3158 from ickc/COPY-LICENSE
Use the markdown version of COPYING from GNU
2016-10-19 14:08:56 +02:00
Kolen Cheung
4b51ed3823 Download markdown version of the license from GNU and rename to COPYING.md
From https://www.gnu.org/licenses/old-licenses/gpl-2.0.md
2016-10-19 04:11:36 -07:00
John MacFarlane
a85e8fe532 Allow latest HUnit. 2016-10-18 10:25:23 +02:00
Jesse Rosenthal
49b0b67b11 Remove Tests.Arbitrary
Use exported Arbitrary instances from pandoc-types instead.
2016-10-14 09:22:29 -04:00
John MacFarlane
6d13567ac5 Allow http-client 0.4.30, which is the version in stackage lts.
Previously we required 0.5.
Remove CPP conditionals for earlier versions.
2016-10-13 13:01:49 +02:00
Albert Krewinkel
63966f6375
Bump required pandoc-types version to 1.17 2016-10-13 08:46:45 +02:00
John MacFarlane
a99d81dce3 Revert overhasty bounds change for pandoc-types. 2016-10-02 20:58:24 +02:00
John MacFarlane
c28c16d463 Use doctemplates 0.1.0.2. 2016-10-02 12:29:37 +02:00
John MacFarlane
5ec9b6352c Moved template compiling/rendering code to a separate library.
jgm/doctemplates.

This allows the pandoc templating system to be used independently.
2016-10-02 09:30:26 +02:00
John MacFarlane
fd3520b97a Bump to 1.17.3 2016-09-23 12:20:34 +02:00