Commit graph

2660 commits

Author SHA1 Message Date
John MacFarlane
c7f6f77908 Support Sphinx-style math in RST writer.
http://sphinx.pocoo.org/latest/ext/math.html
2011-12-30 23:51:49 -08:00
John MacFarlane
d8272d0356 Support Sphinx style math in RST reader.
Inline:  :math:`E=mc^2`

Block:

.. math: E = mc^2

.. math::

   E = mc^2

   a = b^2

(This latter will turn into a paragraph with two
display math elements.)

Closes #117.
2011-12-30 23:46:43 -08:00
John MacFarlane
661d0646d0 Updated context tests. 2011-12-30 18:22:09 -08:00
John MacFarlane
da6c25a7d9 Removed header 1 property from ConTeXt tests.
It didn't work with new ids.
2011-12-30 18:21:54 -08:00
John MacFarlane
3e526918f8 Fixed layout bug in ConTeXt and LaTeX writers.
This was a regression introduced by the recent internal
links changes.
2011-12-30 16:28:44 -08:00
John MacFarlane
3f981022a6 Updated latex tests. 2011-12-30 16:28:33 -08:00
John MacFarlane
506a5b07d1 LaTeX writer: only use hyperdef on section if there's a link to it. 2011-12-30 16:14:35 -08:00
John MacFarlane
a561135386 README: header identifiers now work in LaTeX, ConTeXt as well as HTML.
Patch from B. Scott Michel.
2011-12-30 14:34:54 -08:00
John MacFarlane
2c1569a0da Added support for internal links in ConTeXt writer.
Based on a patch by B. Scott Michel.

Also simplified use of \hyphenateurl. We no longer try to go within
an Inline list to find URLs.  This is resource-heavy, and the main
use case is autolinks, which can be readily recognized.
2011-12-30 14:32:49 -08:00
John MacFarlane
e3dfb2646d Add support for internal links to LaTeX writer.
Based on a patch by B. Scott Michel.
2011-12-30 14:30:45 -08:00
John MacFarlane
209ba0fa6c LaTeX template: color links blue. 2011-12-30 14:29:48 -08:00
B. Scott Michel
a5ee02c659 ConTeXt writer: Add section labels and internal links as in HTML.
Add the ability to refer to internal links to the ConTeXt writer, just
like the HTML writer can. The 'hierarchicalize' function generates
unique names for sections, which can be used for references in ConTeXt,
just as they can be in HTML.

The ConTeXt writer adds these unique identifiers to each \section and
does special processing of the Link target to see if it starts with a
'#' (hash symbol), which is the tip-off that the link is an internal
link.
2011-12-30 13:10:15 -08:00
John MacFarlane
83680430b3 Updated ConTeXt tests. 2011-12-30 13:05:04 -08:00
John MacFarlane
673c044a15 HTML writer: Better handling of authors in meta tags.
Footnotes and email addresses now come out in a more pleasing
way.

Modified from a patch by B. Scott Michel.
2011-12-30 13:03:31 -08:00
John MacFarlane
edf646a90d ConTeXt writer: Made --toc work even without --number-sections. 2011-12-30 11:42:05 -08:00
John MacFarlane
c5c7aa653a README: Added link for HTML 5. 2011-12-30 11:27:28 -08:00
John MacFarlane
352ee2dc4f Small tweaks to hyphenatedurl patch.
Use isURI instead of isAbsoluteURI, as it also matches
absolute URIs with '#...' at the end.
2011-12-30 11:08:42 -08:00
B. Scott Michel
80ba468535 ConTeXt_url_hyphenation
Deeply scan through the [Inline] associated with a Link and ensure that
all URLs are hyphenated using SYB primitives.
2011-12-30 10:48:57 -08:00
John MacFarlane
b76ba44c52 LaTeX writer: Improved detection of book classes.
We now check the `documentclass` variable, and if that is
not set, we look through the template itself.  Also, we
have added the KOMA classes scrreprt and scrbook.

You can now make a book using

    markdown2pdf -V documentclass:book
2011-12-30 09:57:00 -08:00
John MacFarlane
7702d2ca82 EPUB: Get correct environment variable for LANG.
This should fix `<dc:language>` problems.
2011-12-30 09:55:36 -08:00
John MacFarlane
925a4c5164 Better smart quote parsing.
* Added stateLastStrPos to ParserState. This lets us keep track
  of whether we're parsing the position immediately after a 'str'.
  If we encounter a ' in such a location, it must be an apostrophe,
  and can't be a single quote start.

* Set this in the markdown, textile, html, and rst str parsers.

* Closes #360.
2011-12-29 23:44:12 -08:00
John MacFarlane
600c22e7bf Unescape entities in citation refId.
Closes #357.

The refIds coming from citeproc contain XML numeric
entities, and these don't match with the citation keys
parsed by pandoc.  Solution is to unescape them.
2011-12-29 23:11:42 -08:00
John MacFarlane
a4f719abcf Unicode reference ID in biblio test. 2011-12-29 23:11:25 -08:00
John MacFarlane
6c7bffb544 Updated tests for changes to HTML note back references. 2011-12-29 22:11:14 -08:00
John MacFarlane
a0a31979ff Merge pull request #366 from gridaphobe/master
Use Link instead of RawInline for reference backlinks
2011-12-29 22:00:54 -08:00
John MacFarlane
31fb776c32 DZSlides: Added dzslides/template.html.
This is the unaltered file from the dzslides repository.
Pandoc now reads it, looking for the core part, and includes
this in the new dzslides template via the 'dzslides-core'
variable.

When dzslides is updated, you can just put the new
template.html in your `~/.pandoc/dzslides` directory,
and things should work -- provided the core part can
be identified as everything from

    <!-- {{{{ dzslides core

to the end of the file.

This should make it a bit easier to keep up to date.
2011-12-29 17:41:06 -08:00
John MacFarlane
cd190be09e Made --version informative about versions of dependencies. 2011-12-29 14:17:10 -08:00
John MacFarlane
763a9610cd Better formatting for list of highlighting languages. 2011-12-29 14:03:39 -08:00
John MacFarlane
0aa6269b04 Added "beamer" a few places where we test for latex. 2011-12-29 13:58:13 -08:00
John MacFarlane
f74c40b460 Don't use --smart automatically with man output.
Previously pandoc used smart mode automatically when `man`
output was selected.
2011-12-29 13:54:21 -08:00
John MacFarlane
febbf5d818 Better formatting of input/output formats in --help. 2011-12-29 13:53:25 -08:00
John MacFarlane
cdb01e6d54 Made html5 and html5+lhs output formats.
Deprecated the `--html5`/`-5` flag. Use the output format
instead.
2011-12-29 13:39:03 -08:00
John MacFarlane
ea39a607ed Added 'beamer' as an output format.
Beamer output uses the default LaTeX template, with some
customizations via variables.

Added `writerBeamer` to `WriterOptions`.

Added `--beamer` option to `markdown2pdf`.
2011-12-29 13:26:04 -08:00
John MacFarlane
012405e8c3 Preserve attributes in highlighted HTML.
The container element will have the classes, id, and
key-value attributes you specified in the delimited code
block.

Previously these were stripped off.
2011-12-28 22:04:38 -08:00
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