Commit Graph
10312 Commits
Author SHA1 Message Date
Alexander Krotov ab85143e8a Muse reader: refactor list parsing
Now list item contents is parsed as blocks,
without resorting to parseFromString.

Only the first line of paragraph has to
be indented now, just like in Emacs Muse
and Text::Amuse.

Definition lists are not refactored yet.

See also: issue #3865.
2018-01-18 02:17:26 +03:00
Alexander Krotov d7f0ecfdd8 Muse reader: code cleanup 2018-01-18 02:17:26 +03:00
Jesse Rosenthal 588af3cc78 Powerpoint writer: Link notes to endnotes slide. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal 42e690d1b2 Powerpoint writer: Use more specific slide id names. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal 0d53efeddb Powerpoint writer: Use slideids to simplify code. 2018-01-17 16:40:32 -05:00
Jesse Rosenthal 63a2507d0e Powerpoint writer: Revamp slide type
This is an internal change to the Presentation type. The algebraic
datatype that used to be called `Slide` is now `Layout`, and Slide is
defined as `Slide SlideId Layout (Maybe Notes)`. Though there should
be no user-visible changes in this commit, it offers two benefits
moving forward:

1. Slides now carry their Id with them, instead of being assigned it
in deck order. This makes it easier to set up a link to, say, an
endnotes slide ahead of time.

2. This makes room for Notes slides, when we implement them.
2018-01-17 16:40:32 -05:00
John MacFarlane 80528eaeb6 Improve changelog redability. 2018-01-17 12:28:19 -08:00
John MacFarlane 422c0d8dd1 Update man page. 2018-01-17 11:06:43 -08:00
John MacFarlane 8ec82f89f8 Update changelog. 2018-01-17 11:02:39 -08:00
John MacFarlane 1bc2186425 Version to 2.1.1. 2018-01-17 10:21:02 -08:00
John MacFarlane ca8cd38bdc Markdown reader: don't coalesce adjacent raw LaTeX blocks...
if they are separated by a blank line.

See lierdakil/pandoc-crossref#160 for motivation.
2018-01-17 09:22:35 -08:00
Jesse Rosenthal fcbec16e57 Powerpoint writer: Change reference to notesSlide to endNotesSlide
This will prevent confusion when speakers notes are implemented.
2018-01-17 08:32:52 -05:00
Jesse Rosenthal 0482edadbd Powerpoint writer: Move image sizing into picProps.
Rather than passing around attributes, we can have image sizing in the
picProps and then pass it along to write to XML.
2018-01-17 08:32:52 -05:00
Jesse Rosenthal c1014167b5 ImageSize: add derived Eq instance to Dimension 2018-01-17 08:32:52 -05:00
John MacFarlane d987a9d114 Markdown writer: fix cell width calculation.
Previously we could get ever-lengthening cell widths
when a table was run repeatedly through `pandoc -f markdown -t
markdown`.  This patch stabilizes the relative cell
widths. Closes #4265.
2018-01-16 23:13:33 -08:00
John MacFarlane 24acb714c1 Merge pull request #4271 from dotlambda/lstinline-ampersand
LaTeX writer: escape & in lstinline
2018-01-16 21:30:22 -07:00
Jesse Rosenthal 004f60bf26 Docx reader: Add test for hyperlinks in instrText tag
This is difficult to recreate with a modern version of Word, so I'm
using the file submitted with the bug report. It would be preferable
to find a smaller example with Latin characters, though, so as not to
confuse the issue being tested.
2018-01-16 13:22:02 -05:00
Jesse Rosenthal 95d602d3b7 Docx reader: Parse hyperlinks in instrText tags
This was a form of hyperlink found in older versions of word. The
changes introduced for this, though, create a framework for parsing
further fields in MS Word (see the spec, ECMA-376-1:2016, §17.16.5,
for more on these fields).

Closes #3389 and #4266.
2018-01-16 13:22:02 -05:00
Jesse Rosenthal ae8c0cdba8 Docx reader: Parse instrText info in fldChar tags.
We introduce a new module, Text.Pandoc.Readers.Docx.Fields which
contains a simple parsec parser. At the moment, only simple hyperlink
fields are accepted, but that can be extended in the future.
2018-01-16 13:22:02 -05:00
Jesse Rosenthal 404706d29a Docx reader: Parse fldChar tags
This will allow us to parse instrTxt inside fldChar tags.
2018-01-16 13:22:02 -05:00
Robert Schütz b2268b1fc7 LaTeX writer: escape & in lstinline 2018-01-16 16:34:39 +01:00
John MacFarlane 551d8e8541 Reduce compiler noise (exact paths for compiled modules). 2018-01-15 20:59:21 -08:00
n3fariox f5f0b76636 HTML reader: Fix col width parsing for percentages < 10% (#4262)
Rather than take user input, and place a "0." in front, actually
calculate the percentage to catch cases where small column sizes
(e.g. `2%`)  are needed.
2018-01-15 21:46:12 -07:00
Henri Menke 6910267abf ConTeXt writer: Use xtables instead of Tables (#4223)
- Default to xtables for context output.
- Added `ntb` extension (affecting context writer only) to use Natural Tables instead.
- Added `Ext_ntb` constructor to `Extension` (API change).
2018-01-15 18:38:33 -07:00
Jesse Rosenthal c6a55f8e9f Powerpoint writer: Improve table placement. 2018-01-15 15:51:58 -05:00
Jesse Rosenthal e408ae6278 Powerpoint writer: Make our own _rels/.rels file.
The toplevel .rels file could have a thumbnail image if taken from the
template. Rather than removing it from the inherited file, it's easier
to just make our own.
2018-01-15 15:35:06 -05:00
Jesse Rosenthal f79a6f1163 Powerpoint writer: Import reference-doc images properly.
There was a glob error that was leading to images from the
reference-doc pptx not being imported. We don't need a glob here --
just replace it with `isPrefixOf`.
2018-01-15 14:48:35 -05:00
John MacFarlane 4b7bc40e8b Renaming: Json -> JSON in modules and functions. 2018-01-15 10:46:40 -08:00
John MacFarlane f114153481 Merge pull request #4227 from tarleb/lua-run-json-filter
Run JSON filters from Lua filters
2018-01-15 11:43:46 -07:00
Jesse Rosenthal b010113f3f Powerpoint writer: Move Presentation.hs out of PandocMonad
We don't need it for anything but the log messages, and we can just
keep track of that in state and pass it along to the `writePowerpoint`
function. This will simplify the code.
2018-01-15 10:01:59 -05:00
Jesse Rosenthal a7d131cf44 Powerpoint writer: Ignore anchor links to nowehere.
We don't convert a '#target' ExternalTarget to an InternalTarget if
`target` is not in the AnchorMap. We just remove the link. This
prevents broken links in the Powerpoint output.
2018-01-15 08:56:20 -05:00
John MacFarlane 0e16155aaf Remove custom prelude and ghc 7.8 support. 2018-01-14 23:31:49 -08:00
John MacFarlane a1397ee081 Revert "Custom prelude - only export <> from Data.Monoid."
This reverts commit 01ea3edf0f.
2018-01-14 23:23:48 -08:00
John MacFarlane 01ea3edf0f Custom prelude - only export <> from Data.Monoid. 2018-01-14 23:04:47 -08:00
John MacFarlane 39f3d67848 Fix import. 2018-01-14 22:57:05 -08:00
John MacFarlane 2cd5b55d51 Fix cabal to use base-compat with ghc < 7.10. 2018-01-14 22:50:46 -08:00
Jesse Rosenthal 3156722ac4 Powerpoint writer: Fix anchor links.
They were broken when I refactored (the Output module wanted to use
state left over from the construction of the Presentation type). This
change introduces a new type `LinkTarget = InternalTarget |
ExternalTarget`. Internal target points to a slide number, and these
will all be resolved before the Presentation is passed along to the
Output module.
2018-01-14 21:59:06 -05:00
John MacFarlane 2c00540485 Use base-compat for our custom prelude.
This should give us more complete coverage of newer
base features.

See #4255.
2018-01-14 18:34:26 -08:00
John MacFarlane 9184e1a55b Clarified latex_macros extension. 2018-01-14 16:05:13 -08:00
John MacFarlane 615a99c2c2 RST reader: add aligned environment when needed in math.
rst2latex.py uses an align* environment for math in
`.. math::` blocks, so this math may contain line breaks.
If it does, we put the math in an `aligned` environment
to simulate rst2latex.py's behavior.

Closes #4254.
2018-01-14 15:11:11 -08:00
John MacFarlane d9584d73f9 Markdown reader: Improved inlinesInBalancedBrackets.
The change both improves performance and fixes a
regression whereby normal citations inside inline notes
were not parsed correctly.

Closes jgm/pandoc-citeproc#315.
2018-01-14 12:24:21 -08:00
John MacFarlane cd80b8d76f Allow latest QuickCheck. 2018-01-14 12:24:21 -08:00
John MacFarlane 4debcf7bdc LaTeX reader: Advance source position at end of stream. 2018-01-14 12:24:21 -08:00
John MacFarlane e5abee82f2 Shorten unbalanced brackets test.
It was taking a lot of time.
2018-01-14 12:24:21 -08:00
Jesse Rosenthal 431f6166fa Powerpoint writer: Refactor into separate modules.
There are two steps in the conversion: a conversion from pandoc to a
Presentation datatype modeling pptx, and a conversion from
Presentation to a pptx archive. The two steps were sharing the same
state and environment, and the code was getting a bit
spaghetti-ish. This separates the conversion into separate
modules (T.P.W.Powerpoint.Presentation, which defineds the
Presentation datatype and goes Pandoc->Presentation)
and (T.P.W.Pandoc.Output, which goes Presentation->Archive).
Text.Pandoc.Writers.Powerpoint a thin wrapper around the two modules.
2018-01-14 09:39:39 -05:00
Jesse Rosenthal 90dcd0bc87 Powerpoint writer: Avoid overlapping blocks in column output.
Just as a slide can't have an image and text on the same slide because
of overlapping, we can't have both in a single column. We run
splitBlocks on the text in the column and discard the rest.
2018-01-14 01:50:16 -05:00
Jesse Rosenthal 64c4451ef3 Powerpoint writer: Position images correctly in two-column layout.
You can have two images side-by-side, or text alongside an image. The
image will be fit correctly within the column.
2018-01-14 01:50:16 -05:00
Jesse Rosenthal 1577289672 Powerpoint writer: Make content shape retrieval environment-aware
We put `getContentShape` and `getContentShapeSize` inside the P monad,
so that we can (in the future) make use of knowledge of what slide
environment we're in to get the correct shape. This will allow us, for
example, to get individual columns for a two-column layout, and place
images in them appropriately.
2018-01-14 01:50:16 -05:00
John MacFarlane e7d95cadf5 LaTeX reader: pass through macro defs in rawLaTeXBlock...
even if the `latex_macros` extension is set.
This reverts to earlier behavior and is probably safer
on the whole, since some macros only modify things in
included packages, which pandoc's macro expansion can't
modify.

Closes #4246.
2018-01-13 22:12:32 -08:00
John MacFarlane 485535464d LaTeX reader: fixed pos calculation in tokenizing escaped space. 2018-01-13 22:04:55 -08:00