aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-01-14Custom prelude - only export <> from Data.Monoid.John MacFarlane1-1/+1
2018-01-14Fix import.John MacFarlane1-2/+2
2018-01-14Fix cabal to use base-compat with ghc < 7.10.John MacFarlane1-2/+7
2018-01-14Powerpoint writer: Fix anchor links.Jesse Rosenthal2-60/+81
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-14Use base-compat for our custom prelude.John MacFarlane2-16/+7
This should give us more complete coverage of newer base features. See #4255.
2018-01-14Clarified `latex_macros` extension.John MacFarlane1-4/+7
2018-01-14RST reader: add aligned environment when needed in math.John MacFarlane3-3/+20
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-14Markdown reader: Improved inlinesInBalancedBrackets.John MacFarlane4-14/+29
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-14Allow latest QuickCheck.John MacFarlane1-1/+1
2018-01-14LaTeX reader: Advance source position at end of stream.John MacFarlane1-1/+1
2018-01-14Shorten unbalanced brackets test.John MacFarlane1-1/+1
It was taking a lot of time.
2018-01-14Powerpoint writer: Refactor into separate modules.Jesse Rosenthal4-1979/+2153
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-14Powerpoint writer: Avoid overlapping blocks in column output.Jesse Rosenthal1-2/+10
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-14Powerpoint writer: Position images correctly in two-column layout.Jesse Rosenthal1-45/+33
You can have two images side-by-side, or text alongside an image. The image will be fit correctly within the column.
2018-01-14Powerpoint writer: Make content shape retrieval environment-awareJesse Rosenthal1-28/+48
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-13LaTeX reader: pass through macro defs in rawLaTeXBlock...John MacFarlane4-5/+8
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-13LaTeX reader: fixed pos calculation in tokenizing escaped space.John MacFarlane1-3/+6
2018-01-13Powerpoint writer: Improve image handling.Jesse Rosenthal1-153/+224
We now determine image and caption placement by getting the dimensions of the content box in a given layout. This allows for images to be correctly sized and positioned in a different template. Note that iamges without captions and headers are no longer full-screened. We can't do this dependably in different layouts, because we don't know where the header is (it could be to the side of the content, for example).
2018-01-13data/pandoc.lua: add attr, listAttributes accessorsAlbert Krewinkel2-13/+23
Elements with attributes got an additional `attr` accessor. Attributes were accessible only via the `identifier`, `classes`, and `attributes`, which was in conflict with the documentation, which indirectly states that such elements have the an `attr` property.
2018-01-13data/pandoc.lua: accept single block as singleton listAlbert Krewinkel2-23/+42
Every constructor which accepts a list of blocks now also accepts a single block element for convenience. Furthermore, strings are accepted as shorthand for `{pandoc.Str "text"}` in constructors.
2018-01-13MANUAL: recommend use of `raw_attribute` extension in header includes.John MacFarlane1-0/+11
See #4253.
2018-01-13LaTeX reader: allow macro definitions inside macros.John MacFarlane1-0/+8
Previously we went into an infinite loop with ``` \newcommand{\noop}[1]{#1} \noop{\newcommand{\foo}[1]{#1}} \foo{hi} ``` See #4253.
2018-01-13LaTeX reader: allow macro definitions inside macros.John MacFarlane1-6/+9
Previously we went into an infinite loop with ``` \newcommand{\noop}[1]{#1} \noop{\newcommand{\foo}[1]{#1}} \foo{hi} ``` See #4253.
2018-01-13Powerpoint writer: read presentation size from reference file.Jesse Rosenthal1-29/+45
Our presentation size is now dependent on the reference/template file we use. This will make it easier to set different output sizes by supplying different reference files. The alternative (allowing a user to explicitly set output size regardless of the template) will lead to too many thorny issues, as explicitly set sizes at the various level of powerpoint layout would have to be reset.
2018-01-13data/pandoc.lua: accept singleton inline as a listAlbert Krewinkel2-17/+36
Every constructor which accepts a list of inlines now also accepts a single inline element for convenience.
2018-01-13data/pandoc.lua: drop _VERSIONAlbert Krewinkel1-3/+0
Having a _VERSION became superfluous, as this module is closely tied to the pandoc version, which is available via PANDOC_VERSION.
2018-01-13Powerpoint writer: code cleanupJesse Rosenthal1-7/+0
Last commit accidentally left commented-out code in.
2018-01-13Powerpoint writer: Handle (sub)headers above slidelevel correctly.Jesse Rosenthal1-27/+29
Above the slidelevel, subheaders will be printed in bold and given a bit of extra space before them. Note that at the moment, no distinction is made between levels of headers above the slide header, though that can be changed. (It has to be changed in pandoc, since PowerPoint has no concept of paragraph or character classes.) This allows us to clean up the code as well: the code in `blockToParagraphs` since it will only touch content blocks, and therefore will not deal with headers at or below the slidelevel.
2018-01-13Powerpoint writer: Check for required filesJesse Rosenthal1-71/+30
Since we now import from reference/dist file by glob, we need to make sure that we're getting the files we need to make a non-corrupt Powerpoint. This performs that check. (In the process, this change also cleaned up a lot of commented-out code left from the switch to the new reference-doc method.)
2018-01-12Powerpoint writer: Improve templating using `--reference-doc`Jesse Rosenthal1-69/+145
Templating should work much more reliably now. There is still some problem with image placement when we change sizes. A further commit will address this.
2018-01-12Lua filters: improve error messagesAlbert Krewinkel5-15/+45
Provide more context about the task which caused an error.
2018-01-12Powerpoint writer: Include Notes slide in TOCJesse Rosenthal1-19/+42
2018-01-12Lua filters: make PANDOC_READER_OPTIONS availableAlbert Krewinkel4-11/+63
The options which were used to read the document are made available to Lua filters via the `PANDOC_READER_OPTIONS` global.
2018-01-12Powerpoint writer: allow setting toc-title in metadata.Jesse Rosenthal2-161/+164
Accompanying change in MANUAL.txt
2018-01-12Move `metaValueToInlines` to T.P.W.SharedJesse Rosenthal2-11/+10
This will allow the Powerpoint writer to use it as well.
2018-01-12Powerpoint writer: Set notes slide header with slide-levelJesse Rosenthal1-1/+2
It used to be hardcoded to 2. This will set it to the appropriate slide-level.
2018-01-12Powerpoint writer: Add table of contentsJesse Rosenthal1-2/+33
This is triggered by the `--toc` flag. Note that in a long slide deck this risks overrunning the text box. The user can address this by setting `--toc-depth=1`.
2018-01-12Powerpoint writer: Set notes slide number correctlyJesse Rosenthal1-10/+8
Previously, this hadn't been aware of a metadata slide. We also clarify the logic for setting the startnumber of different slide sections correctly.
2018-01-12Powerpoint writer: Ignore internal links without targets.Jesse Rosenthal1-12/+31
If the user entered an internal link without a corresponding anchor, it would produce a corrupted file. Now we check the anchor map, and make sure the target is in the file. If it isn't, we ignore it.
2018-01-12Powerpoint writer: Clean up adding metadata slideJesse Rosenthal1-6/+8
We want to count the slide numbers correctly if it's in there.
2018-01-12Powerpoint writer: Add anchor linksJesse Rosenthal1-20/+47
For anchor-type links (`[foo](#bar)`) we produce an anchor link. In powerpoint these are links to slides, so we keep track of a map relating anchors to the slides they occur on.
2018-01-12Powerpoint writer: Make the slide number available to the blocks.Jesse Rosenthal1-2/+10
For anchors, block-processing functions need to know what slide number they're in. We make the envCurSlideId available to blocks.
2018-01-12Powerpoint writer: move curSlideId to environment.Jesse Rosenthal1-16/+16
It really isn't a moving state, and that can be misleading.
2018-01-11MANUAL.txt: clarify otherlangs in LaTeX.John MacFarlane1-14/+5
Closes #4072.
2018-01-10LaTeX reader: fix inconsistent column widths.John MacFarlane1-2/+2
This fixes a bug whereby column widths for the body were different from widths for the header in some tables. Closes #4238.
2018-01-10RST reader: better handling for headers with an anchor.John MacFarlane2-2/+45
Instead of creating a div containing the header, we put the id directly on the header. This way header promotion will work properly. Closes #4240.
2018-01-09Fixed a test case so it works on windows too.John MacFarlane1-1/+1
2018-01-09HTML writer: Fixed footnote backlinks with --id-prefix.John MacFarlane2-1/+13
Closes #4235.
2018-01-09Bump criterion upper bound.John MacFarlane1-1/+1
2018-01-09data/pandoc.lua: fix access to Attr componentsAlbert Krewinkel1-6/+4
Accessing an Attr value (e.g., ` Attr().classes`) was broken; the more common case of accessing it via an Inline or Block element was unaffected by this.