aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2018-01-18Powerpoint writer: Implement syntax highlightingJesse Rosenthal2-24/+82
This also necessitated implementing colors and underlining, though there is currently no way to produce these from markdown. Note that background colors can't be implemented in PowerPoint, so highlighting styles that require these will be incomplete.
2018-01-18Clean up T.P.W.OOXML file, and add copyright.Jesse Rosenthal1-41/+40
2018-01-18Powerpoint writer: Make our own docProps/core.xml file.Jesse Rosenthal2-11/+37
This allows us to set document metadata properties from pandoc metadata.
2018-01-18Powerpoint writer: Add docProps to Presentation datatype.Jesse Rosenthal2-12/+39
This picks up the necessary information from meta and carries it over to the XML output, so Output.hs doesn't need access to the original pandoc information.
2018-01-17Powerpoint writer: Link notes to endnotes slide.Jesse Rosenthal1-19/+25
2018-01-17Powerpoint writer: Use more specific slide id names.Jesse Rosenthal1-3/+33
2018-01-17Powerpoint writer: Use slideids to simplify code.Jesse Rosenthal2-60/+91
2018-01-17Powerpoint writer: Revamp slide typeJesse Rosenthal2-48/+97
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-17Powerpoint writer: Change reference to notesSlide to endNotesSlideJesse Rosenthal1-11/+11
This will prevent confusion when speakers notes are implemented.
2018-01-17Powerpoint writer: Move image sizing into picProps.Jesse Rosenthal2-12/+27
Rather than passing around attributes, we can have image sizing in the picProps and then pass it along to write to XML.
2018-01-16Markdown writer: fix cell width calculation.John MacFarlane1-1/+1
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-16LaTeX writer: escape & in lstinlineRobert Schütz1-1/+1
2018-01-15ConTeXt writer: Use xtables instead of Tables (#4223)Henri Menke1-26/+72
- 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-15Powerpoint writer: Improve table placement.Jesse Rosenthal1-9/+5
2018-01-15Powerpoint writer: Make our own _rels/.rels file.Jesse Rosenthal1-21/+43
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-15Powerpoint writer: Import reference-doc images properly.Jesse Rosenthal1-2/+2
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-15Powerpoint writer: Move Presentation.hs out of PandocMonadJesse Rosenthal2-35/+39
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-15Powerpoint writer: Ignore anchor links to nowehere.Jesse Rosenthal1-3/+6
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-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-14Powerpoint writer: Refactor into separate modules.Jesse Rosenthal3-1979/+2151
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-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-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-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-12Powerpoint writer: Include Notes slide in TOCJesse Rosenthal1-19/+42
2018-01-12Powerpoint writer: allow setting toc-title in metadata.Jesse Rosenthal1-2/+5
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-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-09HTML writer: Fixed footnote backlinks with --id-prefix.John MacFarlane1-1/+1
Closes #4235.
2018-01-05Update copyright notices to include 2018Albert Krewinkel32-65/+65
2018-01-04Powerpoint writer: remove some code duplication.Jesse Rosenthal1-10/+3
2018-01-03Powerpoint writer: Ignore Notes divJesse Rosenthal1-0/+1
For now, ignore notes div for parity with other slide outputs.
2018-01-03Powerpoint writer: Set default slidelevel correctly.Jesse Rosenthal1-1/+2
We had previously defaulted to slideLevel 2. Now we use the correct behavior of defaulting to the highest level header followed by content. We change an expected test result to match this behavior.
2018-01-03Powerpoint writer: Split blocks correctly for linked imagesJesse Rosenthal1-10/+15
We treat links with an image as the first inline as an image with a link picProp -- so we have to split on it the same as if it were an image.
2018-01-03Powerpoint writer: combine adjacent runs.Jesse Rosenthal1-2/+19
This will make the xml easier to read for debugging purposes. It should also make links behave more consistently across numerous words.
2018-01-03Powerpoint writer: Fix new replaceNamedChildrenJesse Rosenthal1-11/+9
Previous version replaced *each* element from the template with the new elements -- leading to multiple overlapping frames. This only replaces the first instance, and throws out the rest.
2018-01-03PowerPoint writer: make inline code inherit code size.Jesse Rosenthal1-6/+6
Previously (a) the code size wasn't set when we force size, and (b) the properties was set from the default, instead of inheriting. Both of those problems were fixed.