Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Key generators and miscellaneous html utilities.
Uses the lucid Html
.
Documentation
libCss :: Text -> Html () Source #
Convert a link to a css library from text to html.
>>>
libCss "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
libJs :: Text -> Html () Source #
Convert a link to a js library from text to html.
>>>
libJs "https://code.jquery.com/jquery-3.3.1.slim.min.js"
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
data HtmlT (m :: Type -> Type) a #
A monad transformer that generates HTML. Use the simpler Html
type if you don't want to transform over some other monad.
Don't rely on the internal representation of this type. Use the monad and functor classes.
Instances
MonadTrans HtmlT | Used for |
Defined in Lucid.Base | |
MFunctor HtmlT | Since: lucid-2.9.5 |
MonadError e m => MonadError e (HtmlT m) | Since: lucid-2.9.9 |
Defined in Lucid.Base throwError :: e -> HtmlT m a # catchError :: HtmlT m a -> (e -> HtmlT m a) -> HtmlT m a # | |
MonadReader r m => MonadReader r (HtmlT m) | Since: lucid-2.9.7 |
MonadState s m => MonadState s (HtmlT m) | Since: lucid-2.9.7 |
MonadWriter w m => MonadWriter w (HtmlT m) | Since: lucid-2.9.9 |
(Monad m, a ~ ()) => TermRaw Text (HtmlT m a) | Given children immediately, just use that and expect no attributes. |
MonadFix m => MonadFix (HtmlT m) | |
Defined in Lucid.Base | |
MonadIO m => MonadIO (HtmlT m) | If you want to use IO in your HTML generation. |
Defined in Lucid.Base | |
Applicative m => Applicative (HtmlT m) | Based on the monad instance. |
Functor m => Functor (HtmlT m) | Just re-uses Monad. |
Monad m => Monad (HtmlT m) | Basically acts like Writer. |
(Applicative m, f ~ HtmlT m a) => Term [Attribute] (f -> HtmlT m a) | Given attributes, expect more child input. |
(Monad m, ToHtml f, a ~ ()) => TermRaw [Attribute] (f -> HtmlT m a) | Given attributes, expect more child input. |
(Monad m, a ~ ()) => IsString (HtmlT m a) | We pack it via string. Could possibly encode straight into a builder. That might be faster. |
Defined in Lucid.Base fromString :: String -> HtmlT m a # | |
(a ~ (), Applicative m) => Monoid (HtmlT m a) | Monoid is right-associative, a la the |
(a ~ (), Applicative m) => Semigroup (HtmlT m a) | Since: lucid-2.9.7 |
m ~ Identity => Show (HtmlT m a) | Just calls |
(a ~ (), m ~ Identity) => ToHtml (HtmlT m a) | Since: lucid-2.9.8 |
Functor m => With (HtmlT m a) | For the contentless elements: |
Functor m => With (HtmlT m a -> HtmlT m a) | For the contentful elements: |
Applicative m => Term (HtmlT m a) (HtmlT m a) | Given children immediately, just use that and expect no attributes. |
Orphan instances
ToHtml () Source # | |
ToHtml Bool Source # | |
ToHtml Double Source # | FIXME: `ToHtml a` is used throughout, mostly because `Show a` gives ""text"" for show "text", and hilarity ensues when rendering this to a web page, and I couldn't work out how to properly get around this. Hence, these orphans. |
ToHtml Int Source # | |
ToHtml a => ToHtml [a] Source # | |