Commit graph

2676 commits

Author SHA1 Message Date
John MacFarlane
4fd9fb9ea2 EPUB: Correctly handle internal links.
Previously they were ignored.  Now all links are preserved,
but purely internal links are modified so that they point
to the proper place in the EPUB.

This is nontrivial, since the heading you refer to in your
markdown source with 'my-section-1' might end up as
'ch16.xhtml#my-section' in the EPUB.

Closes #76.
2011-12-28 19:40:03 -08:00
John MacFarlane
af3e07f227 Made --highlight-style and --no-highlight work in markdown2pdf. 2011-12-27 23:52:03 -08:00
John MacFarlane
16629bf1ce Added --highlight-style and --no-highlight options. 2011-12-27 23:46:47 -08:00
John MacFarlane
3122959064 Highlighting: Add language as class name.
This restores behavior of 1.8.2.1. Adjusted tests.
2011-12-27 22:24:31 -08:00
John MacFarlane
70b4ec95e4 Updated tests. 2011-12-27 18:08:06 -08:00
John MacFarlane
35fc88ef93 Updated templates; changes for new highlighting-kate. 2011-12-27 18:07:54 -08:00
John MacFarlane
a579e2c892 Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings. 2011-12-27 15:45:34 -08:00
John MacFarlane
8838f473a8 LaTeX reader: Return Str instead of Apostrophe. 2011-12-27 11:19:23 -08:00
John MacFarlane
4f76fe5a1d Markdown reader: Improved previous patch to allow unicode apostrophe. 2011-12-27 11:01:34 -08:00
John MacFarlane
8f1da35917 Pretty: return Str with unicode instead of Apostrophe. 2011-12-27 11:01:10 -08:00
John MacFarlane
de79021543 EPUB writer: Make external (absolute) links active. 2011-12-26 23:18:32 -08:00
John MacFarlane
dd96267626 Modified str parser to capture apostrophes in smart mode.
This solves a problem stemming from the fact that a parser
doesn't know what came *before* in the input stream.

Previously pandoc would parse

D'oh l'*aide*

as containing a single quoted "oh l", when both `'`s should
be apostrophes.  (Issue #360.)  There are two issues here.

(a) It is obvious that the first `'` is not an open quote,
becaues of the preceding `D`. This patch solves the problem.

(b) It is obvious to us that the second `'` is not an
open quote, because we see that *aide* is some text.
But getting a good algorithm that has good performance is
a bit tricky.  You can't assume that `'` followed by `*`
is always an apostrophe:

*'this is quoted'*

This patch does not fix (b).
2011-12-26 23:04:45 -08:00
John MacFarlane
765a777582 Added some failing test cases for apostrophes in French. 2011-12-26 23:03:20 -08:00
John MacFarlane
45958de0e1 Updated highlighting for highlighting-kate 0.4.
Text.Pandoc.Highlighting now exports just one new function,
'highlight', and reexports all the other functions from
highlighting-kate that are used in the writers.  This should
make it easy to switch highlighting engines if that is ever
desired.
2011-12-26 22:49:50 -08:00
Eric Seidel
6cd20c98fd change reference backlink from RawInline to Link so it gets rendered properly when using the xmlhtml package 2011-12-24 21:49:38 -06:00
John MacFarlane
cc18291baf LaTeX writer: Support highlighting for inline code. 2011-12-23 18:37:52 -08:00
John MacFarlane
77815c63db LaTeX writer: Have LHS files set the "listings" variable. 2011-12-23 18:26:03 -08:00
John MacFarlane
3fa98607db LaTeX writer: Implemented syntax highlighting for CodeBlocks. 2011-12-23 18:05:14 -08:00
John MacFarlane
c20d4e86be Updated 'Tested-With' field. 2011-12-22 22:25:57 -08:00
John MacFarlane
8a61700f9e Merge pull request #364 from aslatter/master
Update package description for GHC 7.4
2011-12-22 22:11:50 -08:00
Antoine Latter
1c854ea5c3 tests: update package description to build with GHC 7.4 2011-12-22 17:24:24 -05:00
Antoine Latter
08e8adaf01 Update build depends for GHC 7.4 2011-12-22 16:49:14 -05:00
John MacFarlane
fca95bf43c Removed highlighting flag. Highlighting support is now standard. 2011-12-22 13:24:43 -08:00
John MacFarlane
f61e09cb9a Added writerHighlight to WriterOptions. 2011-12-22 13:12:08 -08:00
John MacFarlane
b892b29eac Removed writerAscii in WriterOptions.
No longer needed or used.
2011-12-22 11:41:35 -08:00
John MacFarlane
7046cef263 Changed types of highlighting functions.
* highlightLaTeX, highlightHtml now return Maybe, not Either.
* This is because h-k's higdlightAs no longer returns an Either.
2011-12-22 00:33:38 -08:00
John MacFarlane
1cefff6319 Updated s5 tests. 2011-12-20 11:37:32 -08:00
John MacFarlane
c54c678864 S5 template: Added titleslide class to title slide. 2011-12-20 11:37:14 -08:00
John MacFarlane
6636b894d1 Added a newline at end of footnotes ol. 2011-12-20 11:36:51 -08:00
John MacFarlane
5ff7f81b85 Restore xhtml style self-closed tags in HTML writer.
This requires blaze-html >= 0.4.3.0.
2011-12-20 11:26:10 -08:00
John MacFarlane
8bf890d7e4 Setup: Making man pages now works with cabal-dev.
In Setup.hs we now invoke 'runghc' in a way that points
it to the correct package databases, instead of always
falling back to the default user package db.

Thanks to Antoine Latter for the patch.
2011-12-19 22:09:08 -08:00
John MacFarlane
569fc4c67a Added highlightLaTeX stub when not compiled w/ highlighting. 2011-12-19 21:59:53 -08:00
John MacFarlane
a936e5d34f Added highlightLaTeX to Text.Pandoc.Highlighting. 2011-12-19 11:51:17 -08:00
John MacFarlane
5e38d6a689 HTML writer: Put classes "section" and "level[1-6]" on section divs.
(In HTML 5, the "section" class is omitted, since the tag itself
is "section.")
2011-12-18 13:09:58 -08:00
John MacFarlane
fba4f1f37e EPUB: Added customizable templates for epub pages.
epub-page.html, epub-coverimage.html, epub-titlepage.html.
2011-12-18 12:33:44 -08:00
John MacFarlane
1a22e75352 HTML writer: Retain ID attribute in highlighted code blocks. 2011-12-18 12:33:11 -08:00
John MacFarlane
f0e0e1e5d4 Highlighting: Use reads instead of read.
Fixes crash on startNum="abc".
2011-12-18 11:42:24 -08:00
John MacFarlane
bfa5ca01bc HTML writer: Use <del> for strikeout. 2011-12-18 11:08:04 -08:00
John MacFarlane
1c521519d9 HTML writer: Don't escape '.
This requires using a custom string escaper. If we use toHtml
from Blaze, we get &#39;, which is pointless unless you're
writing attributes in single quotes.
2011-12-17 23:58:15 -08:00
John MacFarlane
eaa41a677a Fixed line breaks in tds in table cells. 2011-12-17 23:52:59 -08:00
John MacFarlane
89c962a18c Use blaze-html instead of xhtml for HTML generation.
* This is a breaking API change for `writeHtml`.
* It introduces a new dependency on blaze-html.
* Pandoc now depends on highlighting-kate >= 0.4, which
  also uses blaze-html.
* The --ascii option has been removed, because of differences
  in blaze-html's and xhtml's escaping.
* Pandoc will no longer transform leading newlines in code
  blocks to `<br/>` tags.
2011-12-17 22:46:03 -08:00
John MacFarlane
d78e9c1dac Updated HCAR-Pandoc.tex. 2011-12-13 16:30:43 -08:00
John MacFarlane
78816497f3 Use pandoc-types 1.9.*. 2011-12-13 14:29:07 -08:00
John MacFarlane
bab0c333a0 Added -rtsopts to profiling options. 2011-12-13 14:28:57 -08:00
John MacFarlane
412580c223 EPUB: Don't use any decimal entities.
kindlegen doesn't like them - even &#39;.
It should be safe to use the unescaped ' character, since
we know that all attributes are double quoted in the relevant
files.
2011-12-13 08:13:27 -08:00
John MacFarlane
d8d68c5110 EPUB writer: made unEntity handle errors better. 2011-12-12 09:17:54 -08:00
John MacFarlane
bdb7648de2 Fixed previous patch so it doesn't swallow a character! 2011-12-12 09:02:26 -08:00
John MacFarlane
1adb807407 EPUB: Use UTF-8 rather than decimal entities.
This addresses a problem with kindlegen pointed out by
Axel Kielhorn.
2011-12-12 00:12:44 -08:00
John MacFarlane
9f9a57de19 Markdown reader: Fixed backslash escapes in reference links.
Closes #312.
2011-12-05 21:33:47 -08:00
John MacFarlane
7512c9dd12 Fixed tests for escapes in markdown titles, URLs. 2011-12-05 21:33:40 -08:00