Commit graph

879 commits

Author SHA1 Message Date
John MacFarlane
cae409725f Docx writer: Handle PDF images. 2013-02-23 23:04:42 -08:00
John MacFarlane
dd48e06a4d EPUB writer: Improved behavior with --number-sections.
* Headers with "unnumbered" attribute are not numbered.
  (Nor do they cause an increment in running numbering.)
* Section numbers now work properly, even when there is
  material before the first numbered section.
2013-02-23 20:21:45 -08:00
John MacFarlane
ca6cb04509 EPUB writer: more transition.
Changed toChunks to toChapters.
2013-02-23 19:34:04 -08:00
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
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
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
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
57e4f5644f Revert "Citation changes."
This reverts commit d46f434d4b.
2013-02-06 13:14:37 -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
f53e0a44ce DocBook writer: for linebreak, but newline in literallayout.
Closes #725.
2013-01-28 11:18:05 -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
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
d52a1ec18f Another fix to the CPP macro in EPUB writer. 2013-01-22 08:48:43 -08:00
John MacFarlane
294df9deed Fixed MIN_VERSION - need to sub _ for - in blaze-html. 2013-01-22 08:32:33 -08:00
Jens Petersen
88d0ca8ea7 EPUB: condition Blaze Utf8 module name import on blaze-html version
blaze-html/blaze-markup-0.5 has Text.Blaze.Html.Renderer.Utf8
whereas blaze-html-0.4 has Text.Blaze.Renderer.Utf8.
So this needs to be conditional on the version for pandoc
still be with blaze-html-0.4.x
2013-01-22 10:27:34 +09:00
John MacFarlane
26d30d6d38 Use proportional font for email autolinks with obfuscation.
Closes #714.
2013-01-21 11:28:35 -08:00
John MacFarlane
4ed82686e4 Add data-cites field to citations in HTML5.
This contains a space-separated list of citation IDs.
2013-01-18 12:16:12 -08:00
John MacFarlane
8eab759a9c RTF writer: Added writeRTFWithEmbeddedImages.
* RTF writer:  Export writeRTFWithEmbeddedImages instead of
  rtfEmbedImage.
* Text.Pandoc: Use writeRTFWithEmbeddedImages for RTF.
* Moved code for embedding images in RTF out of pandoc.hs.
2013-01-18 10:33:37 -08:00
John MacFarlane
4aea26e8e1 Convert highlighting-kate language to listings language
if --listings is used.

Closes #704.
2013-01-17 19:47:03 -08:00
John MacFarlane
31fa80fdcb Fixed problem with duplicate ids in epub. 2013-01-16 12:16:49 -08:00
John MacFarlane
7194107733 Implemented Ext_mmd_header_identifiers in markdown writer. 2013-01-16 09:20:48 -08:00
John MacFarlane
fa71969e81 LaTeX writer: Prevent paragraphs containing only linebreaks or spaces. 2013-01-15 23:02:08 -08:00
John MacFarlane
eebed6bc48 Added writerHtmlQTags and --html-q-tags option.
The previous default was to use `<q>` tags in HTML5.
But `<q>` tags are also valid HTML4, and they are not very
robust in HTML5.  Some user agents don't support them,
and some CSS resets prevent pandoc's quotes CSS from working
properly (e.g. bootstrap).  It seems a better default just
to insert quote characters, but the option is provided  for
those who have gotten used to using `<q>` tags.
2013-01-15 18:50:36 -08:00
John MacFarlane
7bc37e4414 Use 'fig:' instead of '\SOH' in title to indicate figure.
Revises 1a4b47e933
2013-01-15 08:46:09 -08:00
John MacFarlane
1a4b47e933 Implemented Ext_implicit_figures.
* In markdown reader, add a '\1' character to the beginning
  of the title of an image that is alone in its paragraph,
  if implicit_figures extension is selected.
* In writers, check for Para [Image alt (src,'\1':tit)] and treat
  it as a figure if possible.
* Updated tests.

This is a bit of a hack, but it allows us to make implicit_figures
an extension of the markdown reader, rather than the writers.
2013-01-14 20:53:08 -08:00
John MacFarlane
45895b561f RST writer: Fixes bug with links with duplicate text.
We now (a) use anonymous links for links with inline URLs, and
(b) use an inline link instead of a reference link if the
reference link would require a label that has already been
used for a different link.

Closes #511.
2013-01-13 23:00:05 -08:00
John MacFarlane
f191aa4a98 RST writer: Properly handle images with no alt text.
Closes #678.
2013-01-13 20:24:34 -08:00
John MacFarlane
a2c93c5a33 RST writer: Allow soft breaks w continuations in line blocks. 2013-01-13 11:15:51 -08:00
John MacFarlane
5ecadd7bfa Use line block in RST writer when a paragraph contains linebreaks.
Previously linebreaks weren't supported in RST, since RST
has no native linebreak construct.
2013-01-13 09:25:56 -08:00
John MacFarlane
15829d5c3a Markdown writer: Support Ext_auto_identifiers and Ext_header_attributes. 2013-01-12 22:44:01 -08:00
John MacFarlane
70e308f2f9 Escape | as \vert in LaTeX math.
This avoids a clash with highlighting-kate's macros, which
redefine | as a short verbatim delimiter.  Thanks to
Björn Peemöller for raising this issue.
2013-01-12 10:21:19 -08:00
John MacFarlane
f07ce6fead Changed hspace in last commit to 0.333em.
This seems to match the spacing of ~ exactly.
2013-01-11 20:44:39 -08:00
John MacFarlane
c29a1942d0 LaTeX writer: Use \hspace* for nonbreaking space after line break.
Since `~` spaces after a line break are just ignored.
Closes #687.
2013-01-11 20:40:00 -08:00
John MacFarlane
98bc0d17ab Revised EPUB writer given changes in header attributes.
We need to ensure that all headers have attributes, since
this is no longer guaranteed by hierarchicalize.
Explicitly given headers remain the same.
2013-01-11 17:07:25 -08:00
John MacFarlane
f3f3638f21 EPUB writer: Download images at URLs. 2013-01-11 17:07:04 -08:00
John MacFarlane
449ddeb53b Refactoring:
* Shared now exports fetchItem (instead of getItem) and openURL
* fetchItem has different parameters than getItem and includes
  some logic formerly in the ODT and Docx writers
* getItem still used in SelfContained
2013-01-11 16:19:06 -08:00
John MacFarlane
8f7beb6d10 ODT, Docx writers: Properly handle URL refs for images.
These images are now downloaded instead of being ignored (as
used to happen in the docx reader) or causing an error (as
used to happen in the odt reader).
2013-01-11 15:45:19 -08:00