Commit graph

840 commits

Author SHA1 Message Date
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
Jesse Rosenthal
3f8d3d844f Remove TagSoup compat
We already lower-bound tagsoup at 0.13.7, which means we were always
running the compatibility layer (it was conditional on min value
0.13). Better to just use `lookupEntity` from the library directly, and
convert a string to a char if need be.
2016-09-02 12:28:53 -04:00
Albert Krewinkel
c9a631e4eb Remove GHC 7.6 from list of tested versions
GHC versions below 7.8 are no longer supported nor tested.
2016-09-02 16:58:59 +02:00
Jesse Rosenthal
eee780b943 Bump base lower bound to 4.7
We are dropping support for ghc < 7.8.
2016-09-02 09:18:10 -04:00
Jesse Rosenthal
99d5d1c5c7 Bump base lower bound to 4.6 (ghc 7.6) 2016-09-02 09:18:09 -04:00
Jesse Rosenthal
121e3dfb64 Change constraint on mtl. 2016-09-02 09:18:09 -04:00
Jesse Rosenthal
f72e3b58e8 Remove directory compat
directory 1.1 depends on base 4.5 (ghc 7.4) which we are no longer
supporting. So we don't have to use a compatibility layer for it.
2016-09-02 09:18:09 -04:00
Jesse Rosenthal
7f676b534a Remove Text.Pandoc.Compat.Except 2016-09-02 09:18:09 -04:00
Jesse Rosenthal
45c7108b4f Remove Compat.Monoid
This was only necessary for GHC versions with base below 4.5
(i.e., ghc < 7.4).
2016-09-02 09:18:08 -04:00
Albert Krewinkel
bed5f700ce
Org reader: extract meta parsing code to module
Parsing of meta-data is well separable from other block parsing tasks.
Moving into new module to get small files and clearly arranged code.
2016-08-29 14:10:51 +02:00
John MacFarlane
b7b5458450 Allow aeson 1.0.*. 2016-08-20 22:56:27 +02:00
John MacFarlane
d2464de2af Use texmath 0.8.6.5. Closes #3040. 2016-07-24 10:56:19 -07:00
Albert Krewinkel
a396003a31 Rename README to MANUAL.txt 2016-07-20 21:16:45 +02:00
John MacFarlane
d7396e73b4 Don't require haddock-library 1.4.
Instead use CPP to work around version differences.
2016-07-15 12:04:00 -07:00
John MacFarlane
d21701f66c Require haddock-library >= 1.4.
This has math support, DocMathInline and DocMathDisplay.
2016-07-14 23:09:28 -07:00
John MacFarlane
d5c3551276 Version to 1.17.2. 2016-07-14 10:26:00 -07:00
John MacFarlane
418ad5cc81 Allow QuickCheck 2.9. 2016-07-11 08:34:35 +01:00
John MacFarlane
374614aaf7 Depend on http-client 0.5, http-client-tls 0.3 2016-07-04 10:23:37 -07:00
Albert Krewinkel
c1f6bd2640
Org reader: put export setting parser into module
Export option parsing is distinct enough from general block parsing to
justify putting it into a separate module.
2016-07-02 13:14:09 +02:00
Alex Ivkin
7fdcd9a6e2 Added ZimWiki format to documentation and cabal description. 2016-07-01 00:12:25 -07:00
Alex Ivkin
a73c95f61d Added Zim Wiki writer, template and tests. 2016-06-30 23:59:43 -07:00
John MacFarlane
b06d6c1ff8 Update texmath lower bound. 2016-06-22 11:45:32 -07:00
Felix Yan
f0265d4f34 Allow tagsoup 0.14
Building with the new release went fine here, and it works correctly.
2016-06-14 07:44:09 -05:00
John MacFarlane
20c0366ad8 Removed -rtsopts from library stanza.
It has no effect, and Hackage wouldn't accept the package.
2016-06-04 15:21:56 -07:00
John MacFarlane
34510949ca Travis: test with ghc 8.0.1, remove testing with ghc 7.4. 2016-06-04 07:36:15 -07:00
John MacFarlane
4bc0f121c9 Require latest highlighting-kate. 2016-06-03 13:13:47 -07:00
Albert Krewinkel
512bf2eebf Org reader: undo code duplication
Some code was duplicated (copy-pasted) or placed in an inappropriate
module during the modularization refactoring.  Those functions are moved
into a `Shared` module, as was originally intended but forgotten.
Better documentation of the respective functions is a positive
side-effect.
2016-06-02 15:30:20 +02:00
Albert Krewinkel
eea6d6568f Org reader: extract blocks parser to module
Block parsing code is moved to a separate module.

This is part of the Org-mode reader cleanup effort.
2016-05-25 23:21:40 +02:00
Albert Krewinkel
39e8b4276e Org reader: extract inline parser to module
Inline parsing code is moved to a separate module.  Parsers for block
starts are extracted as well, as those are used in the `endline` parser.

This is part of the Org-mode reader cleanup effort.
2016-05-25 22:54:45 +02:00
Albert Krewinkel
a340c7249f Org reader: extract parsing function to module
The Org-mode reader uses many functions defined in the
`Text.Pandoc.Parsing` utility module.  Some of the functions are
overwritten with versions adapted to Org-mode idiosyncrasies.  These
special functions, as well as the normal Pandoc versions, are combined
in a single module to increase the ease of use.

This leads to decoupling of Org-mode and Pandoc and hence to slightly
cleaner code.  The downside is code-bloat due to repeated import/export
statements.
2016-05-25 22:53:55 +02:00
John MacFarlane
e3ca9793aa Bumped upper-bounds to build with ghc 8. 2016-05-22 09:21:49 -07:00
John MacFarlane
054e6abd0d Revert "New method for checking for presence of tex program."
This reverts commit 285bbf61cf.
2016-05-12 21:01:30 -07:00
John MacFarlane
1b8d006ac8 Revert "Require process >= 1.2.1."
This reverts commit 07a4320ba9.
2016-05-12 20:59:08 -07:00
John MacFarlane
07a4320ba9 Require process >= 1.2.1.
We need `createProcess_` to be exported.
2016-05-12 11:08:56 -07:00
John MacFarlane
3800cb3d42 Merge pull request #2912 from tarleb/org-export-settings
Org reader: basic support for export settings
2016-05-11 13:36:02 -07:00
Albert Krewinkel
7a0729ea09 Org reader: move parser state into separate module
The org reader code has become large and confusing.  Extracting smaller
parts into submodules should help to clean things up.
2016-05-11 19:13:42 +02:00
John MacFarlane
285bbf61cf New method for checking for presence of tex program.
Now instead of using `findExecutable`, which has limitations
on Windows, we just do `progname --version` and see if it
returns successfully.  Closes #2903.
2016-05-09 20:52:20 -07:00
John MacFarlane
cc9a9c7150 Added docbook5 templates, test files to pandoc.cabal. 2016-05-01 23:02:22 -07:00
John MacFarlane
52f94cff48 Bump version to 1.17.1.
We need a minor version bump because of the addition
of `writerDocbook5` to `WriterOptions`.
2016-05-01 22:48:49 -07:00
John MacFarlane
a0fae92847 Require texmath 0.8.6.2.
Closes several texmath-related bugs:  #2775, #2310, #2310.

This fixes issues with sub/superscript positioning and
matrix column alignment in docx.
2016-04-20 15:05:41 -07:00
John MacFarlane
e053865746 Allow data-default 0.6.0. 2016-04-18 15:00:00 -07:00
John MacFarlane
32ecd195bd Use texmath >= 0.8.6.1.
This fixes behavior of roots, e.g. `\sqrt[3]{x}`.
See #2824.
2016-03-29 22:57:37 -07:00
John MacFarlane
1de993c64a Bump version to 1.17.0.3. 2016-03-24 08:59:06 -07:00
Mauro Bieg
30ceb235ce include .tei files in pandoc.cabal
closes #2811
2016-03-24 13:41:12 +01:00
John MacFarlane
499985c1a3 Updated copyright dates to include 2016. 2016-03-22 17:20:39 -07:00
John MacFarlane
e36e692e6b Version bump to 1.17.0.2. 2016-03-22 17:05:22 -07:00
John MacFarlane
edcb8b6169 Version to 1.17.0.1. 2016-03-21 15:34:56 -07:00
Jesse Rosenthal
a7a0b452a5 Docx Reader: Get rid of Modifiable typeclass.
The docx reader used to use a Modifiable typeclass to combine both
Blocks and Inlines. But all the work was in the inlines. So most of the
generality was wasted, at the expense of making the code harder to
understand. This gets rid of the generality, and adds functions for
Blocks and Inlines. It should be a bit easier to work with going forward.
2016-02-26 08:57:53 -05:00
John MacFarlane
38bd4162fe Allow zip-archive 0.3. 2016-02-24 20:42:28 -08:00
John MacFarlane
0180807a6c Raise tagsoup lower bound to 0.13.7.
This fixes entity-related problems.

Closes #2734.
2016-02-22 09:59:11 -08:00
John MacFarlane
e552a14bf9 Allow aeson 0.11. 2016-02-09 09:30:36 -08:00
John MacFarlane
f35fa88e21 Bump version to 1.17.
API change in type of Text.Pandoc.Shared.uniqueIdent.
2016-01-22 10:20:58 -08:00
John MacFarlane
5b31790199 Added TEI to description and default.tei to data files. 2016-01-21 15:31:12 -08:00
csforste
25a9ca697a Add TEI Writer. 2016-01-19 14:03:57 -05:00
John MacFarlane
3004306c3d Version to 1.16.0.2, updated changelog. 2016-01-12 23:48:06 -08:00
John MacFarlane
f34382ef2c Depend on deepseq rather than deepseq-generics.
See fpco/stackage#1096.
2016-01-11 12:49:28 -08:00
John MacFarlane
687c39e4c0 Version bump to 1.16.0.1 2016-01-09 13:13:28 -08:00
John MacFarlane
197f301795 Revert "Make file globbing work on windows."
This reverts commit 363ecfebc3.
2016-01-06 11:11:59 -08:00
John MacFarlane
363ecfebc3 Make file globbing work on windows.
Windows cmd doesn't expand wildcards; the application has to
do this.  So on windows we use 'glob' to expand.
2016-01-06 10:44:56 -08:00
John MacFarlane
a81b0932e5 Go back to testing with ghc 7.10.2.
Avoids the dreaded "the version of cabal being used has
changed" error.

https://www.reddit.com/r/haskell/comments/3f4bgr/the_version_of_cabal_being_used_has_changed/
2016-01-05 13:57:35 -08:00
John MacFarlane
694eb87b48 Updated .travis.yml, added ghc 7.10.3 to tested-with. 2016-01-05 10:51:16 -08:00
John MacFarlane
8908205fab Allow process 1.4 2016-01-01 20:36:58 -08:00
John MacFarlane
cfa6f9f3ab Allow binary 0.8 2016-01-01 20:35:38 -08:00
John MacFarlane
5f814b6376 Relax version bound on HTTP. 2016-01-01 20:23:42 -08:00
John MacFarlane
b27783e2ec Use cmark 0.5.
Closes #2605.
2015-12-29 19:52:06 -08:00
John MacFarlane
c16efea983 Removed "compatibility mode" when called as hsmarkdown. 2015-12-14 11:21:54 -08:00
John MacFarlane
60d383e27e Update to use latest releases of highlighting-kate and texmath. 2015-12-12 16:35:25 -08:00
John MacFarlane
244cd5644b Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into mb21-new-image-attributes
* Bumped version to 1.16.
* Added Attr field to Link and Image.
* Added `common_link_attributes` extension.
* Updated readers for link attributes.
* Updated writers for link attributes.
* Updated tests
* Updated stack.yaml to build against unreleased versions of
  pandoc-types and texmath.
* Fixed various compiler warnings.

Closes #261.

TODO:

* Relative (percentage) image widths in docx writer.
* ODT/OpenDocument writer (untested, same issue about percentage widths).
* Update pandoc-citeproc.
2015-11-19 23:14:23 -08:00
John MacFarlane
0555d028b5 Bump version to 1.15.2.1. Updated changelog. 2015-11-16 07:40:08 -08:00
John MacFarlane
bfea92273d Added stack.yaml to other-source-files so it gets into tarball. 2015-11-16 07:02:04 -08:00
John MacFarlane
23c6f0c4fe Added two missing test cases to extra-source-files in pandoc.cabal.
Otherwise they don't get into the tarball.  Closes #2537.
2015-11-16 06:44:03 -08:00