Commit graph

1786 commits

Author SHA1 Message Date
John MacFarlane
9c40535c47 EPUB writer: Temporary step towards a better system for numbering.
With this change, `--number-sections` won't work.  This will
be fixed later.
2013-02-23 18:51:58 -08:00
John MacFarlane
8b8c8cfed9 HTML writer: fix case when writerNumberOffet is empty or short.
We add 0s to the end of the list if it's shorter than needed.
2013-02-23 18:51:33 -08:00
John MacFarlane
756c8d492a --number-from -> --number-offset
Also `writerNumberFrom` -> `writeNumberOffset`.
The offset is a list of numbers (0 by default).
These are added to the section, subsection, etc.
numbers that would have been generated automatically.
2013-02-23 18:11:05 -08:00
John MacFarlane
a7245b453c EPUB writer: Minor section numbering tweaks.
* If we need to add an initial section, make it unnumbered.
* Don't add extra space before unnumbered section titles in TOC.
2013-02-22 20:38:56 -08:00
John MacFarlane
a33828f375 EPUB writer: Use writerNumberFrom instead of ugly hack. 2013-02-22 19:45:39 -08:00
John MacFarlane
9b190ec3db Made HTML writer sensitive to writerNumberFrom. 2013-02-22 19:15:38 -08:00
John MacFarlane
8df380486c Added --number-from option and writerNumberFrom.
These still aren't hooked up to anything in the writers.
2013-02-21 21:40:06 -08:00
John MacFarlane
07e8cedf2b Make implicit_header_references work with explicit header ids.
(Markdown reader.)
2013-02-21 19:53:35 -08:00
John MacFarlane
7a97369d01 LaTeX reader: Don't emit empty paragraph.
See #761.
2013-02-20 13:01:50 -08:00
John MacFarlane
3f2dd98f45 LaTeX reader: Parse \section*, etc. as unnumbered sections. 2013-02-20 09:59:31 -08:00
John MacFarlane
83521c18e9 ConTeXt writer: now sensitive to 'unnumbered' class in headers.
In this case \title, \subject are used instead of \chapter,
\section.
2013-02-18 10:55:08 -08:00
John MacFarlane
5e9145bb62 Textile reader: Handle attributes on headers.
Includes `[lang]`, `(class #id)`, `{color:red}` styles.
2013-02-16 18:29:12 -08:00
John MacFarlane
8dd00b93e2 LaTeX writer: Omit lists with no items.
Otherwise we get LaTeX errors.
2013-02-16 17:47:45 -08:00
John MacFarlane
eca8c6043b EPUB writer: Fix section numbering.
Previously the numbering restarted from 1 in each chapter
(with `--number-sections`), though the numbers in the table
of contents were correct.

Note that this fix is a bit hackish and possibly fragile:
if the rendering of section numbers in HTML changes in the
future, it may break.  But it works, without needing
changes in other modules.
2013-02-16 17:36:39 -08:00
John MacFarlane
14b64ed46c HTML reader: Preserve all header attributes. 2013-02-16 17:01:44 -08:00
John MacFarlane
cc410a71b5 Allow & in emails (for entities).
Added tests for entities in titles and links.
Closes #723.
2013-02-15 23:02:17 -08:00
John MacFarlane
59764fa388 Parsing: uri, email: resolve entities.
A markdown link `<http://g&ouml;ogle.com>` should
be a link to http://göogle.com.
2013-02-15 22:39:49 -08:00
John MacFarlane
5491adbfdb Markdown reader: litChar now includes entities.
We no longer need to use fromEntities on titles.
2013-02-15 20:27:29 -08:00
John MacFarlane
11f7407445 LaTeX writer: Include unnumbered sections in TOC. 2013-02-15 19:23:51 -08:00
John MacFarlane
0d1fa0a763 Implemented "unnumbered" headers in LaTeX writer.
Starred variants of section commands used when header
has "unnumbered" class.
2013-02-14 19:50:11 -08:00
John MacFarlane
90f0dd15b6 HTML writer: Support header attributes.
Note:  The attributes go on the enclosing section or div
if `--section-divs` is specified.

Also fixed a regression (only now noticed) in html+lhs output.
Previously the bird tracks were being omitted.
2013-02-14 19:35:58 -08:00
John MacFarlane
cdee226586 hierarchicalize: Do not number section with class "unnumbered".
Unnumbered sections get [] for their section number.
So far only the HTML writer has been adjusted to be sensitive
to this.

If we keep this change, all the writers will need to be changed
either (a) to directly check for the "unnumbered" class, if they
do section numbering themselves, or (b) to check for a null section
number, if they use hierarchicalize.
2013-02-13 08:49:48 -08:00
John MacFarlane
a50b83266c HTML writer: Refactored adding attributes to html element. 2013-02-12 21:29:17 -08:00
John MacFarlane
5330e63421 Shared: Changed type of Element.
Sec now includes a field for Attr rather than just String
(the identifier).

Note, this is an API change.
2013-02-12 20:13:23 -08:00
John MacFarlane
a49ecc9fe7 Markdown reader: Fix title block parsing.
Now if mmd_title_blocks is specified, pandoc will parse a
MMD title block if it sees one, even if pandoc_title_blocks is enabled.
2013-02-12 19:55:37 -08:00
John MacFarlane
35cc1d99ca Markdown reader: Make backslash escape work in attributes. 2013-02-12 11:27:42 -08:00
John MacFarlane
ea9b7a4a52 Markdown reader: Fixed bug parsing key/value attributes.
Parsing failed if you had an unquoted attribute immediately
before the final '}'.
2013-02-12 11:20:36 -08:00
John MacFarlane
0e03962615 LaTeX reader: Parse \hrule as HorizontalRule.
Closes #746.
2013-02-11 17:39:52 -08:00
John MacFarlane
3465ba2f61 UTF8: Strip off BOM if present.
Closes #743.
2013-02-08 09:45:25 -08:00
John MacFarlane
57e4f5644f Revert "Citation changes."
This reverts commit d46f434d4b.
2013-02-06 13:14:37 -08:00
John MacFarlane
8dfbe3bbe8 Implement --default-image-extension for LaTeX reader. 2013-02-06 08:36:29 -08:00
John MacFarlane
1a2eea23a1 Merge branch 'citations' 2013-02-05 22:04:53 -08:00
John MacFarlane
c5f1a8ad2d Added --default-image-extension and readerDefaultImageExtension.
Note: Currently this only affects the markdown reader.
2013-02-05 20:08:00 -08:00
John MacFarlane
d46f434d4b Citation changes.
* Citations will work in markdown even if `--biblio` isn't
  specified.  Note:  this may cause unexpected behavior for people
  who use strings of the form `@foo` that are not citations!
* If `--biblio` isn't used, the markdown writer will write markdown
  citations rather than CSL-rendered citations.
* This means, for example, that you can do `pandoc -f latex -t markdown`
  and convert biblatex or natbib citations into pandoc citations.
2013-02-03 10:30:48 -08:00
John MacFarlane
e148fd7547 Removed unneeded blanklines in pipeTable parser. 2013-02-02 19:07:11 -08:00
John MacFarlane
a6c167125f Optimized oneOfStringsCI.
The call to toLower in ciMatch was very expensive (and very often
used), because toLower from Data.Char calls a fully unicode
aware function.  This optimization avoids the call to toLower
for the most common, ASCII cases.  This dramatically reduces the
speed penalty that comes from enabling the `autolink_bare_uris`
extension.  The penalty is still substantial (in one test, from 0.33s
to 0.44s), but nowhere near what it used to be.
2013-02-02 18:46:10 -08:00
John MacFarlane
92acb24486 HTML reader: Handle colgroup tag. 2013-01-30 10:05:53 -08:00
John MacFarlane
f53e0a44ce DocBook writer: for linebreak, but newline in literallayout.
Closes #725.
2013-01-28 11:18:05 -08:00
John MacFarlane
8c55023d18 Fixed latex macro parsing.
Now latex macro definitions are preserved when output is latex,
and applied when it is another format, as originally intended.

Partially addresses #730.
\providecommand is still not supported.  For this we need changes
to texmath.
2013-01-28 10:50:58 -08:00
John MacFarlane
229c22582f LaTeX writer: Avoid extra space at start/end of table cell.
Thanks to Nick Bart for the suggestion of using @{}.
2013-01-28 10:21:18 -08:00
John MacFarlane
c50af7341e Markdown writer: Set title, author, date variables as before.
These are no longer used in the default template, since we use
titleblock, but we set them anyway for nondefault template users.
2013-01-28 10:10:23 -08:00
John MacFarlane
29a17b1767 Merge pull request #733 from jrunningen/master
Mediawiki reader: Don't require blanklines after tables.
2013-01-28 09:42:59 -08:00
John MacFarlane
72d11ad20b Markdown/RST reader: Skip blank lines.
This fixes a subtle regression involving grid tables with
empty cells.  Closes #732.

Also added test for grid table with empty cells.
2013-01-27 22:13:05 -08:00
Jeff Runningen
efddb85d46 Mediawiki reader: Don't require blanklines after tables. 2013-01-27 23:15:46 -05:00
John MacFarlane
9d549ab683 RST writer: Use .. code:: language for code blocks with language.
Closes #721.
Also fixed whitespace in lhs tests.
2013-01-26 16:12:11 -08:00
John MacFarlane
2f50406c7f Markdown writer: Use autolink when link text matches url.
Previously we also checked for a null title, but this
test fails for links produced by citeproc-hs in bibliographies.

So, if the link has a title, it will be lost on conversion
to an autolink, but that seems okay.
2013-01-26 14:01:50 -08:00
John MacFarlane
b6dc21bacf Markdown reader: Simplified and sped up str parser.
We no longer needed the smart quote complexity, because of
improvements to singleQuoteStart and singleQuoteEnd.

And we were able to move the check for intraword underscore
to the emphasis parser.
2013-01-25 23:30:27 -08:00
John MacFarlane
c18fd7e643 RST reader: Allow anonymous form of explicit links.
`hello <url>`__
Closes #724.
2013-01-25 21:10:02 -08:00
John MacFarlane
ce4b7fc416 Changed copyright date range on Markdown reader. 2013-01-25 19:53:18 -08:00
John MacFarlane
52a6ec7297 Minor code cleanup. 2013-01-25 19:50:34 -08:00