Commit graph

968 commits

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