knit-haskell-0.6.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 Text (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 () -> Sem effs () Source #

Add a Lucid html fragment to the current Lucid doc.

Intepretations

lucidToNamedText :: Sem (LucidDocs ': effs) () -> Sem effs [DocWithInfo Text Text] Source #

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

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

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

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

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

newLucidDoc :: Member LucidDocs effs => Text -> Sem (Lucid ': effs) () -> Sem 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 Text 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 -> Sem effs () Source #

Add a Blaze html fragment to the current Blaze doc.

Interpretations

blazeToNamedText :: Sem (BlazeDocs ': effs) () -> Sem effs [DocWithInfo Text Text] Source #

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

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

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

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

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

newBlazeDoc :: Member BlazeDocs effs => Text -> Sem (Blaze ': effs) () -> Sem 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 DocWithInfo i a Source #

Data type to hold one document with info of type i and doc of type a.

Constructors

DocWithInfo 

Fields

Instances
Functor (DocWithInfo i) Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

fmap :: (a -> b) -> DocWithInfo i a -> DocWithInfo i b #

(<$) :: a -> DocWithInfo i b -> DocWithInfo i a #

Foldable (DocWithInfo i) Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

fold :: Monoid m => DocWithInfo i m -> m #

foldMap :: Monoid m => (a -> m) -> DocWithInfo i a -> m #

foldr :: (a -> b -> b) -> b -> DocWithInfo i a -> b #

foldr' :: (a -> b -> b) -> b -> DocWithInfo i a -> b #

foldl :: (b -> a -> b) -> b -> DocWithInfo i a -> b #

foldl' :: (b -> a -> b) -> b -> DocWithInfo i a -> b #

foldr1 :: (a -> a -> a) -> DocWithInfo i a -> a #

foldl1 :: (a -> a -> a) -> DocWithInfo i a -> a #

toList :: DocWithInfo i a -> [a] #

null :: DocWithInfo i a -> Bool #

length :: DocWithInfo i a -> Int #

elem :: Eq a => a -> DocWithInfo i a -> Bool #

maximum :: Ord a => DocWithInfo i a -> a #

minimum :: Ord a => DocWithInfo i a -> a #

sum :: Num a => DocWithInfo i a -> a #

product :: Num a => DocWithInfo i a -> a #

Traversable (DocWithInfo i) Source # 
Instance details

Defined in Knit.Effect.Docs

Methods

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

sequenceA :: Applicative f => DocWithInfo i (f a) -> f (DocWithInfo i a) #

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

sequence :: Monad m => DocWithInfo i (m a) -> m (DocWithInfo i a) #