aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
AgeCommit message (Collapse)AuthorFilesLines
2020-06-23Remove redundant pattern match in pptx writer.John MacFarlane1-3/+0
2020-06-22Handle native Underline in Powerpoint writer.John MacFarlane1-1/+1
(Instead of old Span with underline class. Spans with `underline` will no longer be rendered as underlined text.)
2020-04-28Support new Underline element in readers and writers (#6277)Vaibhav Sagar1-0/+3
Deprecate `underlineSpan` in Shared in favor of `Text.Pandoc.Builder.underline`.
2020-04-15Adapt to the newest Table type, fix some previous adaptation issuesdespresc1-3/+4
- Writers.Native is now adapted to the new Table type. - Inline captions should now be conditionally wrapped in a Plain, not a Para block. - The toLegacyTable function now lives in Writers.Shared.
2020-04-15Implement the new Table typedespresc1-6/+11
2020-03-15Use implicit Prelude (#6187)Albert Krewinkel1-2/+0
* Use implicit Prelude The previous behavior was introduced as a fix for #4464. It seems that this change alone did not fix the issue, and `stack ghci` and `cabal repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded for these versions. Given this, it seems cleaner to revert to the implicit Prelude. * PandocMonad: remove outdated check for base version Only base versions 4.9 and later are supported, the check for `MIN_VERSION_base(4,8,0)` is therefore unnecessary. * Always use custom prelude Previously, the custom prelude was used only with older GHC versions, as a workaround for problems with ghci. The ghci problems are resolved by replacing package `base` with `base-noprelude`, allowing for consistent use of the custom prelude across all GHC versions.
2020-03-13Update copyright year (#6186)Albert Krewinkel1-1/+1
* Update copyright year * Copyright: add notes for Lua and Jira modules
2020-02-07Apply linter suggestions. Add fix_spacing to lint target in Makefile.John MacFarlane1-10/+10
2020-02-07Resolve HLint warningsAlbert Krewinkel1-2/+2
All warnings are either fixed or, if more appropriate, HLint is configured to ignore them. HLint suggestions remain. * Ignore "Use camelCase" warnings in Lua and legacy code * Fix or ignore remaining HLint warnings * Remove redundant brackets * Remove redundant `return`s * Remove redundant as-pattern * Fuse mapM_/map * Use `.` to shorten code * Remove redundant `fmap` * Remove unused LANGUAGE pragmas * Hoist `not` in Text.Pandoc.App * Use fewer imports for `Text.DocTemplates` * Remove redundant `do`s * Remove redundant `$`s * Jira reader: remove unnecessary parentheses
2020-02-07Various minor cleanups and refactoring (#6117)Joseph C. Sible1-3/+3
* Use concatMap instead of reimplementing it * Replace an unnecessary multi-way if with a regular if * Use sortOn instead of sortBy and comparing * Use guards instead of lots of indents for if and else * Remove redundant do blocks * Extract common functions from both branches of maybe Whenever both the Nothing and the Just branch of maybe do the same function, do that function on the result of maybe instead. * Use fmap instead of reimplementing it from maybe * Use negative forms instead of negating the positive forms * Use mapMaybe instead of mapping and then using catMaybes * Use zipWith instead of mapping over the result of zip * Use unwords instead of reimplementing it * Use <$ instead of <$> and const * Replace case of Bool with if and else * Use find instead of listToMaybe and filter * Use zipWithM instead of mapM and zip * Inline lambda wrappers into the real functions * We get zipWithM from Text.Pandoc.Writers.Shared * Use maybe instead of fromMaybe and fmap I'm not sure how this one slipped past me. * Increase a bit of indentation
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc1-34/+38
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-06-14Powerpoint code formatting is now context dependent (#5573)Jeroen de Haas1-12/+24
This commit alters the way in which the Powerpoint writer treats inline code and code blocks. - Inline code is now formatted at the same size as the surrounding text. - Code blocks are now given a margin and font size according to their level. - Furthermore this commit allows changing the font with which code is formatted via the `monofont` option. Tested in - PowerPoint 365 for Windows - 1808 (Build 10730.20344 Click-to-Run) - PowerPoint 365 for Mac - 16.26 (19060901)
2019-04-05PowerPoint writer code style fixJesse Rosenthal1-30/+14
I had been using record syntax in an ADT, is bad style, since it means that each record produces a partial function. Fortunately we weren't using the partial functions anywhere, so this changes it to positional syntax.
2019-03-31Pptx writer: Apply speaker snotes to metadata slide if applicable.Jesse Rosenthal1-15/+35
If the slide deck has a metadata slide (with author, title, etc) and has speaker notes before any body content, the speaker notes will be applied to the metadata slide. If there is no metadata slide, pandoc will behave as before.
2019-03-30Pptx writer: Correctly handle notes after section-title headerJesse Rosenthal1-3/+4
Previously, if notes came after a section-title header (ie, a level-1 header in a slide-level=2 presentation), they would go on the next slide. This keeps them on the slide with the header.
2019-03-01Remove license boilerplate.John MacFarlane1-19/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-27PowerPoint writer: add underlinesJesse Rosenthal1-0/+3
Use span with single class "underline" as in docx writer.
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.
2019-01-26Improve writing metadata for docx, pptx and odt (#5252)Agustín Martín Barbero1-2/+19
* docx writer: support custom properties. Solves the writer part of #3024. Also supports additional core properties: `subject`, `lang`, `category`, `description`. * odt writer: improve standard properties, including the following core properties: `generator` (Pandoc/VERSION), `description`, `subject`, `keywords`, `initial-creator` (from authors), `creation-date` (actual creation date). Also fix date. * pptx writer: support custom properties. Also supports additional core properties: `subject`, `category`, `description`. * Includes golden tests. * MANUAL: document metadata support for docx, odt, pptx writers
2019-01-04Use toTableOfContents in Powerpoint writer....John MacFarlane1-16/+3
instead of duplicating code.
2018-11-11Text.Pandoc.Shared: add parameter to uniqueIdent, inlineListToIdentifier.John MacFarlane1-1/+2
The parameter is Extensions. This allows these functions to be sensitive to the settings of `Ext_gfm_auto_identifiers` and `Ext_ascii_identifiers`. This allows us to use `uniqueIdent` in the CommonMark reader, replacing some custom code. It also means that `gfm_auto_identifiers` can now be used in all formats. Semantically, `gfm_auto_identifiers` is now a modifier of `auto_identifiers`; for identifiers to be set, `auto_identifiers` must be turned on, and then the type of identifier produced depends on `gfm_auto_identifiers` and `ascii_identifiers` are set. Closes #5057.
2018-10-20Powerpoint: Support raw openxml in pptx writer.Jesse Rosenthal1-2/+12
This allows raw openxml blocks and inlines to be used in the pptx writer. A few caveats: 1. It's up to the user to write well-formed openxml. The chances for corruption, especially with such a brittle format as pptx, is pretty high. 2. Because of the tricky way that blocks map onto shapes, if you are using a raw block, it should be the only block on a slide (otherwise other text might end up overlapping it). 3. The pptx ooxml namespace abbreviations are different from the docx ooxml namespaces. Again, it's up to the user to get it right. Unzipped document and ooxml specification should be consulted. Closes: #4976
2018-10-04Add lookupMeta* functions to Text.Pandoc.Writers.Shared (#4907)Mauro Bieg1-14/+8
Remove exported functions `metaValueToInlines`, `metaValueToString`. Add new exported functions `lookupMetaBool`, `lookupMetaBlocks`, `lookupMetaInlines`, `lookupMetaString`. Use these whenever possible for uniformity in writers. API change (major, because of removed function `metaValueToInlines`. `metaValueToString` wasn't in any released version.)
2018-04-05Powerpoint writer: Handle Quoted InlinesJesse Rosenthal1-2/+13
Closes: #4532
2018-03-30Powerpoint writer: code cleanupJesse Rosenthal1-4/+1
Since we're using mapM_ instead of mapM, we can get rid of the return statement. We also don't need the `unless` statement anymore.
2018-03-25Powerpoint writer: code cleanup.Jesse Rosenthal1-39/+17
2018-03-23Powepoint writer: Simplify speaker notesJesse Rosenthal1-27/+31
We now pull the filtered blocks and speaker notes out at the top of the `blocksToSlide` function, and then make SpeakerNotes into a parameter of the `blocksToSlide'` subfunction. The output is the same, but the logic should be easier to follow now.
2018-03-23Powerpoint writer: change notes state to a simpler per-slide valueJesse Rosenthal1-18/+7
We used to keep a map of the slideId-to-notes for each slide. Since we now extract them at the slide level, this is overcomplicated, and we can just extract them before converting a slide and then clear the state after.
2018-03-23Powerpoint writer: Remove `Maybe` from `SpeakerNotes` in `Slide`.Jesse Rosenthal1-18/+20
Previously, we had treated it as a `Maybe`. But there is no difference between not having speaker notes and having empty speaker notes. So we make the SpeakerNotes newtype into a monoid, and test for memptiness instead of testing for Just/Nothing.
2018-03-21Powerpoint writer: handle speaker notes earlier in the conversion processJesse Rosenthal1-15/+23
Internal change: We were getting bad results with the empty text box created by the conversion of notes into an empty paragraph. So we now convert the notes at the `blocksToSlide` stage, by `walkM`ing a function over the blocks that returns `()`, and then filters the notes out. This avoids the need to have a return value for speaker notes, and thus avoids the empty TextBox. Together with the previous commit (256f14c5a), closes #4477.
2018-03-21Powerpoint writer: Keep notes with related blocksJesse Rosenthal1-8/+17
Some blocks automatically split slides (imgs, tables, `column` divs). We assume that any speaker notes immediately following these are connected to these elements, and keep them with the related blocks, splitting after them.
2018-03-18Removed old-locale flag and Text.Pandoc.Compat.Time.John MacFarlane1-1/+1
This is no longer necessary since we no longer support ghc 7.8.
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-03-17hlint fixes.John MacFarlane1-10/+10
2018-02-27Powerpoint writer: use `trim` from SharedJesse Rosenthal1-3/+2
Instead of writing my own.
2018-02-27Powerpoint writer: Remove empty slidesJesse Rosenthal1-2/+38
Make sure there are no empty slides in the pptx output. Because of the way that slides were split, these could be accidentally produced by comments after images. When animations are added, there will be a way to add an empty slide with either incremental lists or pauses. Test outputs checked with MS PowerPoint (Office 2013, Windows 10, VBox). Both files have expected output and are not corrupted.
2018-02-18Powerpoint writer: Ignore links and (end)notes in speaker notes.Jesse Rosenthal1-9/+21
MS PowerPoint does not offer a way to insert links into speaker notes text, so we match that behavior, and make our lives easier. As for (end)notes, there is no clear solution to the question of wat that would *mean*. The default behavior would be to add it to the endnote slide, but that would put speaker note content into the public presentation. The best solution would be to put the content at the bottom of the notes page, but that would take some doing, and can be added to the speaker notes feature later.
2018-02-18Powerpoint writer: Read notes into powerpoint Presentatation type.Jesse Rosenthal1-3/+20
We record notes in a map in state while processing.
2018-02-18Powerpoint writer: Change references to Notes to SpeakerNotesJesse Rosenthal1-7/+7
This is to avoid confusion with {foot,end}notes.
2018-01-19hlint code improvements.John MacFarlane1-38/+36
2018-01-18Powerpoint writer: Implement syntax highlightingJesse Rosenthal1-2/+47
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-18Powerpoint writer: Make our own docProps/core.xml file.Jesse Rosenthal1-4/+5
This allows us to set document metadata properties from pandoc metadata.
2018-01-18Powerpoint writer: Add docProps to Presentation datatype.Jesse Rosenthal1-7/+34
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 Rosenthal1-23/+25
2018-01-17Powerpoint writer: Revamp slide typeJesse Rosenthal1-33/+82
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 Rosenthal1-8/+24
Rather than passing around attributes, we can have image sizing in the picProps and then pass it along to write to XML.
2018-01-15Powerpoint writer: Move Presentation.hs out of PandocMonadJesse Rosenthal1-33/+36
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.