aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2018-02-03Muse writer: write image width specified in percent in Text::Amuse modeAlexander Krotov1-2/+7
2018-02-01TEI writer: Use height instead of depth for images.John MacFarlane1-1/+1
Closes #4331.
2018-01-30Muse writer: don't wrap displayMath into <verse>Alexander Krotov1-5/+2
<verse> is a block tag and displayMath is an inline element. Writing <verse> around displayMath could result in nested <verse> tags.
2018-01-29Muse writer: escape nonbreaking space ("~~")Alexander Krotov1-1/+2
2018-01-27Docx writer: make more deterministic to facilitate testingJesse Rosenthal1-10/+16
This will allow us to compare files directly in a golden test. Times are still based on IO, but we will be able to safely skip those. Changes: - `getUniqueId` now calls to the state to get an incremented digit, instead of calling to P.uniqueHash. - we always start the PRNG in mkNumbering/mkAbstractNum with the same seed (1848), so our randoms should be the same each time.
2018-01-27Docx writer: Fix ids in comment writingJesse Rosenthal1-9/+17
Comments from `--track-changes=all` were producing corrupt docx, because the writer was trying to get id from the `(ID,_,_)` field of the attributes, and ignoring the "id" entry in the key-value pairs. We now check both. There is a larger conversation to be had about the right way to treat "id" and "class" entries in kvs, but this fix will correctly interpret the output of the docx reader work.
2018-01-25ConTeXt writer: new section syntax and --section-divs (#4295)Henri Menke1-17/+37
Fixes #2609. This PR introduces the new-style section headings: `\section[my-header]{My Header}` -> `\section[title={My Header},reference={my-header}]`. On top of this, the ConTeXt writer now supports the `--section-divs` option to write sections in the fenced style, with `\startsection` and `\stopsection`.
2018-01-25Dock writer: Fix deletion track changesJesse Rosenthal1-6/+6
This had been mistakenly written as a second insertion function. Closes: #4303
2018-01-23ConTeXt writer: xtables: correct wrong usage of captionHenri Menke1-1/+1
2018-01-22Muse writer: join code with different attributes during normalizationAlexander Krotov1-2/+2
2018-01-22Muse writer: indent lists inside DivAlexander Krotov1-1/+1
2018-01-19Conditional import to avoid warning.John MacFarlane1-2/+5
2018-01-19hlint code improvements.John MacFarlane16-83/+75
2018-01-19remove `blockToRST'` moving its logic into `fixBlocks`danse1-32/+13
2018-01-19in RST writer insert comment between lists and quotes, closes #4248danse1-1/+12
2018-01-19Muse writer: support definitions with multiple descriptionsAlexander Krotov1-4/+7
Muse reader does not support this syntax yet, but Emacs Muse parses it correctly.
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`.