Commit graph

843 commits

Author SHA1 Message Date
John MacFarlane
a2cb53640d LaTeX writer: Don't use [fragile] unnecessarily.
We were using [fragile] on slides even if they only contained
code that was rendered using `\texttt`.  Now `[fragile]` is
only used for slides containing inline code if that code
is rendered using listings. Closes #649.
2012-11-04 11:09:42 -08:00
John MacFarlane
569954e1d5 Improved support for MathML in EPUB3.
* MathML math method now used always in EPUB3 (even if another
  math method specified in options).
* epub:switch is used to specify a non-MathML default. This is supposed
  to proide a good fallback behavior in older readers, though I'm
  not sure how well it works in practice.
2012-11-04 10:37:57 -08:00
John MacFarlane
dfca59943d EPUB: Don't use opf:role in EPUB3. 2012-11-02 21:23:02 -07:00
John MacFarlane
afa5a4da67 EPUB: Fixed invalid nesting problem in nav.xhtml. 2012-11-02 21:12:56 -07:00
John MacFarlane
e9542a60b5 EPUB: Added properties attribute. 2012-11-02 21:10:08 -07:00
John MacFarlane
63bed5dc2e HTML writer: Use XHtml5 only if blaze version current enough. 2012-11-02 21:04:32 -07:00
John MacFarlane
5b7d27912a HTML writer: Use Text.Blaze.XHtml5 instead of Html5.
This is needed for epub.
2012-11-02 20:59:45 -07:00
John MacFarlane
927e4b92a6 EPUB: Use HTML5 for epub3. 2012-11-02 20:57:18 -07:00
John MacFarlane
927a9271a5 EPUB: Set epub3 template variable controlling doctype. 2012-11-02 20:53:51 -07:00
John MacFarlane
583ce1073c EPUB writer: Don't create entry for nav.xhtml in EPUB2. 2012-11-02 20:25:55 -07:00
John MacFarlane
76d3c0d028 Fixed a couple validation bugs that affect epub2 also. 2012-11-02 20:14:18 -07:00
John MacFarlane
43448d7d53 Preliminary changes for epub3 format.
* EPUB writer now exports writeEPUB2 and writeEPUB3.
* 'epub' output format is epub v2, while 'epub3'
  is v3.
2012-11-02 17:46:22 -07:00
John MacFarlane
01d109e2ef EPUB writer improvements.
* We now convert to XHTML before cutting into chapter-sized chunks.
  This fixes a number of problems.
* `--number-sections` now works properly.
* A proper three-level table of contents is now used in `toc.ncx`.
  There is no longer a subsidiary table of contents at the beginning
  of each chapter.
* New epub-page template without the `$title$` variable.  Titles are
  left in the chapter bodies as an initial h1.
* Closes #539.
2012-10-11 09:13:09 -07:00
Brent Yorgey
c85d184668 Remove newline after <br/> in translation of LineBreak
There's no particular need for a newline (other than making the
generated MediaWiki source look nice to a human), and in fact
sometimes it is incorrect: in particular, inside an enumeration, list
items cannot have embedded newline characters.
2012-10-04 11:16:54 -04:00
John MacFarlane
3f86127f5a Docx writer: Added nsid to abstractNum elements.
This helps when merging word documents with numbered or bulleted lists.
Closes #627.
2012-10-02 19:43:18 -07:00
John MacFarlane
02bb0f051a Use integer ids for bookmarks.
Closes #626.
2012-10-02 19:20:51 -07:00
John MacFarlane
93e92a4716 Renamed removedLeadingTrailingSpace to trim.
Also removeLeadingSpace to triml,
removeTrailingSpace to trimr.
2012-09-29 17:09:34 -04:00
John MacFarlane
3abc1021aa HTML writer: Use toHtml instead of pre-escaping.
We work around the problem that blaze-html unnecessarily escapes `'`
by pre-escaping just the `'` characters, instead of the whole string.

If blaze-html later stops escaping `'` characters, we can simplify
strToHtml to toHtml.

Note that this change yields a significant speed boost (111ms to 94ms
on one benchmark).

Closes #629.
2012-09-28 11:11:31 -04:00
John MacFarlane
885ef2072f Make --id-prefix affect footnote IDs in markdown writer.
Closes #614.
2012-09-25 20:26:38 -07:00
John MacFarlane
6ad7ac1239 Removed need for utf8-string package.
* Depend on text.
* Expose Text.Pandoc.UTF8.
* Text.Pandoc.UTF8 now exports toString, fromString,
  toStringLazy, fromStringLazy.
* These are used instead of the old utf8-string functions.
2012-09-25 19:54:21 -07:00
John MacFarlane
4ab30f3cea Texinfo writer: Fixed internal cross-references.
Now we insert anchors after each header, and use @ref
instead of @uref for links.

Commas are now escaped as @comma{} only when needed; previously
all commas were escaped.  (This change is needed, in part, because @ref
commands must be followed by a real comma or period.)

Also insert a blank line in from of @verbatim environments.
2012-09-24 19:13:34 -07:00
John MacFarlane
12045d84b6 Revert "More intelligent handling of text encodings."
This reverts commit 7272735b3d.
2012-09-23 22:53:34 -07:00
John MacFarlane
7272735b3d More intelligent handling of text encodings.
Previously, UTF-8 was enforced for both input and output.

The new system:

* For input, UTF-8 is tried first; if an error is raised, the
  locale encoding is tried.
* For output, the locale encoding is always used.
2012-09-23 22:12:21 -07:00
John MacFarlane
e1be934dc2 LaTeX writer: Don't rely on the enumerate package.
Instead, use standard LaTeX commands to change numbering style.
2012-09-16 22:24:55 -07:00
John MacFarlane
1e2b20f8bc LaTeX writer: Properly escape strings inside \url{}.
Closes #576.
2012-09-16 11:20:53 -07:00
John MacFarlane
23e1a25014 RST writer: Fixed hyperlinked images.
* Use :target: field when you have a simple linked image.
* Don't wrap the reference.
* Cleaned up code.
* Closes #611.
2012-09-16 11:09:36 -07:00
John MacFarlane
1461693159 LaTeX writer: Don't escape _ in hyperref identifiers. 2012-09-15 20:50:43 -07:00
John MacFarlane
d9e34ce34d LaTeX writer: don't escape _ in url. 2012-09-15 20:43:36 -07:00
John MacFarlane
fc4ae15337 LaTeX writer: Don't use \endhead with longtable.
It causes the heading to be a different size form the body,
sometimes.
2012-09-15 20:40:48 -07:00
John MacFarlane
0851f8d592 Markdown writer: Made sensitive to Ext_hard_line_breaks. 2012-09-15 19:19:47 -04:00
John MacFarlane
502242b9a0 LaTeX writer: Use longtable instead of ctable. 2012-09-15 17:55:01 -04:00
John MacFarlane
880af86556 EPUB writer: Use ch001, ch002, etc. for chapter filenames.
This improves sorting of chapters in some readers, which
apparently sort ch2 after ch10.  Closes #610.
2012-09-13 08:59:33 -07:00
John MacFarlane
bf77889e19 HTML writer: Don't print <dt> unless term is non-empty. 2012-09-12 17:44:13 -07:00
John MacFarlane
bad3c88cb6 HTML writer: Improve line breaks with <dd> tags.
We now put a newline between `</dd>` and `<dd>` when
there are multiple definitions.
2012-09-12 08:45:03 -07:00
John MacFarlane
c544f20d6f Made --id-prefix work in DocBook as well as HTML.
Closes #607.
2012-09-06 09:25:52 -07:00
John MacFarlane
6f0b465173 Docx writer: Fixed bug with nested lists.
Previously a list like

    1. one
        - a
        - b
    2. two

would come out with a bullet instead of "2."
Thanks to Russell Allen for reporting the bug.
2012-09-05 16:24:37 -07:00
John MacFarlane
c554c61907 EPUB: Use title instead of "Title Page" in contents.
Otherwise we have a hard-coded English string, which looks
strange in ebooks written in other languages.  Using the
title for this entry seems a good solution.  Closes #572.
2012-08-25 21:36:43 -07:00
John MacFarlane
a6dcae1648 Merge commit 'd25656571a4662a4e67b195daed69e77d80c4c2c'
Conflicts:
	src/Text/Pandoc/Writers/ODT.hs
2012-08-23 19:39:58 -07:00
John MacFarlane
d7e658c643 Don't strip meta and link elements in epub metadata.
Per
http://idpf.org/epub/30/spec/epub30-publications.html#sec-metadata-elem,
a metadata element can contain not just Dublin Core elements but also
meta and link elements, but Pandoc currently strips those out.

Patch from aberrancy. Closes #589.
2012-08-23 19:09:56 -07:00
John MacFarlane
dc8e5970bf Implemented Ext_backtick_code_blocks.
This is the variant github prefers.
2012-08-21 20:11:10 -07:00
John MacFarlane
dc6a133dbf Added Ext_fenced_code_attributes. 2012-08-21 19:35:36 -07:00
John MacFarlane
b985d33406 Changed nomenclature, delimited -> fenced code blocks. 2012-08-21 19:21:51 -07:00
John MacFarlane
5d3b295568 Man writer: Escape - as \-.
Unescaped -'s become hyphens, while \-'s are left as ascii
minus signs.  That is preferable for use with command-line
options.

See  http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html.
Thanks to Andrea Bolognani for bringing the issue to our
attention.
2012-08-18 10:29:15 -07:00
John MacFarlane
fd616665ac Docx line breaks: Use w:cr in w:r instead of w:br.
This seems to fix a problem viewing pandoc-generated
docx files in LibreOffice.
2012-08-17 18:27:48 -07:00
John MacFarlane
e8e8468d69 Implemented Ext_mmd_title_block in markdown reader & writer. 2012-08-12 19:27:13 -07:00
John MacFarlane
5d83751af4 Implemented tex_math extensions in markdown writer. 2012-08-11 22:24:06 -07:00
John MacFarlane
e520762543 Implemented Ext_markdown_attribute in markdown writer. 2012-08-11 22:04:37 -07:00
John MacFarlane
a740de0508 Use safeRead instead of using reads directly (various modules). 2012-08-09 08:11:28 -07:00
John MacFarlane
dfa4b76630 Changes to literate haskell options.
- Removed writerLiterateHaskell from WriterOptions.
- Removed readerLiterateHaskell from ReaderOptions.
- Added Ext_literate_haskell to Extensions.  Test for this
  instead of the above.
- Removed failUnlessLHS from Shared.

Note:  At this point, +lhs and .lhs extension no longer has any effect.
Need to fix.
2012-08-08 23:18:19 -07:00
John MacFarlane
dc071f807d Markdown writer: Tables now sensitive to table extension options.
Ext_simple_table, Ext_multiline_tables, Ext_pipe_tables.
Simple tables are preferred over pipe tables when both are
enabled.  If no appropriate table style is available,
a raw HTML table is used.

So far there is no option for output of grid tables.
2012-08-05 10:23:30 -07:00