Commit Graph
8803 Commits
Author SHA1 Message Date
Albert Krewinkel 464db59394 Org reader: allow emphasized text to be followed by [
Closes: #3577
2017-04-16 21:19:35 +02:00
schrieveslaach 1c8683f205 Read image size of Inkscape SVGs (#3580) 2017-04-16 19:39:24 +02:00
Albert Krewinkel 56dddcc3f5 Org reader: convert markup at beginning of footnotes
Closes: #3576
2017-04-16 17:22:47 +02:00
Albert Krewinkel e6a536befc Lua filter: revert to non-destructuring filters
We want to provide an interface familiar to users of other filtering
libraries.
2017-04-15 21:40:48 +02:00
Albert Krewinkel 291e4f39e8 Lua module: provide accessors to element properties 2017-04-15 21:36:39 +02:00
John MacFarlane 629c6494a5 Small fix to error reporting in App.
Closes #3548.
2017-04-15 13:46:46 +02:00
John MacFarlane bcc848d773 Avoid parsing "Notes:**" as a bare URI.
This avoids parsing bare URIs that start with a scheme
+ colon + `*`, `_`, or `]`.

Closes #3570.
2017-04-15 13:32:28 +02:00
John MacFarlane 1fe1c162ac Error: Added PandocCouldNotFindDataFileError.
Use this instead of PandocAppError when appropriate.
Removed exit code from PandocAppError, use 1 for all.
2017-04-15 12:05:58 +02:00
John MacFarlane 76b051f7b4 Fixed shadowing warnings 2017-04-15 11:59:48 +02:00
John MacFarlane 8e0032940f Docx reader: removed readDocxWithWarnings (API change).
No longer necessary with pandoc 2.0 framework.
2017-04-15 11:53:46 +02:00
John MacFarlane 35e9da28b8 App: use PandocOptionError instead of PandocAppError where appropriate. 2017-04-15 11:53:45 +02:00
John MacFarlane d722d93b61 Error: Added PandocFilterError. 2017-04-15 11:53:45 +02:00
John MacFarlane 306dc624d9 Error: Added PandocPDFError 2017-04-15 11:53:45 +02:00
John MacFarlane d5701e625c Text.Pandoc.Error: added new constructors.
- PandocSyntaxMapError String
- PandocFailOnWarningError
- PandocPDFProgramNotFoundError String
2017-04-15 11:53:45 +02:00
John MacFarlane dd4110fb09 Revised error message for pandoc -t pdf. 2017-04-15 11:53:45 +02:00
Albert Krewinkel 3d6edbd9e3 Lua filter: use Attributes constructor for Attrs
Element attributes are pushed to the stack via the `Attributes`
function. `Attributes` creates an Attr like triple, but the triple also
allows table-like access to key-value pairs.
2017-04-15 09:31:09 +02:00
Albert Krewinkel ac275528c2 Lua module: fix doc generation, reorder code
Ensure that documentation generated with `ldoc` is readable and correct.
2017-04-15 00:12:51 +02:00
Albert Krewinkel 8c2e6a66b9 Lua module: provide builder functions for math and quoted
Provide functions `pandoc.SingleQuoted`, `pandoc.DoubleQuoted`,
`pandoc.DisplayMath`, and `pandoc.InlineMath` to allow simple building
of Math and Quoted elements.
2017-04-15 00:10:33 +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 eb8de6514b Lua filter: Re-order code of stack value instances 2017-04-14 22:58:00 +02:00
Albert Krewinkel d671b69b87 Lua filter: use lua strings for nullary constructors
Lua string are used to represent nullary data constructors. The previous
table-based representation was based on the JSON serialization, but can
be simplified. This also matches the way those arguments are passed to
custom writers.
2017-04-14 22:32:08 +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 1d9742bb5d Use lua bools and strings for MetaBool, MetaString
Native lua booleans and strings are used to represent MetaBool and
MetaString values.  This is more natural than the previous table-based
representation.  The old lua representation can still be read back to
haskell, ensuring compatibility with the `pandoc.MetaBool` and
`pandoc.MetaString` lua constructors.
2017-04-14 14:59:17 +02:00
Albert Krewinkel 932e395e53 Merge pull request #3569 from tarleb/lua-destructured-filter-functions
Destructuring lua filter functions
2017-04-14 11:57:30 +02:00
Albert Krewinkel 07f41a5515 Lua filter: use destructured functions for block filters
Filtering functions take element components as arguments instead of the
whole block elements. This resembles the way elements are handled in
custom writers.
2017-04-14 11:34:44 +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 540a3e80ad Push blocks via lua constructors and constants
All element creation tasks are handled by lua functions defined in the
pandoc module.
2017-04-14 10:33:38 +02:00
Alexander Krotov 624ccbd45e s/safed/saved/ 2017-04-14 08:27:56 +02:00
Albert Krewinkel 0085251ec7 Push inlines via lua constructors and constants
All element creation tasks are handled in the lua module.
2017-04-14 00:35:38 +02:00
Albert Krewinkel 425df8fff4 Use lua constructors to push meta values 2017-04-13 22:57:50 +02:00
Albert Krewinkel 00746c3c76 Improve lua module documentation 2017-04-13 19:10:51 +02:00
John MacFarlane 07778ade39 Use lowercase a4 for latex papersize example. 2017-04-12 23:41:31 +02:00
Albert Krewinkel 97dfe782cf Lua module: provide multi-param Inline constructors
Instead of taking only a single argument containing the pre-packed
element contents, `Inline` constructors now take the same arguments as
the respective filter and `Custom` writer function
2017-04-12 21:21:25 +02:00
Albert Krewinkel 2761a38e53 Lua filter: use destructured functions for inline filters
Instead of taking the whole inline element, forcing users to destructure it
themselves, the components of the elements are passed to the filtering
functions.
2017-04-12 20:48:44 +02:00
John MacFarlane 31a36cf186 Man writer: Fix handling of nested font commands.
Previously pandoc emitted incorrect markup for bold + italic, for example,
or bold + code.

Closes #3568.
2017-04-12 12:23:29 +02:00
Albert Krewinkel 7e3705c1c4 Lua filter: use custom StackValue Inline instance
Inline elements are no longer pushed and pulled via aeson's Value.
2017-04-11 23:31:55 +02:00
John MacFarlane d4e5fe02b0 Docx writer: don't take "distArchive" from datadir.
The docx writer takes components from the distribution's
version of reference.docx when it can't find them in a
user's custom reference.docx.  (This sometimes happens
because Word will sometimes omit components needed for larger
documents when saving a simple one.)

Previously, we allowed a reference.docx in the data directory
(e.g. `~/.pandoc`) to be used as the distribution's reference.docx.
This led to a bizarre situation where pandoc would produce a
good docx using `--template ~/.pandoc/ref.docx`, but if `ref.docx`
were moved to `~/.pandoc/reference.docx`, it would then produce
a corrupted docx.

Closes #3322 (I think).
2017-04-10 23:59:32 +02:00
Alexander Krotov 9ac9e8d278 stack.yaml: update foundation to 0.0.6 (#3565)
foundation-0.0.4 from lts-8.8 does not build on FreeBSD
2017-04-09 18:19:33 +02:00
John MacFarlane 1778f23292 Use stack lts-8.8.
This gives us a newer verison of executable-path, which we need
for FreeBSD.
2017-04-09 10:16:55 +02:00
Sam Kim 7fe37d0b79 Fixed a typo (#3562) 2017-04-07 22:23:29 +02:00
Albert Krewinkel 41ebdee5df Lua filter: improve doc filter performance
Pandoc elements are pushed and pulled from the lua stack via custom
instances.
2017-04-07 21:04:22 +02:00
Albert Krewinkel d412c38c71 Ensure correctness of StackValue instances 2017-04-06 21:00:38 +02:00
Albert Krewinkel 9278a6325d Lua filter: Improve block filter performance
Reading of simple block values from the lua stack is handled manually,
but most block constructors are still handled via instances of aeson's
Value type.
2017-04-06 19:32:21 +02:00
Albert Krewinkel dd00163a35 Lua filter: Improve inline filter performance
Getting inline instances from the lua stack is handled manually for some
simple inline constructors, including the `Str` constructor. This avoids
the indirect route through aeson's Value type and improves performance
considerably (approx. 30% speedup for some filters).
2017-04-06 19:25:42 +02:00
Albert Krewinkel fca93efb62 Use lua registry instead of named globals
This is slightly cleaner while keeping performance approximately the
same.
2017-04-04 21:51:51 +02:00
John MacFarlane 6b0d3d1582 Ms writer: wider indents for lists.
Previously some indents weren't wide enough, leading
the list item to start on a line after the marker.
2017-04-06 12:45:23 +02:00
John MacFarlane 12ae1df5bf Allow raw latex commands starting with \start in Markdown.
Previously these weren't allowed because they were interpreted
as starting ConTeXt environments, even without a corresponding
\stop...

Closes #3558.
2017-04-06 11:30:03 +02:00
John MacFarlane 12a3481632 Ms writer: respect text wrapping options. 2017-04-05 15:17:35 +02:00
John MacFarlane 48729f9715 Ms writer improvements:
- added some variables to the default template.
- cleaner output for images (stringify alt text).
2017-04-04 17:21:02 +02:00