John MacFarlane
3c93ac5cf0
LaTeX reader: be more tolerant of &
character.
...
This allows us to parse unknown tabular environments
as raw LaTeX. Closes #4208 .
2017-12-28 08:41:53 -08:00
Albert Krewinkel
e5c8b65004
Org reader: support minlevel option for includes
...
The level of headers in included files can be shifted to a higher level
by specifying a minimum header level via the `:minlevel` parameter. E.g.
`#+include: "tour.org" :minlevel 1` will shift the headers in tour.org
such that the topmost headers become level 1 headers.
Fixes : #4154
2017-12-28 14:16:04 +01:00
Alexander Krotov
0fd7ed0cab
FB2 writer: add cover image specified by "cover-image" meta
...
Fixes #4195
2017-12-28 16:03:18 +03:00
Jesse Rosenthal
52a4cf6699
PowerPoint writer: Obey slide level option
2017-12-28 07:47:07 -05:00
John MacFarlane
ba6c193457
Fix warning.
2017-12-27 13:38:44 -08:00
John MacFarlane
f688086979
Small improvement to figcaption parsing. #4184 .
2017-12-27 12:38:04 -08:00
John MacFarlane
acfa846aab
Merge pull request #4184 from mb21/html-reader-figcaption
...
HTML Reader: be more forgiving about figcaption
2017-12-27 13:33:00 -07:00
John MacFarlane
a888083ee1
HTML reader: parse div with class line-block
as LineBlock.
...
See #4162 .
2017-12-27 12:26:15 -08:00
John MacFarlane
cc9e3a9172
Allow --list-extensions
to take an optional FORMAT argument.
...
This lists the extensions set by default for the selected
FORMAT.
2017-12-27 12:25:48 -08:00
John MacFarlane
8a35b44aaf
Allow lenient decoding of *latex error logs.
...
These sometimes aren't properly UTF8 encoded, and it's
confusing if we get an encoding error due to the error
log.
Closes #4200 .
2017-12-27 11:37:35 -08:00
Albert Krewinkel
2953983e9e
Fix regression of DefinitionLists in custom writer
...
Pairs where serialized as two-element lists instead, and are now pushed
again as a table with a single key/value pair.
Fixes : #4202
2017-12-27 18:48:52 +01:00
Jesse Rosenthal
dc3ee500a0
Docx Reader: preprocess Document body to unwrap "w:sdt" elements
...
We walk through the document (using the zipper in
Text.XML.Light.Cursor) to unwrap the sdt tags before doing the rest of
the parsing of the document. Note that the function is generically
named `walkDocument` in case we need to do any further preprocessing
in the future.
Closes #4190
2017-12-27 10:03:00 -05:00
Albert Krewinkel
7e8cfc0990
Fix custom writer regression
...
An additional `Lua.call` was left in during refactoring, which caused an
exception "attempt to call a nil value".
Fixes : #4202
2017-12-27 09:16:33 +01:00
John MacFarlane
b52cbb71c2
LaTeX writer: Allow fragile=singleslide attribute in beamer slides.
...
Closes #4169 .
2017-12-26 11:17:32 -08:00
John MacFarlane
b5ae537321
Add opus to MIME type table as audio/ogg.
...
See #4198 .
2017-12-26 11:03:03 -08:00
John MacFarlane
9e1d86638c
LaTeX reader: support \foreignlanguage
from babel.
2017-12-26 10:57:57 -08:00
John MacFarlane
718b2c5837
HTML writer: Use br elements in line blocks...
...
instead of relying on CSS. Closes #4162 . HTML-based templates have had
the custom CSS for div.line-block removed. Those maintaining custom
templates will want to remove this too.
We still enclose line blocks in a div with class line-block.
2017-12-26 08:40:33 -08:00
John MacFarlane
ee5fe9bf2c
RST reader: allow empty list items (as docutils does).
...
Closes #4193 .
2017-12-24 13:02:18 -08:00
John MacFarlane
c7e5543c29
JATS reader: handle author-notes.
2017-12-23 22:28:43 -08:00
John MacFarlane
4612a9a8c1
JATS reader: code refactoring.
2017-12-23 21:54:06 -08:00
John MacFarlane
0d1546328e
Plain writer: don't linkify table of contents.
2017-12-23 21:30:10 -08:00
John MacFarlane
dd3ec34a34
Fixed bug: when target is PDF, writer extensions were being ignored.
...
E.g. `-t latex-smart -o file.pdf` would produce a different
latex intermediate than `-t latex-smart -o file.tex`.
Thanks to Bernhard Fisseni for pointing this out.
This is a regression since pandoc 2.0 (introduced in commit
c7e3c1ec
).
2017-12-23 21:10:33 -08:00
Albert Krewinkel
59a4745457
Lua modules: add function pandoc.utils.hierarchicalize
...
Convert list of Pandoc blocks into (hierarchical) list of Elements.
2017-12-23 23:29:24 +01:00
John MacFarlane
790dc2546b
JATS reader: include institute metadata.
2017-12-23 10:20:13 -08:00
John MacFarlane
6b63b63f30
JATS reader: process author metadata.
2017-12-23 10:03:13 -08:00
Albert Krewinkel
2c66a42ab8
Lua modules: add function pandoc.utils.normalize_date
...
The function parses a date and converts it (if possible) to "YYYY-MM-DD"
format.
2017-12-23 13:43:22 +01:00
Albert Krewinkel
35f0567a8f
Lua modules: add function pandoc.utils.to_roman_numeral
...
The function allows conversion of numbers below 4000 into roman
numerals.
2017-12-23 13:42:35 +01:00
John MacFarlane
dd39959453
JATS reader: better citation handling.
...
We now convert a ref-list element into a list of
citations in metadata, suitable for use with pandoc-citeproc.
We also convert references to pandoc citation elements.
Thus a JATS article with embedded bibliographic information
can be processed with pandoc and pandoc-citeproc to produce
a formatted bibliography.
2017-12-23 00:46:48 -08:00
mb21
9b54b94612
HTML Reader: be more forgiving about figcaption
...
fixes #4183
2017-12-23 09:42:04 +01:00
John MacFarlane
e3c1449ae6
Merge pull request #4189 from mb21/export-blocksToInlines
...
API change: export blocksToInlines' from Text.Pandoc.Shared
2017-12-22 19:05:29 -07:00
John MacFarlane
28b736bf95
latex_macros
extension changes.
...
Don't pass through macro definitions themselves when `latex_macros`
is set. The macros have already been applied.
If `latex_macros` is enabled, then `rawLaTeXBlock` in
Text.Pandoc.Readers.LaTeX will succeed in parsing a macro definition,
and will update pandoc's internal macro map accordingly, but the
empty string will be returned.
Together with earlier changes, this closes #4179 .
2017-12-22 18:03:51 -08:00
John MacFarlane
4a07977715
Markdown reader: improved raw tex parsing.
...
+ Preserve original whitespace between blocks.
+ Recognize `\placeformula` as context.
2017-12-22 18:03:51 -08:00
John MacFarlane
3679d8d0bd
LaTeX reader: use applyMacros in rawLaTeXBlock, rawLaTeXInline.
2017-12-22 18:03:51 -08:00
John MacFarlane
9daf22fa61
LaTeX reader: Refactored inlineCommand.
2017-12-22 18:03:51 -08:00
mb21
add3cf73a9
API change: export blocksToInlines' from Text.Pandoc.Shared
2017-12-22 20:35:00 +01:00
Albert Krewinkel
23edb958db
Lua modules: add stringify function to pandoc.utils
...
The new function `pandoc.utils.stringify` converts any AST element to a
string with formatting removed.
2017-12-22 20:09:37 +01:00
Albert Krewinkel
9ddf84072b
Lua.Util: avoid altering the stack if peeking fails
...
The stack now remains unaltered if `getRawInt` or `getTable` fail. This
is important when those functions are used in an operation that is part
of an Alternative.
Change: minor
2017-12-22 20:08:45 +01:00
John MacFarlane
9758720a24
RST writer: fix anchors for headers.
...
We were missing an `_`.
See #4188 .
2017-12-22 10:36:37 -08:00
Jesse Rosenthal
279c254007
PowerPoint writer: Treat lists inside BlockQuotes as lists
...
We don't yet produce incremental lists in PowerPoint, but we should at
least treat lists inside BlockQuotes as lists, for compatibility with
other slide formats.
2017-12-22 05:32:23 -05:00
John MacFarlane
af04881655
Merge pull request #4177 from stencila/jats-xml-reader
...
Add Basic JATS reader based on DocBook reader
2017-12-21 23:16:03 -07:00
John MacFarlane
32f9dbbae5
Merge branch 'master' of github.com:jgm/pandoc
2017-12-21 21:45:35 -08:00
John MacFarlane
239cfb7f00
Docx writer: ensure that distArchive
is the one that comes with pandoc.
...
Previously a `reference.docx` in `~/.pandoc` (or the user data dir)
would be used instead, and this could cause problems because a
user-modified docx sometimes lacks vital sections that we count
on the `distArchive` to supply.
Closes #4182 .
2017-12-21 21:44:13 -08:00
Hamish Mackenzie
a5d7be075d
JATS writer: Make <p> optional in <td> and <th> ( #4178 )
...
If the contents are single `Plain` block then do not wrap them with
a <p> element.
2017-12-21 22:30:22 -07:00
Hamish Mackenzie
de8c47eae8
jats writer: Self closing tags for empty xref ( #4187 )
2017-12-21 22:29:03 -07:00
Hamish Mackenzie
d853571397
Improve support for code language in JATS
2017-12-22 15:24:54 +13:00
Jesse Rosenthal
3c10951023
Change notes to a smaller size.
...
This will allow more to fit on a single slide, and will probably look better.
2017-12-21 17:01:11 -05:00
Jesse Rosenthal
5b2c38a07d
PowerPoint writer: Add ability to force size.
...
This replaces the more specific blockQuote runProp, which only
affected the size of blockquotes. We can use this for notes, etc.
2017-12-21 17:00:59 -05:00
Albert Krewinkel
bd3ea72371
Lua modules: added pandoc.utils module
...
A new module `pandoc.utils` has been created. It holds utility functions
like `sha1`, which was moved from the main `pandoc` module.
2017-12-21 22:42:59 +01:00
Albert Krewinkel
5ad719c1fb
Lua modules: make a Haskell module for each Lua module
...
Definitions for the `pandoc.mediabag` modules are moved to a separate
Haskell module.
Change: minor
2017-12-21 22:42:59 +01:00
Albert Krewinkel
ab3c506584
Lua modules: move to dedicated submodule
...
The Haskell module defining the Lua `pandoc` module is moved to
Text.Pandoc.Lua.Module.Pandoc.
Change: minor
2017-12-21 22:42:59 +01:00