John MacFarlane
743dac493f
LaTeX reader: Better error messages with include files.
...
Closes #1274 .
Rewrote handleIncludes.
We now report the actual source file and position where the error
occurs, even if it is included. We do this by inserting special
commands, `\PandocStartInclude` and `\PandocEndInclude`, that encode
this information in the preprocessing phase.
Also generalized the types of a couple functions from
`Text.Pandoc.Parsing`.
2014-05-03 17:37:54 -07:00
John MacFarlane
4c43824203
Fixed empty reference links. Closes #1186 .
...
Includes test.
2014-05-02 22:58:47 -07:00
John MacFarlane
007eb96e06
Markdown reader: Make one-column pipe tables work.
...
Closes #1218 .
2014-05-01 09:23:21 -07:00
John MacFarlane
b306405caa
Merge pull request #1272 from tarleb/link-types
...
Org reader: add support for custom link types
2014-05-01 08:44:05 -07:00
Albert Krewinkel
8726eebcd3
Org reader: Add support for custom link types
...
Org allows users to define their own custom link types. E.g., in a
document with a lot of links to Wikipedia articles, one can define a
custom wikipedia link-type via
#+LINK: wp https://en.wikipedia.org/wiki/
This allows to write [[wp:Org_mode][Org-mode]] instead of the
equivallent [[https://en.wikipedia.org/wiki/Org_mode ][Org-mode]].
2014-05-01 11:50:32 +02:00
John MacFarlane
eaba340b93
RST reader: Some fixes to last change, and use "author" not "authors".
...
(in metadata)
2014-04-30 11:28:18 -07:00
John MacFarlane
81bf82c258
RST reader: Better handling of directives.
...
* We now correctly handle field lists that are indented more than
3 spaces.
* We treat an "aafig" directive as a code block with attributes,
so it can be processed in a filter. (Closes #1212.)
2014-04-30 09:59:36 -07:00
John MacFarlane
093229dc35
ConTeXt writer: Improved autolinks.
...
Closes #1270 .
2014-04-30 08:58:10 -07:00
John MacFarlane
c8f97d3d41
Fix #1267 .
...
We now check the writerName for a lua script in pandoc.hs, so that
lowercasing and format parsing aren't done. Note this behavior
change: getWriter in Text.Pandoc no longer returns a custom writer on
input "foo.lua".
2014-04-27 20:56:50 -07:00
John MacFarlane
22e36e1040
LaTeX reader: Made \nocite
work.
...
This adds nocite citations to a metadata field, `nocite`.
These will appear in the bibliography but not in the text
(unless you use a `$nocite$` variable in your template, of
course).
2014-04-26 12:14:42 -07:00
John MacFarlane
35ea8de369
HTML writer: improved detection of image links.
...
Previously image links with queries were not recognized,
leading to use of an embed tag rather than an img tag.
2014-04-26 12:04:08 -07:00
John MacFarlane
60297089f6
Merge pull request #1265 from tarleb/org-links
...
Improvements handling of internal links
2014-04-25 08:08:00 -07:00
Albert Krewinkel
b09412d852
LaTeX writer: Mark span contents with label if span has an ID
...
Prepend `\label{span-id}` to span contents iff `span-id` is defined.
2014-04-25 16:17:24 +02:00
Albert Krewinkel
2eec20d92f
Org reader: Enable internal links
...
Internal links in Org are possible by using an anchor-name as the target
of a link:
[[some-anchor][This]] is an internal link.
It links <<some-anchor>> here.
2014-04-25 15:29:28 +02:00
John MacFarlane
cbeb3bb213
EPUB writer: Fixed some idrefs to match changes in ids.
2014-04-24 17:37:10 -07:00
John MacFarlane
e6333a9d7c
Markdown writer: Use proper escapes to avoid unwanted lists.
...
Previously we used 0-width spaces, an ugly hack.
Closes #980 .
2014-04-24 16:44:49 -07:00
John MacFarlane
d16775e1c7
Render numbers in YAML metadata without decimals when possible.
...
The change to aeson > 0.7 caused numbers to be rendered with
decimals. This change causes them to be rendered without decimals
wehn possible.
2014-04-24 11:09:07 -07:00
Albert Krewinkel
2f724aaaa4
Org reader: Read anchors as empty spans
...
Anchors (like <<this>>) are parsed as empty spans.
2014-04-24 17:57:06 +02:00
Albert Krewinkel
c128daba9d
Org reader: Recognize plain and angle links
...
This adds support for plain links (like http://zeitlens.com ) and angle
links (like <http://moltkeplatz.de >).
2014-04-24 17:55:24 +02:00
Albert Krewinkel
ec24f9761c
RST reader: Remove duplicate 'http' in PEP links
...
The generated link to PEPs had a duplicate 'http://' in its URL.
2014-04-24 17:55:22 +02:00
John MacFarlane
e0688711fd
EPUB writer: include extension in epub ids.
...
This fixes a problem with duplicate extensions for fonts and
images with the same base name but different extensions.
Closes #1254 .
2014-04-23 10:23:02 -07:00
John MacFarlane
6a2361c457
Merge pull request #1256 from tarleb/org-reader-improvements
...
Org reader improvements
2014-04-19 20:35:41 -07:00
Albert Krewinkel
8276449520
Org reader: Allow for compact definition lists
...
Use `Text.Pandoc.Shared.compactify'DL` to allow for compact definition
lists.
2014-04-19 15:13:16 +02:00
Albert Krewinkel
efebade38b
Move compactify'DL
from Markdown reader into Shared
...
The function `compactify'DL`, used to change the final definition item of a
definition list into a `Plain` iff all other items are `Plain`s as well, is
useful in many parsers and hence moved into Text.Pandoc.Shared.
2014-04-19 15:03:33 +02:00
Albert Krewinkel
8e91d362a3
Org reader: Fix parsing of footnotes
...
Footnotes can consist of multiple blocks and end only at a header or at
the beginning of another footnote. This fixes the previous behavior,
which restricted notes to a single paragraph.
2014-04-19 14:40:46 +02:00
Albert Krewinkel
a69416091b
Org reader: Fix distinction of images and normal links
...
Fixed a false assumption about the precedence of (&&) vs (||).
2014-04-19 11:25:39 +02:00
Albert Krewinkel
6ded3d41d9
Org reader: Apply captions to code blocks and tables
...
The `Table` blocktype already takes the caption as an argument, while code
blocks are wrapped in a `Div` block together with a labelling `Span`.
2014-04-19 10:41:45 +02:00
Albert Krewinkel
09441b65a8
Org reader: Add support for plain LaTeX fragments
...
This adds support for LaTeX fragments like the following:
```
\begin{equation}
\int fg \mathrm{d}x
\end{equation}
```
2014-04-18 10:22:54 +02:00
Albert Krewinkel
f19d7233d8
Org reader: Fix parsing of loose lists
...
Loose lists (i.e. lists with blankline separated items), were parsed as
multiple lists, each containing a single item. This patch fixes this
issue.
2014-04-18 08:34:06 +02:00
Albert Krewinkel
6d6724cf2c
Org reader: Support more types of '#+BEGIN_<type>' blocks
...
Support for standard org-blocks is improved. The parser now handles
"HTML", "LATEX", "ASCII", "EXAMPLE", "QUOTE" and "VERSE" blocks in a
sensible fashion.
2014-04-17 18:33:39 +02:00
Albert Krewinkel
0672f58a44
Org reader: Support footnotes
2014-04-17 13:23:14 +02:00
Albert Krewinkel
92582c6272
Org reader: introduce Reader environment around Blocks/Inlines
...
This introduces a Reader environment in the style of
Text.Pandoc.Parsing.F, but adapted to the Org reader parser.
2014-04-16 13:38:50 +02:00
Albert Krewinkel
5fc252270c
Org reader: Fix code for subexpression parsing
2014-04-16 13:26:32 +02:00
Albert Krewinkel
346bcea713
Org reader: Better module description, minor style changes
...
Use module description analogous to the markdown reader's.
Use (<$) where it makes sense.
2014-04-16 13:23:30 +02:00
John MacFarlane
7f036c0b57
Shared: Fixed bug in toRomanNumeral.
...
9 and numbers ending in 9 would end with "IXIV."
Thanks to Jesse Rosenthal. Closes #1249 .
2014-04-15 19:53:58 -07:00
John MacFarlane
857fcff7d6
Merge pull request #1240 from neilmayhew/master
...
Docbook output of Line Blocks
2014-04-13 14:37:28 -07:00
John MacFarlane
86b4da9dec
Merge pull request #1239 from tarleb/org-linebreak
...
Org linebreaks
2014-04-13 14:04:48 -07:00
John MacFarlane
d5d4227ea5
Merge pull request #1238 from tarleb/org-figures
...
Org reader: Add support for figures
2014-04-13 14:03:15 -07:00
John MacFarlane
d4c1cd456c
Org reader: Removed ANN pragma.
...
This relies on Template Haskell, which causes problems in Windows
due to libraries with C dependencies. We need to avoid using TH
in pandoc code.
2014-04-12 21:44:54 -07:00
Neil Mayhew
464d7a8e49
Improve handling of hard line breaks in Docbook writer
...
* Use a <literallayout> for the entire paragraph, not just for the
newline character
* Don't let LineBreaks inside footnotes influence the enclosing
paragraph
2014-04-12 09:16:07 -06:00
Albert Krewinkel
82d4160bdc
Org reader: Read linebreaks
...
Linebreaks are marked by the string `\\` at the end of a line.
2014-04-12 11:07:38 +02:00
Albert Krewinkel
36066699c3
Org writer: Fix output for linebreaks
...
Hard linebreaks in Org mode are represented by the string "\\" as the
last characters in a line. Adds this feature to the Org-mode writer.
2014-04-12 10:47:49 +02:00
Albert Krewinkel
ae4280fba5
Org reader: Add support for figures
...
Support for figures (images with name and caption) is added.
2014-04-12 10:31:45 +02:00
John MacFarlane
8699071ec2
HTML reader: Treat processing instructions & declarations as block.
...
Previously these were treated as inline, and included in paragraph
tags in HTML or DocBook output, which is generally not what is wanted.
Closes #1233 .
2014-04-11 10:10:54 -07:00
Albert Krewinkel
6f19be7d40
Org reader: Fix parsing of sub-/superscript expressions
...
This fixes the org-reader's handling of sub- and superscript
expressions. Simple expressions (like `2^+10`), expressions in
parentheses (`a_(n+1)`) and nested sexp (like `a_(nested()parens)`) are
now read correctly.
2014-04-11 11:05:42 +02:00
John MacFarlane
ca40acea5b
MediaWiki reader: Handle table rows containing just an HTML comment.
...
Closes #1230 .
2014-04-10 16:52:30 -07:00
Albert Krewinkel
ace8837cd6
Org reader: Improve code by following HLint recommendations
...
HLint's recommendations for better code are applied to the Org-mode
reader code.
2014-04-10 19:17:58 +02:00
Albert Krewinkel
1715d7cee0
Org reader: Support more inline/display math variants
...
Support all of the following variants as valid ways to define inline or
display math inlines:
- `\[..\]` (display)
- `$$..$$` (display)
- `\(..\)` (inline)
- `$..$` (inline)
This closes #1223 . Again.
2014-04-10 15:32:02 +02:00
John MacFarlane
54e33a132b
Merge pull request #1226 from tarleb/org-emphasis-reader
...
Org reader: Precise rules for the recognition of markup
2014-04-09 09:34:44 -07:00
Albert Krewinkel
030020236c
Org reader: Precise rules for the recognition of markup
...
The inline parsers have been rewritten using the org source code as a
reference. This fixes a couple of bugs related to erroneous markup
recognition.
2014-04-09 15:26:06 +02:00