Safe Haskell | None |
---|---|
Language | Haskell2010 |
A root for an app, usefull for server side html rendering. has a neat api for the head tag, use this if that api suits your needs. For more info see blogpost: https://jappieklooster.nl/reflex-server-side-html-rendering.html
Synopsis
- htmlWidget :: DomBuilder t m => HeadSettings -> m a -> m a
- data HeadSettings = HeadSettings {
- _head_js :: [HeadScript]
- _head_css :: [URI]
- _head_title :: Text
- head_js :: Lens' HeadSettings [HeadScript]
- head_css :: Lens' HeadSettings [URI]
- head_title :: Lens' HeadSettings Text
- data HeadScript = HeadScript {}
- script_uri :: Lens' HeadScript URI
- script_is_async :: Lens' HeadScript Bool
- defScript :: HeadScript
- defSettings :: HeadSettings
- writeReadDom :: (FromJSON a, ToJSON a, DomBuilder t m, Prerender js t m) => Text -> a -> m (Dynamic t a)
Documentation
htmlWidget :: DomBuilder t m => HeadSettings -> m a -> m a Source #
Adds the core html tags. we already know most of the head.
<html> <head> 'HeadSettings' <!-- provided settings --!> </head> <body> 'm a' <!-- provided monad --!> </body> </html>
Head tag stuff
data HeadSettings Source #
HeadSettings | |
|
Instances
Show HeadSettings Source # | |
Defined in Reflex.Bulmex.Html showsPrec :: Int -> HeadSettings -> ShowS # show :: HeadSettings -> String # showList :: [HeadSettings] -> ShowS # | |
Generic HeadSettings Source # | |
Defined in Reflex.Bulmex.Html type Rep HeadSettings :: Type -> Type # from :: HeadSettings -> Rep HeadSettings x # to :: Rep HeadSettings x -> HeadSettings # | |
type Rep HeadSettings Source # | |
Defined in Reflex.Bulmex.Html type Rep HeadSettings = D1 (MetaData "HeadSettings" "Reflex.Bulmex.Html" "bulmex-4.0.0-5oVc7KpcArTLZl3hR64V2O" False) (C1 (MetaCons "HeadSettings" PrefixI True) (S1 (MetaSel (Just "_head_js") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [HeadScript]) :*: (S1 (MetaSel (Just "_head_css") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [URI]) :*: S1 (MetaSel (Just "_head_title") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))) |
data HeadScript Source #
Instances
Show HeadScript Source # | |
Defined in Reflex.Bulmex.Html showsPrec :: Int -> HeadScript -> ShowS # show :: HeadScript -> String # showList :: [HeadScript] -> ShowS # | |
Generic HeadScript Source # | |
Defined in Reflex.Bulmex.Html type Rep HeadScript :: Type -> Type # from :: HeadScript -> Rep HeadScript x # to :: Rep HeadScript x -> HeadScript # | |
type Rep HeadScript Source # | |
Defined in Reflex.Bulmex.Html type Rep HeadScript = D1 (MetaData "HeadScript" "Reflex.Bulmex.Html" "bulmex-4.0.0-5oVc7KpcArTLZl3hR64V2O" False) (C1 (MetaCons "HeadScript" PrefixI True) (S1 (MetaSel (Just "_script_is_async") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "_script_uri") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 URI))) |
Defaults
Load
writeReadDom :: (FromJSON a, ToJSON a, DomBuilder t m, Prerender js t m) => Text -> a -> m (Dynamic t a) Source #
Insert an encodable in the document body, in case of the server side rendering we encode it as script tag with jsonval, in case of ghcjsdom we read the value from that script tag first arg is the idname to connect the two up (has to be uniq for a doc)