Commit graph

4573 commits

Author SHA1 Message Date
Albert Krewinkel
4ebf6f6ebf Org reader: Minor code clean-up 2014-04-06 20:39:05 +02:00
John MacFarlane
11120d619b Give more useful error message if '-t pdf' is specified.
Closes #1155.
2014-04-05 23:44:57 -07:00
John MacFarlane
971e4c4364 HTML reader: Updated closes with rules from HTML5 spec. 2014-04-05 23:05:11 -07:00
John MacFarlane
24f438aa5f Textile reader: Better support for attributes.
Instead of being ignored, attributes are now parsed and
included in Span inlines.

The output will be a bit different from stock textile:
e.g. for `*(foo)hi*`, we'll get `<em><span class="foo">hi</span></em>`
instead of `<em class="foo">hi</em>`.  But at least the data is
not lost.
2014-04-05 21:02:12 -07:00
John MacFarlane
060a76a38e Textile reader: Improved treatment of HTML spans (%).
Closes #1115.
2014-04-05 20:41:38 -07:00
John MacFarlane
75dbe87a99 Removed whitespace at ends of lines. 2014-04-05 20:31:27 -07:00
John MacFarlane
d4054444c0 Text.Pandoc.PDF: Ensure that temp directories deleted on Windows.
The PDF is now read as a strict bytestring, ensuring that process
ownership will be terminated, so the temp directory can be deleted.
Closes #1192.
2014-04-05 19:57:42 -07:00
John MacFarlane
dc82d222e5 README: Added note to --bibtex/--natbib: not for use in making PDF.
Closes #1194. Thanks to nahoj.
2014-04-05 16:01:46 -07:00
John MacFarlane
3fe6b57b60 Make it possible to run filters that aren't executable.
Pandoc first tries to find the executable (searching the path
if path isn't given).  If it fails, but the file exists and has
a .py, .pl, .rb, .hs, or .php extension, pandoc runs the filter
using the appropriate interpreter.

This should make it easier to use filters on Windows, and make
it more convenient for everyone.

Closes #1096.
2014-04-05 15:51:04 -07:00
John MacFarlane
f2deb9d86d Org reader: Added type signature. 2014-04-05 15:50:46 -07:00
John MacFarlane
e35ebd3239 Fixed PDF print function in reveal.js template.
Closes #1220.  Thanks to kevinkenan.
2014-04-05 15:24:05 -07:00
John MacFarlane
971dca588e Merge pull request #1219 from tarleb/org-images
Org-reader: support inline images, clean-up code, fix bugs
2014-04-05 15:12:40 -07:00
John MacFarlane
c0309a60bc Shared.openURL: Set proxy with value of http_proxy env variable.
Note:  proxies with non-root paths are not supported,
because of limitations in http-conduit.

Closes #1211.
2014-04-05 10:58:32 -07:00
Albert Krewinkel
652c781e37 Org reader: Support inline images 2014-04-05 16:15:53 +02:00
Albert Krewinkel
d76d2b707b Org reader: Provide more language identifier translations
Org-mode and Pandoc use different language identifiers, marking source
code as being written in a certain programming language.  This adds more
translations from identifiers as used in Org to identifiers used in
Pandoc.

The full list of identifiers used in Org and Pandoc is available through
http://orgmode.org/manual/Languages.html and `pandoc -v`, respectively.
2014-04-05 16:15:50 +02:00
Albert Krewinkel
fd98532784 Org reader: Fix parsing of nested inlines
Text such as /*this*/ was not correctly parsed as a strong, emphasised
word.  This was due to the end-of-word recognition being to strict as it
did not accept markup chars as part of a word.  The fix involves an
additional parser state field, listing the markup chars which might be
parsed as part of a word.
2014-04-05 16:14:40 +02:00
Albert Krewinkel
d43c3e8101 Org reader: Use specialized org parser state
The default pandoc ParserState is replaced with `OrgParserState`.  This
is done to simplify the introduction of new state fields required for
efficient Org parsing.
2014-04-05 16:14:09 +02:00
Albert Krewinkel
7cf7e45e4c Org reader: Slight cleaning of table parsing code 2014-04-05 16:13:18 +02:00
John MacFarlane
ee2e769cd7 DocBook reader: Better treatment of formalpara.
We now emit the title (if present) as a separate paragraph
with boldface text.

Closes #1215.
2014-04-04 22:06:25 -07:00
John MacFarlane
8c014967c6 DocBook template: use authorgroup if there are authors. 2014-04-04 21:43:17 -07:00
John MacFarlane
25763a8a35 DocBook reader/writer tests: use "authorgroup". 2014-04-04 21:41:44 -07:00
John MacFarlane
e06aa97bb9 DocBook reader: set metadata "author" not "authors" 2014-04-04 21:39:08 -07:00
John MacFarlane
c5a0c7a819 Removed trailing whitespace. 2014-04-04 21:34:12 -07:00
John MacFarlane
c99ecf6cc5 DocBook reader: set "author" not "authors". 2014-04-04 21:33:16 -07:00
Matthew Pickering
1b930a9670 Added recognition of authorgroup element and releaseinfo element to DocBook reader.
Closes #1214
2014-04-04 21:00:49 -07:00
Matthew Pickering
b1c865ccc6 Converted current meta information parsing in DocBook to a more extensible version which is aware of the more recent meta representation. 2014-04-04 21:00:29 -07:00
John MacFarlane
98658b55fc LaTeX writer: handle line breaks in simple table cells.
Closes #1217.
2014-04-04 17:39:56 -07:00
John MacFarlane
6ceb2e26dc Merge pull request #1216 from trofi/master
pandoc.cabal: allow QuickCheck-2.7
2014-04-04 15:45:23 -07:00
John MacFarlane
036576c5a2 Correctly handle UTF-8 in custom lua scripts. Closes #1189. 2014-04-04 15:43:47 -07:00
Sergei Trofimovich
8890c2ba3d pandoc.cabal: allow QuickCheck-2.7
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2014-04-04 23:49:21 +03:00
John MacFarlane
e97217f234 Added caption package to default beamer template. Closes #1200. 2014-04-04 13:13:28 -07:00
John MacFarlane
fa0f73aef9 Custom writer: read lua script as UTF-8.
This should fix #1189.
2014-04-04 10:07:56 -07:00
John MacFarlane
4ee92dce0c MediaWiki reader: Fixed bug in certain nested lists.
The bug: If a level 2 list was followed by a level 1 list, the first
item of the level 1 list would be lost.

Closes #1213.
2014-04-01 10:36:23 -07:00
John MacFarlane
976f4f2d8f Added HTML reader tests for empty strong, emph. 2014-04-01 10:15:21 -07:00
John MacFarlane
1cadba16eb HTML reader: idiomatic rewriting for clarity. 2014-04-01 10:10:46 -07:00
John MacFarlane
ced8be1d08 Merge pull request #1207 from mpickering/htmlinlines
Fix #1162, #1175 and rewrite textile and HTML backend to use the builder
2014-04-01 09:21:23 -07:00
Matthew Pickering
90269cb213 Tests updated to reflect changes to readers.
Previously normalisation was handled by the `normalizeSpaces` function. The behavoir of the builder monoid is slightly different and melds together more items such as consecutive strings and spaces adjacent to line breaks. The tests have been changed to reflect this.

All relevant tests passed when the string melding line of the builder monoid was commented out.
2014-04-01 13:53:34 +01:00
Matthew Pickering
5a51a67abd Changed the smart punctuation parser to return Inlines rather than an Inline element and updated files accordingly 2014-04-01 13:53:34 +01:00
Matthew Pickering
9b5d474e79 Converted HTML reader to use builder. Fixes #1162. 2014-04-01 13:44:19 +01:00
Matthew Pickering
0ccca94b4c Bugfix for #1175 and convert textile reader to use builder.
The reader did not correctly parse inline markup. The behavoir is now as follows.

(a) The markup must start at the start of a line, be inside previous
inline markup or be preceeded by whitespace.
(b) The markup can not span across paragraphs (delimited by \n\n)
(c) The markup can not be followed by a alphanumeric character.
(d) Square brackets can be placed around the markup to avoid having
to have white space before it.

In order to make these changes it was either necessary to convert the parser to return a list of inlines or to convert the whole reader to use the builder. The latter approach whilst more work makes a bit more sense as it becomes easy to arbitarily append and prepend elements without changing the type.

Tests are accordingly updated in a later commit to reflect the different normalisation behavoir specified by the builder monoid.
2014-04-01 13:44:06 +01:00
John MacFarlane
99f4f636df Make --toc-depth work well with books in latex/pdf output.
Closes #1210.
2014-03-31 11:08:10 -07:00
John MacFarlane
361167deff Markdown writer: Use longer backtick fences if needed.
If the content contains a backtick fence and there are
attributes, make sure longer fences are used to delimit the code.

Note:  This works well in pandoc, but github markdown is more
limited, and will interpret the first string of three or more
backticks as ending the code block.

Closes #1206.
2014-03-30 15:50:01 -07:00
John MacFarlane
69a7c9f634 LaTeX reader: Better handling of figure and table with caption.
We now look for a \caption inside the environment; if one is
found, it is attached to the graphic or tabular found there.

Closes #1204.
2014-03-25 23:10:43 -07:00
John MacFarlane
0934c4430a Parsing: Added stateCaption.
This is primarily for use in the LaTeX reader, so far.
2014-03-25 22:44:16 -07:00
John MacFarlane
994597f071 Revert "LaTeX reader: Added LPState."
This reverts commit 82ddec698e.
2014-03-25 22:40:18 -07:00
John MacFarlane
82ddec698e LaTeX reader: Added LPState.
Plan is to use this instead of ParserState in LP.
2014-03-25 15:38:30 -07:00
John MacFarlane
6992050161 Parsing: Added HasMacros, simplified other typeclasses.
Removed updateHeaderMap, setHeaderMap, getHeaderMap,
updateIdentifierList, setIdentifierList, getIdentifierList.
2014-03-25 14:55:18 -07:00
John MacFarlane
6ec3ee3a67 Whitespace change, and note:
Contrary to the previous commit message, there was no API
change, since Text.Pandoc.Parsing is not an exposed module.
2014-03-25 13:51:55 -07:00
John MacFarlane
08d1404b31 API changes to HasReaderOptions, HasHeaderMap, HasIdentifierList.
Previously these were typeclasses of monads.  They've been changed
to be typeclasses of states.  This ismplifies the instance definitions
and provides more flexibility.

This is an API change!  However, it should be backwards compatible
unless you're defining instances of HasReaderOptions, HasHeaderMap,
or HasIdentifierList.  The old getOption function should work as
before (albeit with a more general type).

The function askReaderOption has been removed.
extractReaderOptions has been added.
getOption has been given a default definition.

In HasHeaderMap, extractHeaderMap and updateHeaderMap have been added.
Default definitions have been given for getHeaderMap, putHeaderMap,
and modifyHeaderMap.

In HasIdentifierList, extractIdentifierList and updateIdentifierList
have been added.  Default definitions have been given for
getIdentifierList, putIdentifierList, and modifyIdentifierList.

The ultimate goal here is to allow different parsers to use their
own, tailored parser states (instead of ParserState) while still
using shared functions.
2014-03-25 13:43:34 -07:00
John MacFarlane
5e69f845d5 LaTeX reader: Better handling of "table" environment.
Positioning options no longer rendered verbatim.
Partially addresses #1204.
2014-03-25 12:04:25 -07:00