Slides 0.1.0.3 → 0.1.0.4
raw patch · 3 files changed
+51/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Slides.cabal +1/−1
- src/Slides/Common.hs +5/−3
- src/Slides/Presentation.hs +45/−2
Slides.cabal view
@@ -1,5 +1,5 @@ name: Slides -version: 0.1.0.3 +version: 0.1.0.4 synopsis: Generate slides from Haskell code description: Make presentations in Haskell with diagrams license: MIT
src/Slides/Common.hs view
@@ -13,7 +13,8 @@ -- | Describes the behavior of the presentation element. data Eagerness - -- | The element won't be displayed until there's an explicit signal from the user (pressing the arrow key, etc.) + -- | The element won't be displayed until there's an explicit signal from the user (pressing the + -- arrow key, etc.) = Delay -- | The element will be displayed as soon as it's encountered. | Immediate @@ -22,7 +23,8 @@ -- | The outermost type. Holds slides and styling. data Presentation = Presentation { slides :: [Slide] , style :: Style - -- | A plain string that will be put into the \<head> before everything else. + -- | A plain string that will be put into the \<head> before + -- everything else. , baseHead :: String } -- | The outermost type of a single slide. Holds content nodes. @@ -42,7 +44,7 @@ | RawSVG Int Int String -- | Generates an SVG tag from a given height and a Diagram | Diagram Int (Diagram SVG) - -- | Generates a list of elements where each element is delayed. The Eagerness parameter + -- | Generates a list of elements where each element is delayed. The 'Eagerness' parameter -- determines whether the list will immediately display the first element. | UnfoldList Eagerness [ContentNode] -- | Generates elements in sequence with the next one REPLACING the previous one. The Eagerness
src/Slides/Presentation.hs view
@@ -1,10 +1,53 @@ {-# LANGUAGE RecordWildCards, OverloadedStrings #-} -- | To use this package you need to construct a Presentation tree using the types and constructors --- from the Slides.Common module (re-exported from this one). Then call one of the functions +-- from the 'Slides.Common' module (re-exported from this one). Then call one of the functions -- bellow. -- The generated HTML will not look like a presentation when you open it up in a browser, but --- it has CSS guides in place that will split it up into pages property when you print it. +-- it has CSS guides in place that will split it up into pages properly when you print it. -- Good default settings are A3-Landscape. You can just print to PDF to get the actual presentation. +-- +-- Here's an example +-- +-- @ +-- sample :: 'Presentation' +-- sample = +-- 'Presentation' [ +-- 'Slide' [ +-- 'Header' 2 \"Title\", +-- 'Sequence' 'Immediate' [ +-- 'UnfoldConcatList' 'Delay' [ +-- 'Header' 3 \"Example\", +-- 'UnfoldList' 'Immediate' [ +-- \"These lines will unfold one by one.\", +-- \"You can use some markdown in these strings like _this_ or *this* \\ +-- \\or \__this__ or **this**.\" +-- ], +-- 'Diagram' 200 someDiagram +-- ], +-- 'List' [ +-- \"This list will be shown in place of the previous title-list-diagram.\", +-- \"This item will be shown immediately with the last one.\" +-- ] +-- ] -- note that the above title \"Title\" will remain there during the sequence. +-- ], +-- 'Slide' [ +-- 'Header' 2 \"Another slide\", +-- 'List' [ +-- \"Some text describing stuff.\", +-- \"More text.\" +-- ], +-- 'Sequence' 'Delay' [ +-- 'Diagram' 200 a, +-- 'Diagram' 200 sequence, +-- 'Diagram' 200 of, +-- 'Diagram' 300 diagrams +-- ] +-- ] +-- ] + -- + -- main :: IO () + -- main = writeToFile \"index.html\" sample +-- @ module Slides.Presentation ( renderPresentation, writeToFile, module Slides.Common ) where