Safe Haskell | None |
---|---|
Language | Haskell2010 |
Key generators and miscellaneous html utilities.
Uses the lucid Html
.
Documentation
genNamePre :: MonadState Int m => Text -> m Text Source #
sometimes a number doesn't work properly in html (or js???), and an alpha prefix seems to help
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 href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
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.
Instances
MonadTrans HtmlT | Used for |
Defined in Lucid.Base | |
MonadReader r m => MonadReader r (HtmlT m) | Since: lucid-2.9.7 |
MonadState s m => MonadState s (HtmlT m) | Since: lucid-2.9.7 |
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 # | |
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. |
Monad m => Monad (HtmlT m) | Basically acts like Writer. |
Functor m => Functor (HtmlT m) | Just re-uses Monad. |
MonadFix m => MonadFix (HtmlT m) | |
Defined in Lucid.Base | |
Applicative m => Applicative (HtmlT m) | Based on the monad instance. |
MonadIO m => MonadIO (HtmlT m) | If you want to use IO in your HTML generation. |
Defined in Lucid.Base | |
MFunctor HtmlT | Since: lucid-2.9.5 |
(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. |
m ~ Identity => Show (HtmlT m a) | Just calls |
(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) => Semigroup (HtmlT m a) | Since: lucid-2.9.7 |
(a ~ (), Applicative m) => Monoid (HtmlT m a) | Monoid is right-associative, a la the |
(a ~ (), m ~ Identity) => ToHtml (HtmlT m a) | Since: lucid-2.9.8 |
Functor m => With (HtmlT m a -> HtmlT m a) | For the contentful elements: |
Functor m => With (HtmlT m a) | For the contentless elements: |
Applicative m => Term (HtmlT m a) (HtmlT m a) | Given children immediately, just use that and expect no attributes. |
Orphan instances
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 () Source # | |