Commit graph

10053 commits

Author SHA1 Message Date
John MacFarlane
ba4b9db16d Tweaks to lua-filters.md docs 2017-12-26 10:25:05 -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
9dea8a27e2 Use pandoc-citeproc 0.12.2 in binary pgks 2017-12-24 22:47:14 -08:00
John MacFarlane
1d498b0e35 Fixed changelog typo 2017-12-24 21:36:31 -08:00
John MacFarlane
f2812e12eb Update changelog. 2017-12-24 13:48:42 -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
bb5f4c9b22 Add Hamish Mackenzie to authors. 2017-12-23 23:38:10 -08:00
John MacFarlane
2af478c3b5 Bump to 2.0.6. 2017-12-23 23:20:33 -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
Albert Krewinkel
ef4351c4d2
data/init.lua: load pandoc.utils by default 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
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
dd217f75e5
doc/lua-filter.md: document pandoc.utils.stringify
Change: minor
2017-12-22 20:29: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
a848d3e031 Mention JATS output (and input) in MANUAL, README, cabal description. 2017-12-21 22:20:38 -08: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
Mauro Bieg
6ec7e39b4c MANUAL.txt use native syntax for custom-style (#4174) 2017-12-21 12:56:20 -07:00
John MacFarlane
685e90cd4f LaTeX reader: Fixed subtle bug in tokenizer.
Material following `^^` was dropped if it wasn't a character
escape.  This only affected invalid LaTeX, so we didn't see it
in the wild, but it appeared in a QuickCheck test failure
https://travis-ci.org/jgm/pandoc/jobs/319812224
2017-12-21 11:50:55 -08:00
John MacFarlane
117a672c4d Removed default.theme data file.
It is no longer needed now that we have `--print-highlight-style`.
See #4096.
2017-12-21 11:28:38 -08:00
Jesse Rosenthal
c4f58684ee PowerPoint writer: Implement notes
This currently prints all notes on a final slide.

Note that at the moment, there is a danger of text overflowing the
note slide, since there is no logic for adding further slides. A
future commit will shrink the font size on these notes, but that won't
take care of the problem altogether. (We might have to implement some
sort of clumsy page-breaking logic here based on font size and
text-box dimensions, though that seems like a can of worms.)
2017-12-21 12:11:58 -05:00
Jesse Rosenthal
f76b4fc497 PowerPoint writer: Register notes to state.
When we encounter a note, we write it to the state directory of notes,
and input a superscript.
2017-12-21 11:45:08 -05:00
Jesse Rosenthal
d6c9e4f243 Add Note state to PowerPoint writer.
First step toward implementing notes in pptx writer.
2017-12-21 11:35:00 -05:00
Jesse Rosenthal
4d0cb0b2fc Implement basic definition list functionality to PowerPoint writer.
These are currently implemented in terms of a Bold para for the terms,
and then blockquotes for the definitions. THis can be refined a bit in
the future.
2017-12-21 11:09:05 -05:00
Jesse Rosenthal
4e53c7bf55 Don't look for default template file for Powerpoint.
When using readerStandalone, this keeps us from looking for a
non-existent template pptx file.

Closes #4181
2017-12-21 10:35:51 -05:00