summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasperVanDerJeugt <>2018-05-04 13:37:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-05-04 13:37:00 (GMT)
commit19d6d0967844002199ca13dbb0a5cb7c6582cf91 (patch)
tree118ab9fd05f68b209b389d4e733c3681315d5b80
parent1a4a7f4357a2e81b7cd95e5ac260e727e9b53a1a (diff)
version 0.7.0.00.7.0.0
-rw-r--r--CHANGELOG.md6
-rw-r--r--README.md19
-rw-r--r--patat.cabal6
-rw-r--r--src/Patat/Presentation/Display.hs16
4 files changed, 40 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ffca4f1..873b3b8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/README.md b/README.md
index 68b86c0..865024f 100644
--- a/README.md
+++ b/README.md
@@ -211,6 +211,25 @@ two content slides.
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
-------------
diff --git a/patat.cabal b/patat.cabal
index 65eb312..56a352d 100644
--- a/patat.cabal
+++ b/patat.cabal
@@ -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 @@ Executable patat
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 @@ Executable patat-make-man
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
diff --git a/src/Patat/Presentation/Display.hs b/src/Patat/Presentation/Display.hs
index 25a841e..4347209 100644
--- a/src/Patat/Presentation/Display.hs
+++ b/src/Patat/Presentation/Display.hs
@@ -15,7 +15,7 @@ import Control.Applicative ((<$>))
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 :: Presentation -> IO ()
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 @@ prettyBlock theme@Theme {..} (Pandoc.LineBlock inliness) =
--------------------------------------------------------------------------------
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.Inline -> Bool
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