aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Powerpoint.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-01-19hlint code improvements.John MacFarlane1-1/+1
2018-01-15Powerpoint writer: Move Presentation.hs out of PandocMonadJesse Rosenthal1-2/+3
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-14Powerpoint writer: Refactor into separate modules.Jesse Rosenthal1-1979/+19
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-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-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
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.
2018-01-03Powerpoint writer: simplify replaceNamedChildren functionJesse Rosenthal1-9/+17
A lot of work in the powerpoint writer is replacing XML from within slidelayouts from templates. This function does a good deal of that work, and this makes it preserve element order, as well as making it a bit easier to understand.
2018-01-03Powerpoint writer: code cleanupJesse Rosenthal1-103/+0
Remove commented-out functions and imports.
2018-01-03Powerpoint writer: Allow linked images.Jesse Rosenthal1-11/+32
The following markdown: [![Image Title](image.jpg)](http://www.example.com) will now produce a linked image in the resulting PowerPoint file.
2018-01-03PowerPoint writer: Fix error with empty table cell.Jesse Rosenthal1-6/+10
We require an empty "<a:p>" tag, even if the cell contains no paragraphs -- otherwise PowerPoint complains of corruption.
2018-01-03Powerpoint writer: Fix compiler error (again)Jesse Rosenthal1-3/+3
The record syntax in a pattern match seems to be confusing the 8.X compilers. Stop using it.
2018-01-03Powerpoint writer: Appease compilerJesse Rosenthal1-8/+11
2018-01-03Powerpoint writer: Implement two-column slides.Jesse Rosenthal1-12/+95
This uses the columns/column div format described in the pandoc manual. At the moment, only two columns (half the screen each) are allowed. Custom widths are not supported.
2017-12-28PowerPoint writer: Obey slide level optionJesse Rosenthal1-0/+3
2017-12-22PowerPoint writer: Treat lists inside BlockQuotes as listsJesse Rosenthal1-1/+13
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-21Change notes to a smaller size.Jesse Rosenthal1-5/+22
This will allow more to fit on a single slide, and will probably look better.
2017-12-21PowerPoint writer: Add ability to force size.Jesse Rosenthal1-2/+6
This replaces the more specific blockQuote runProp, which only affected the size of blockquotes. We can use this for notes, etc.
2017-12-21PowerPoint writer: Implement notesJesse Rosenthal1-2/+30
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-21PowerPoint writer: Register notes to state.Jesse Rosenthal1-0/+8
When we encounter a note, we write it to the state directory of notes, and input a superscript.
2017-12-21Add Note state to PowerPoint writer.Jesse Rosenthal1-0/+2
First step toward implementing notes in pptx writer.
2017-12-21Implement basic definition list functionality to PowerPoint writer.Jesse Rosenthal1-0/+9
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-13Removed whitespace at ends of line.John MacFarlane1-36/+36
2017-12-11Fix comment that confused compiler.Jesse Rosenthal1-2/+0
2017-12-11Add Powerpoint writer.Jesse Rosenthal1-0/+1665
This imports the essential Powerpoint writer. It works following the standard Pandoc conventions for making other sorts of slides. At the moment, there are still these TODOs: 1. Syntax highlighting is not yet implemented. (This is difficult because there are no character classes in Powerpoint.) 2. Footnotes and Definition lists are not yet implemented. (Notes will usually take the form of a final slide. 3. Image placement and auto-resizing has a few glitches. 4. Reference powerpoint files don't work dependably from the command line. This will be implemented, but at the moment users are advised to change themes from within Powerpoint.