Commit graph

6430 commits

Author SHA1 Message Date
John MacFarlane
a5ac58f82f MediaWiki reader: use _ instead of - in auto-identifiers.
Partially addresses #4731.
We may not still be exactly matching mediawiki's algorithm
for identifiers.
2019-01-25 17:10:49 -08:00
John MacFarlane
2e7cfe1bba LaTeX writer: add # special characeters for listings.
This character needs special handling in lstinline.
Closes #4939.
2019-01-25 16:49:31 -08:00
John MacFarlane
2f54470266 Ipynb: Put all jupyter metadata under 'jupyter' key. 2019-01-24 16:51:56 -08:00
John MacFarlane
7167330a2a Revert "Prepend jupyter_ to jupyter metadata keys."
This reverts commit 5eaff399d5.
2019-01-24 16:33:03 -08:00
John MacFarlane
b08c8627d3 Allow some command line options to take URL in addition to FILE.
`--include-in-header`, `--include-before-body`, `--include-after-body`
2019-01-24 16:21:57 -08:00
John MacFarlane
22b09d88ff Ms writer: ensure we have a newline after .EN in disply math.
Closes #5251.
2019-01-24 16:09:14 -08:00
John MacFarlane
5eaff399d5 Prepend jupyter_ to jupyter metadata keys.
This avoids conflics with things like 'toc'.
2019-01-24 09:35:42 -08:00
John MacFarlane
09b6dca763 Removed superfluous import. 2019-01-23 10:08:08 -08:00
John MacFarlane
395ea03069 Support ipynb (Jupyter notebook) as input and output format.
[API change]

* Depend on ipynb library.

* Add `ipynb` as input and output format.

* Added Text.Pandoc.Readers.Ipynb (supports both nbformat v3 and v4).

* Added Text.Pandoc.Writers.Ipynb (supports nbformat v4).

* Added ipynb readers and writers to T.P.Readers,
  T.P.Writers, and T.P.Extensions.  Register the
  file extension .ipynb for this format.

* Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error.

* Note: there is no template for ipynb.
2019-01-22 21:45:59 -08:00
John MacFarlane
5ddd7b121e LaTeX reader: support \endinput. Closes #5233. 2019-01-22 21:39:26 -08:00
Brian Leung
509336d866 Man reader: fix typo. (#5245) 2019-01-22 20:50:25 -08:00
John MacFarlane
f86ac89383 HTML and markdown: treat textarea as a verbatim environment.
We don't want to parse its contents as Markdown or HTML.

Closes #5241.
2019-01-21 20:54:12 -08:00
John MacFarlane
11810edb2f LaTeX reader: allow includes with dots like cc_by_4.0.
Previously the `.0` was interpreted as a file extension,
leading pandoc not to add `.tex` (and thus not to find the
file).

The new behavior matches tex more closely.
2019-01-20 18:22:19 -08:00
John MacFarlane
26dfab2e61 LaTeX reader: cleaned up 'input' code. 2019-01-20 17:35:51 -08:00
Agustín Martín Barbero
fb1f76ddee odt writer: fix typo in custom properties (#5231)
fixes #2839
2019-01-17 16:09:25 -08:00
John MacFarlane
24a0d613a8 Make raw content marked beamer work in beamer output.
See pandoc/lua-filters#40.
2019-01-10 12:00:34 -08:00
John MacFarlane
dfd1796cf2 Make 'plain' RawBlocks work for 'plain' output. 2019-01-10 11:55:21 -08:00
Brian Leung
35971495ab RST reader: change treatment of number-lines directives. (#5207)
Directives of this type without numeric inputs should not have a
`startFrom` attribute; with a blank value, the writers can produce
extra whitespace.
2019-01-09 22:19:26 -08:00
John MacFarlane
7e481d73cf Beamer writer: avoid duplicated fragile property in some cases.
Closes #5208.
2019-01-09 08:36:24 -08:00
John MacFarlane
253f342a80 EPUB writer: ensure that picture transforms are done on metadata too. 2019-01-08 16:19:54 -08:00
John MacFarlane
8673eb079b Removed superfluous sourceCode class on code blocks.
* These were added by the RST reader and, for literate Haskell,
  by the Markdown and LaTeX readers.  There is no point to
  this class, and it is not applied consistently by all readers.
  See #5047.

* Reverse order of `literate` and `haskell` classes on code blocks
  when parsing literate Haskell. Better if `haskell` comes first.
2019-01-08 11:36:33 -08:00
John MacFarlane
230e07ddfc RST reader: handle sourcecode directive as synonynm for code.
Closes #5204.
2019-01-08 11:11:48 -08:00
John MacFarlane
599327bee1 Asciidoc writer: shorter delimiters for tables, blockquotes.
This matches asciidoctor reference docs.

Closes #4364.
2019-01-07 22:10:34 -08:00
John MacFarlane
c1d058aeb1 revealjs writer: fix some section nesting corner cases.
* Ensure that we don't get > 2 levels of section nesting,
  even with slide level > 2.
* If slide level == N but there is no N-level header, make
  sure the next header with level > N gets treated as a slide
  and put in a section, rather than remaining loose.

Closes #5168.
2019-01-07 21:54:14 -08:00
John MacFarlane
710a22e5ac Org reader: allow for case of :minlevel == 0.
See #5190.
2019-01-07 20:39:40 -08:00
Brian Leung
9dbcf16161 Org reader: handle minlevel option differently. (#5190)
When `minlevel` exceeds the original minimum level observed in the
file to be included, every heading should be shifted rightward.
2019-01-07 20:28:47 -08:00
John MacFarlane
f9d9880325 TWiki reader: fix performance issue with underscores.
Underscore emphasis can't cross table cell boundaries,
but the parser wasn't respecting this, leading to exponential
behavior in documents with table cells containing underscores.

This fixes the original sample; it's possible that there
are other performance issues involving underscores.

Closes #3921.
2019-01-07 20:24:22 -08:00
Alexander
40c30a9d88 Add DokuWiki reader (#5108)
Closes #1792
2019-01-06 15:06:32 -08:00
John MacFarlane
a5f5002eef Use toTableOfContents in Powerpoint writer....
instead of duplicating code.
2019-01-04 21:47:24 -08:00
John MacFarlane
571fede732 RTF writer: use toTableOfContents from T.P.W.Shared. 2019-01-04 21:27:49 -08:00
John MacFarlane
c4c3fca500 Implement --toc in commonmark/gfm writers.
Closes #5172.
2019-01-04 21:20:21 -08:00
John MacFarlane
0d609a72fd T.P.Writers.Shared - add toTableOfContents (API change).
This is refactored out from the Markdown writer.
IT can be used in other writers to create a generic TOC.
2019-01-04 21:09:49 -08:00
Mauro Bieg
f1d83aea12 Implement task lists (#5139)
Closes #3051
2019-01-02 11:36:37 -08:00
John MacFarlane
9097ec41a9 EPUB writer: small fixes to nav.xhtml.
* Add 'landmarks' id attribute to the landmarks nav.
* Replace old default CSS removing numbers from ol.toc li
  with new rules that match `nav#toc ol, nav#landmarks ol`.
* We keep the `toc` class on `ol` for backwards compatibility.
2019-01-02 11:24:53 -08:00
John MacFarlane
ea8af33dab Commonmark writer: fix handling of SoftBreak with hard_line_breaks.
This should be rendered as a space.
Closes #5195.
2019-01-02 10:31:13 -08:00
damien clochard
4ab2a46bdc Zimwiki writer: remove automatic colon prefix before internal images (#5183)
* FIX #5183 : zimwiki : remove automatic colon prefix before internal images

![](foo.png) should be converted to {{foo.png}} (relative path)
![](/foo.png] should be converted to {{/foo.png}} (absolute path)

Therefore the ':' prefix is useless and must be removed.

I never used the zimwiki, but i submitted the similar dokuwiki fix.

1. The zimwiki syntax is inspired by dokuwiki
2. The zimwiki documentation does not mention the colon character for images
3. The pandoc zimwiki writer seems to be a copy-paste for the dokuwiki writer

If the PR #5184 is applied, I think this one should be applied too.
2019-01-01 14:08:38 -08:00
damien clochard
814e97df92 Dokuwiki writer: remove automatic ':' prefix before internal image links (#5183)
* FIX #5183 : remove automatic ':' prefix before internal image links

`![](foo.png)` should be converted to `{{foo.png}}` (relative path)
`![](/foo.png]` should be converted to `{{/foo.png}}` (absolute path)

Therefore the ':' prefix is useless and must be removed.
It blocks users from making relative image links.

Update tests for DokuWiki Writer : external images
2019-01-01 14:07:26 -08:00
Albert Krewinkel
2f92261d87
Org reader: fix self-link parsing regression
Fixes a regression introduced by the previous commit.
2019-01-01 22:06:44 +01:00
Albert Krewinkel
c0caaaeabb
Org reader: fix treatment of links to images
Links with descriptions which are pointing to images are no longer read
as inline images, but as proper links.

Fixes: #5191
2019-01-01 21:03:38 +01:00
Albert Krewinkel
af887e9198
Org reader: hlint 2019-01-01 20:49:51 +01:00
Alexander
792f18a7fa Remove unused HasHeaderMap (#5175)
It is updated by some readers, but never actually used.
2018-12-31 21:41:21 -08:00
John MacFarlane
ffc2192caf Simplify/fix reading of --metadata values on command line.
Previously we used HsYAML's decodeStrict to recognize
boolean values (treating everything else as a string).
This caused problems relating to hvr/HsYAML#7.

We now just check for the recognized boolean values
`true|True|TRUE|false|False|FALSE`, and avoid using
HsYAML.

Closes #5177.
2018-12-31 21:20:56 -08:00
Mauro Bieg
c8b79b0a04 Replace read with safeRead (#5186)
closes #5180
2018-12-31 15:26:38 -08:00
John MacFarlane
a1ad5bb8ce Allow '-' in filenames for custom lua writers.
Closes #5187.
2018-12-31 15:15:18 -08:00
John MacFarlane
5cd48c8e79 Removed obsolete and misleading comment. 2018-12-31 15:07:42 -08:00
leungbk
c998b937c1 Org writer: preserve line-numbering for example and code blocks. 2018-12-28 15:07:05 +01:00
Alexander Krotov
fd0f041a13 Decompress .svgz when converting to "data:" URI
Address #5163
2018-12-18 11:47:48 +03:00
John MacFarlane
595e954c9b LaTeX reader: Support \DeclareMathOperator.
Closes #5149.
2018-12-17 11:47:28 -08:00
John MacFarlane
404e96761a Replace read with safeRead. Closes #5162. 2018-12-17 10:31:09 -08:00
John MacFarlane
90c820dc4e Parsing: use safeRead instead of read. 2018-12-17 10:21:30 -08:00