-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generate slides from Haskell code -- -- Make presentations in Haskell with diagrams @package Slides @version 0.1.0.3 module Slides.Common -- | 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.) Delay :: Eagerness -- | The element will be displayed as soon as it's encountered. Immediate :: Eagerness -- | The outermost type. Holds slides and styling. data Presentation Presentation :: [Slide] -> Style -> String -> Presentation [slides] :: Presentation -> [Slide] [style] :: Presentation -> Style -- | A plain string that will be put into the <head> before -- everything else. [baseHead] :: Presentation -> String -- | The outermost type of a single slide. Holds content nodes. newtype Slide Slide :: [ContentNode] -> Slide [nodes] :: Slide -> [ContentNode] -- | The main type in the presentaion. Describes all the possible kinds of -- content. data ContentNode -- | Generates a <hN> tag where the N is the first argument. Header :: Int -> String -> ContentNode -- | Generates an unordered list that's immediately displayed. List :: [ContentNode] -> ContentNode -- | A plain text node. Text :: String -> ContentNode -- | Generates a <br /> tag. A new line. Break :: ContentNode -- | Generates an SVG tag with the specified width and height and string -- contents. RawSVG :: Int -> Int -> String -> ContentNode -- | Generates an SVG tag from a given height and a Diagram Diagram :: Int -> (Diagram SVG) -> ContentNode -- | 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] -> ContentNode -- | Generates elements in sequence with the next one REPLACING the -- previous one. The Eagerness parameter determines whether the first -- element in sequence will be immediately displayed. Sequence :: Eagerness -> [ContentNode] -> ContentNode -- | Generates a list of elements. The elements themselves are not -- wrapped in anything, unlike in a normal list where they're wrapped in -- <li> tags, just concatinated together. ConcatList :: [ContentNode] -> ContentNode -- | The same as ConcatList with the display behavior of UnfoldList UnfoldConcatList :: Eagerness -> [ContentNode] -> ContentNode -- | Rudimentary support for styling data Style Style :: [(Selector, ElementStyle)] -> String -> Style -- | Pairs of selectors that determine what kind of elements to apply the -- style to and the | styles themselves. [selectors] :: Style -> [(Selector, ElementStyle)] [baseCss] :: Style -> String -- | Describes which elements to apply the style to. data Selector HeaderSelector :: Int -> Selector -- | Applies to everything. UniversalSelector :: Selector TextSelector :: Selector SlideSelector :: Selector data ElementStyle ElementStyle :: Maybe (Colour Float) -> Maybe String -> Maybe Int -> ElementStyle [backgroundColor] :: ElementStyle -> Maybe (Colour Float) [fontFamily] :: ElementStyle -> Maybe String [fontSize] :: ElementStyle -> Maybe Int -- | An empty presentation set to the default style with UTF8 encoding. emptyPresentation :: Presentation -- | The default style. emptyStyle :: Style -- | Completely empty element style. emptyElementStyle :: ElementStyle instance GHC.Read.Read Slides.Common.Style instance GHC.Show.Show Slides.Common.Style instance GHC.Classes.Eq Slides.Common.Style instance GHC.Read.Read Slides.Common.ElementStyle instance GHC.Show.Show Slides.Common.ElementStyle instance GHC.Classes.Eq Slides.Common.ElementStyle instance GHC.Read.Read Slides.Common.Selector instance GHC.Show.Show Slides.Common.Selector instance GHC.Classes.Ord Slides.Common.Selector instance GHC.Classes.Eq Slides.Common.Selector instance GHC.Show.Show Slides.Common.Eagerness instance GHC.Classes.Eq Slides.Common.Eagerness -- | 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 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. Good default settings are -- A3-Landscape. You can just print to PDF to get the actual -- presentation. module Slides.Presentation -- | Render the Presentation to an HTML string. renderPresentation :: Presentation -> String -- | Render a Presentation to an HTML file with UTF8 encoding. writeToFile :: FilePath -> Presentation -> IO () instance Slides.Presentation.Renderable Slides.Common.Presentation instance Slides.Presentation.Renderable Slides.Common.Slide instance Slides.Presentation.Renderable Slides.Common.Style instance Slides.Presentation.Renderable Slides.Common.Selector instance Slides.Presentation.Renderable Slides.Common.ElementStyle instance Data.String.IsString Slides.Common.ContentNode