Commit graph

8937 commits

Author SHA1 Message Date
John MacFarlane
3d6bedff35 Debian control: added latex packages as 'suggested'. 2017-05-15 17:06:28 +02:00
Henri Werth
2de5208311 Added support for horizontal spacing in LaTeX: parse \, to \8198 (six-per-em space) 2017-05-15 16:37:08 +02:00
John MacFarlane
000293a4e3 Merge pull request #3668 from tarleb/copyright-update
Update copyright notices
2017-05-15 16:30:33 +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
Albert Krewinkel
9d295f4527
Parsing: add insertIncludedFilesF which returns F blocks
The `insertIncludeFiles` function was generalized and renamed to
`insertIncludedFiles'`; the specialized versions are based on that.
2017-05-14 12:40:16 +02:00
Albert Krewinkel
5ff6108b4c
Parsing: introduce HasIncludeFiles type class
The `insertIncludeFile` function is generalized to work with all parser
states which are instances of that class.
2017-05-14 10:00:58 +02:00
Albert Krewinkel
7a17c3eb9f
Parsing: replace partial with total function
Calling `tail` on an empty list raises an exception, while calling the
otherwise equivalent `drop 1` will return the empty list again.
2017-05-14 09:28:08 +02:00
Albert Krewinkel
09ef99477d
COPYRIGHT: list new files not written by John 2017-05-13 23:50:39 +02:00
Albert Krewinkel
965f1ddd4a
Update dates in copyright notices
This follows the suggestions given by the FSF for GPL licensed software.
<https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-13 23:30:13 +02:00
Albert Krewinkel
1cbb3bad2b
Add haddock module description to FB2 writer
Copyright, maintainer etc. were missing in haddock docs for this module.
2017-05-13 23:18:50 +02:00
Albert Krewinkel
62d34c79b9
Change maintainer line in Org writer module 2017-05-13 23:18:10 +02:00
Alexander Krotov
2a291e437a Replace repeat' and take' with `replicate' once more 2017-05-12 16:31:57 +02:00
Alexander Krotov
c14c8a1a68 Replace repeat' and take' with `replicate' 2017-05-12 07:36:03 +02:00
Albert Krewinkel
4b9fb7a128 Combine grid table parsers
The grid table parsers for markdown and rst was combined into one single
parser, slightly changing parsing behavior of both parsers:

- The markdown parser now compactifies block content cell-wise: pure
  text blocks in cells are now treated as paragraphs only if the cell
  contains multiple paragraphs, and as plain blocks otherwise. Before,
  this was true only for single-column tables.

- The rst parser now accepts newlines and multiple blocks in header
  cells.

Closes: #3638
2017-05-11 00:17:56 +02:00
Václav Haisman
7bdf38ef2e LaTeX: Load parskip before hyperref. (#3654)
* LaTeX: Load `parskip` before `hyperref`.

According to `hyperref` package's `README.pdf`, page 22, `hyperref` package
should be loaded after `parskip` package.

* Adjust tests for previous change.
2017-05-09 22:09:10 +02:00
Václav Haisman
5048be5112 Fix links inside captions in LaTeX output with links-as-notes.
Declare our redefined `\href` robust.

Fixes #3651. (#3652)
2017-05-08 12:07:01 +02:00
David A Roberts
cff6d2dd73 Markdown writer: missing \n (#3647) 2017-05-07 23:11:57 +02:00
Alexander Krotov
69110cde81 Muse writer: Indent tables with one space (#3649)
It is required to trigger Muse table rendering.
2017-05-07 21:41:38 +02:00
John MacFarlane
6b086acae8 Rename fillMedia -> fillMediaBag. 2017-05-07 21:03:18 +02:00
John MacFarlane
a902109c6d PDF: use fillMedia and extractMedia to extract media to tmp dir.
This reduces code duplication.
We should be able to do something similar in ODT, Docx, EPUB writers.
2017-05-07 20:57:16 +02:00
John MacFarlane
af7215a048 Moved fillMedia, extractMedia from App to Class.
Also generalized type of fillMedia to any instance of PandocMonad.
2017-05-07 20:42:32 +02:00
John MacFarlane
99be906101 Added PandocHttpException, trap exceptions in fetching from URLs.
Closes #3646.
2017-05-07 13:11:04 +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
John MacFarlane
f8e125f42d fillMediaBag: don't cause fatal error if resource not found.
Report warning instead and change image to its alt text.
2017-05-07 12:16:14 +02:00
John MacFarlane
af8860d26a Updated documentation for --extract-media. 2017-05-07 11:56:19 +02:00
John MacFarlane
400fe3188e Allow --extract-media to work with non-binary input formats.
If `--extract-media` is supplied with a non-binary input format,
pandoc will attempt to extract the contents of all linked images,
whether in local files, data: uris, or external uris.

They will be named based on the sha1 hash of the contents.

Closes #1583, #2289.

Notes:

- One thing that is slightly subideal with this commit is that
  identical resources will be downloaded multiple times.  To improve
  this we could have mediabag store an original filename/url +
  a new name.

- We might think about reusing some of this code, since more or less the
  same thing is done in the Docx, EPUB, PDF writers (with slight
  variations).
2017-05-07 11:45:33 +02:00
John MacFarlane
de0fd90051 Use fewer quickcheck tests for lua tests, to speed things up. 2017-05-07 11:45:06 +02:00
John MacFarlane
e15a4badff Simplify plumbing for document transformation. 2017-05-07 10:34:04 +02:00
John MacFarlane
82cc7fb0d4 Markdown reader: improved parsing of indented raw HTML blocks.
Previously we inadvertently interpreted indented HTML as
code blocks.  This was a regression.

We now seek to determine the indentation level of the contents
of an HTML block, and (optionally) skip that much indentation.

As a side effect, indentation may be stripped off of raw
HTML blocks, if `markdown_in_html_blocks` is used. This
is better than having things interpreted as indented code
blocks.

Closes #1841.
2017-05-06 22:56:16 +02:00
John MacFarlane
f20c89e243 LaTeX reader: Better handling of comments inside math environments.
This solves a problem with commented out `\end{eqnarray}` inside
an eqnarray (among other things).

Closes #3113.
2017-05-06 22:16:43 +02:00
schrieveslaach
ddf2524477 Fix keyval funtion: pandoc did not parse options in braces correctly.… (#3642)
* Fix keyval funtion: pandoc did not parse options in braces correctly. Additionally, dot, dash, and colon were no valid characters

* Add | as possible option value

* Improved code
2017-05-06 15:09:29 +02:00
John MacFarlane
f422000197 Small reformatting in MANUAL. 2017-05-06 15:01:54 +02:00
John MacFarlane
2f3d62cb86 ConTeXt template: improved font handling.
simplefonts is now obsolete in ConTeXt.

This patch comes from Pablo Rodríguez via jgm/pandoc-templates#247.
2017-05-06 14:58:32 +02:00
Albert Krewinkel
bf44b88522
Drop redundant import of sort
This was left in accidentally.
2017-05-06 11:32:38 +02:00
Albert Krewinkel
da8c153a68
Org reader: support macros
Closes: #3401
2017-05-06 11:00:32 +02:00
John MacFarlane
9f0a80457f Revert "SelfContained: special handling for css @import."
This reverts commit 89b3fcc8e0.
2017-05-05 23:23:49 +02:00
John MacFarlane
89b3fcc8e0 SelfContained: special handling for css @import.
We now avoid creating a data URI for the url under an
@import.
2017-05-05 23:03:31 +02:00
John MacFarlane
c1b45adda0 SelfContained: Handle url() inside material retrieved from url().
This can happen e.g. with an @import of a google web font.
(What is imported is some CSS which contains an url reference
to the font itself.)

Also, allow unescaped pipe (|) in URL.

This is intended to help with #3629, but it doesn't seem to
work.
2017-05-05 17:03:27 +02:00
John MacFarlane
1668998c46 Include backtick_code_blocks extension in mardkown_mmd.
Closes #3637.
2017-05-04 16:36:35 +02:00
Alexander Krotov
430e6be1f4 Muse writer: omit automatic header identifiers (#3633) 2017-05-04 11:36:52 +02:00
Albert Krewinkel
57cba3f1d5
Org reader: support table.el tables
Closes #3314
2017-05-03 22:43:34 +02:00
Albert Krewinkel
df23d96c89
Generalize tableWith, gridTableWith
The parsing functions `tableWith` and `gridTableWith` are generalized to
work with more parsers. The parser state only has to be an instance of
the `HasOptions` class instead of requiring a concrete type. Block
parsers are required to return blocks wrapped into a monad, as this
makes it possible to use parsers returning results wrapped in `Future`s.
2017-05-02 23:41:45 +02:00
David A Roberts
79855ef934 Markdown writer: better escaping for links (#3628)
Previously the Markdown writer would sometimes create links where there
were none in the source.  This is now avoided by selectively escaping bracket
characters when they occur in a place where a link might be created.

Closes #3619.
2017-05-03 12:19:45 +02:00
schrieveslaach
6e55e6837a LaTeX reader: Add support for tabularx environment (#3632) 2017-05-03 12:16:48 +02:00
Mauro Bieg
e02cfcdeac Markdown Writer: put space before reference link definitions
Fixes #3630 (#3631).

Previously the attributes in link reference definitions did not have a space preceding.
2017-05-03 12:13:25 +02:00
John MacFarlane
cd2551c16c Added PandocResourceNotFound error.
Use this instead of PandocIOError when a resource is not
found in path.

This improves the error message in this case, see #3629.
2017-05-02 16:00:04 +02:00
John MacFarlane
022d58e02a stack.yaml: use lts-8.12.
This should fix the build failure on travis.
2017-05-02 09:24:33 +02:00
David A Roberts
c0192132cf Markdown writer: Case-insensitive reference links. (#3616)
Ensure that we do not generate reference links
whose labels differ only by case.

Also allow implicit reference links when the link
text and label are identical up to case.

Closes #3615.
2017-05-02 09:00:37 +02:00
Alexander Krotov
5d529e30c7 FB2 writer: Add support for "lang" metadata (#3625) 2017-05-02 08:57:08 +02:00
Albert Krewinkel
ae21a8bb2a
Lua filter: fall-back to global filters when none is returned
The implicitly defined global filter (i.e. all element filtering
functions defined in the global lua environment) is used if no filter is
returned from a lua script. This allows to just write top-level
functions in order to define a lua filter. E.g

    function Emph(elem) return pandoc.Strong(elem.content) end
2017-04-30 17:06:54 +02:00