knit-haskell-0.1.0.0: a minimal Rmarkdown sort-of-thing for haskell, by way of Pandoc

Copyright(c) Adam Conner-Sax 2019
LicenseBSD-3-Clause
Maintaineradam_conner_sax@yahoo.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Knit.Effect.Html

Contents

Description

Create a Lucid or Blaze html document (using a Writer to intersperse html and other code) and then use the Docs polysemy effect to store that document for processing/output later.

Synopsis

Lucid

Effects

type Lucid = Writer (Html ()) Source #

Type-Alias for a single Lucid document writer.

type LucidDocs = Docs (Html ()) Source #

Type-Alias for the Docs effect (multi-document Writer), specialized to Lucid docs. To be used in an app that produces multiple html outputs, built up from Lucid bits.

Actions

lucid :: Member Lucid effs => Html () -> Semantic effs () Source #

Add a Lucid html fragment to the current Lucid doc.

Intepretations

lucidToNamedText :: Semantic (LucidDocs ': effs) () -> Semantic effs [NamedDoc Text] Source #

Interpret the LucidDocs effect (via Writer), producing a list of named Lucid docs, suitable for writing to disk.

lucidHtml :: Semantic (Lucid ': effs) () -> Semantic effs (Html ()) Source #

Interprest the Lucid effect (via Writer), producing a Lucid Html () from the currently written doc

lucidToText :: Semantic (Lucid ': effs) () -> Semantic effs Text Source #

Interpret the Lucid effect (via Writer), producing Text from the currently written doc

newLucidDoc :: Member LucidDocs effs => Text -> Semantic (Lucid ': effs) () -> Semantic effs () Source #

Take the current Lucid HTML in the writer and add it to the set of named docs with the given name. NB: Only use this function for making sets of documents built exclusively from Lucid. Otherwise use the more general Pandoc infrastructure in Pandoc.

Blaze

Effects

type Blaze = Writer Html Source #

Type-Alias for a single Blaze document writer.

type BlazeDocs = Docs Html Source #

Type-Alias for the Docs effect (multi-document Writer) specialized to Blaze docs. To be used in an app that produces multiple html outputs, built up from Blaze bits.

Actions

blaze :: Member Blaze effs => Html -> Semantic effs () Source #

Add a Blaze html fragment to the current Blaze doc.

Interpretations

blazeToNamedText :: Semantic (BlazeDocs ': effs) () -> Semantic effs [NamedDoc Text] Source #

Interpret the BlazeDocs effect (via Writer), producing a list of named Blaze docs.

blazeHtml :: Semantic (Blaze ': effs) () -> Semantic effs Html Source #

Interpret the Blaze effect (via Writer), producing a Blaze Html from the currently written doc.

blazeToText :: Semantic (Blaze ': effs) () -> Semantic effs Text Source #

Interpret the Blaze effect (via Writer), producing Text from the currently written doc.

newBlazeDoc :: Member BlazeDocs effs => Text -> Semantic (Blaze ': effs) () -> Semantic effs () Source #

take the current Blaze HTML in the writer and add it to the set of named docs with the given name NB: Only use this function for making sets of documents built exclusively from Blaze. Otherwise use the more general Pandoc infrastructure in Pandoc.

Re-exports

data NamedDoc a Source #

Data type to hold one named document of type a.

Constructors

NamedDoc 

Fields

Instances
Functor NamedDoc Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

fmap :: (a -> b) -> NamedDoc a -> NamedDoc b #

(<$) :: a -> NamedDoc b -> NamedDoc a #

Foldable NamedDoc Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

fold :: Monoid m => NamedDoc m -> m #

foldMap :: Monoid m => (a -> m) -> NamedDoc a -> m #

foldr :: (a -> b -> b) -> b -> NamedDoc a -> b #

foldr' :: (a -> b -> b) -> b -> NamedDoc a -> b #

foldl :: (b -> a -> b) -> b -> NamedDoc a -> b #

foldl' :: (b -> a -> b) -> b -> NamedDoc a -> b #

foldr1 :: (a -> a -> a) -> NamedDoc a -> a #

foldl1 :: (a -> a -> a) -> NamedDoc a -> a #

toList :: NamedDoc a -> [a] #

null :: NamedDoc a -> Bool #

length :: NamedDoc a -> Int #

elem :: Eq a => a -> NamedDoc a -> Bool #

maximum :: Ord a => NamedDoc a -> a #

minimum :: Ord a => NamedDoc a -> a #

sum :: Num a => NamedDoc a -> a #

product :: Num a => NamedDoc a -> a #

Traversable NamedDoc Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

traverse :: Applicative f => (a -> f b) -> NamedDoc a -> f (NamedDoc b) #

sequenceA :: Applicative f => NamedDoc (f a) -> f (NamedDoc a) #

mapM :: Monad m => (a -> m b) -> NamedDoc a -> m (NamedDoc b) #

sequence :: Monad m => NamedDoc (m a) -> m (NamedDoc a) #