patat 0.6.1.1 → 0.7.0.0
raw patch · 4 files changed
+40/−7 lines, 4 filesdep ~pandoc
Dependency ranges changed: pandoc
Files
- CHANGELOG.md +6/−0
- README.md +19/−0
- patat.cabal +3/−3
- src/Patat/Presentation/Display.hs +12/−4
CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +- 0.7.0.0 (2018-05-04)+ * Support HTML-style comments++- 0.6.1.2 (2018-04-30)+ * Bump `pandoc` to 2.2+ - 0.6.1.1 (2018-04-27) * Bump `aeson` to 1.3 * Bump `skylighting` to 0.7
README.md view
@@ -211,6 +211,25 @@ For more information, see [Advanced slide splitting](#advanced-slide-splitting). +Patat supports comments which can be used as speaker notes.++ ---+ title: This is my presentation+ author: Jane Doe+ ...++ # Chapter 1++ <!--+ Note: I should not bore the audience with my thoughts on powerpoint but+ just get straight to the point.+ -->++ Slide contents. Yay.++ <!-- TODO: Finish the rest of the presentation. -->++ Configuration -------------
patat.cabal view
@@ -1,5 +1,5 @@ Name: patat-Version: 0.6.1.1+Version: 0.7.0.0 Synopsis: Terminal-based presentations using Pandoc Description: Terminal-based presentations using Pandoc License: GPL-2@@ -42,7 +42,7 @@ filepath >= 1.4 && < 1.5, mtl >= 2.2 && < 2.3, optparse-applicative >= 0.12 && < 0.15,- pandoc >= 2.0.4 && < 2.2,+ pandoc >= 2.0.4 && < 2.3, skylighting >= 0.1 && < 0.8, terminal-size >= 0.3 && < 0.4, text >= 1.2 && < 1.3,@@ -86,6 +86,6 @@ Build-depends: base >= 4.6 && < 4.11, mtl >= 2.2 && < 2.3,- pandoc >= 2.0 && < 2.2,+ pandoc >= 2.0 && < 2.3, text >= 1.2 && < 1.3, time >= 1.6 && < 1.10
src/Patat/Presentation/Display.hs view
@@ -15,7 +15,7 @@ import Control.Monad (mplus, unless) import qualified Data.Aeson.Extended as A import Data.Data.Extended (grecQ)-import Data.List (intersperse)+import qualified Data.List as L import Data.Maybe (fromMaybe) import Data.Monoid (mconcat, mempty, (<>)) import qualified Data.Text as T@@ -113,11 +113,11 @@ dumpPresentation pres = let theme = fromMaybe Theme.defaultTheme (psTheme $ pSettings pres) in PP.putDoc $ withWrapSettings (pSettings pres) $- PP.vcat $ intersperse "----------" $ do+ PP.vcat $ L.intersperse "----------" $ do slide <- pSlides pres return $ case slide of TitleSlide block -> "~~~title" <$$> prettyBlock theme block- ContentSlide fragments -> PP.vcat $ intersperse "~~~frag" $ do+ ContentSlide fragments -> PP.vcat $ L.intersperse "~~~frag" $ do fragment <- fragments return $ prettyFragment theme fragment @@ -238,7 +238,7 @@ -------------------------------------------------------------------------------- prettyBlocks :: Theme -> [Pandoc.Block] -> PP.Doc-prettyBlocks theme = PP.vcat . map (prettyBlock theme)+prettyBlocks theme = PP.vcat . map (prettyBlock theme) . filter isVisibleBlock --------------------------------------------------------------------------------@@ -327,3 +327,11 @@ isReferenceLink (Pandoc.Link _attrs text (target, _)) = [Pandoc.Str target] /= text isReferenceLink _ = False+++--------------------------------------------------------------------------------+isVisibleBlock :: Pandoc.Block -> Bool+isVisibleBlock Pandoc.Null = False+isVisibleBlock (Pandoc.RawBlock (Pandoc.Format "html") t) =+ not ("<!--" `L.isPrefixOf` t && "-->" `L.isSuffixOf` t)+isVisibleBlock _ = True