Commit graph

1053 commits

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