blizzard-html-0.5.0.0: An HTML generator for Haskell
Copyright(c) Joshua Obritsch 2021
LicenseMIT
Maintainerjoshua@obritsch.com
StabilityExperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Html

Description

The Html module provides a set of types, classes and functions for generating HTML elements.

These elements along with their attributes and event handlers, found in the Html.Attributes and Html.Events modules respectively, can be used to dynamically compose HTML documents natively in Haskell, without relying on templating engines or other techniques that can be error-prone and difficult to maintain.

Additionally, the functions provided in the Html.Intl module can be used to facilitate internationalization.

Synopsis

Types

Html

data Html lng where Source #

Represents an HTML element.

Note: The type variable lng stands for language and is used to facilitate internationalization.

Constructors

ParentNode :: Builder -> Builder -> [Attribute] -> [Html lng] -> Html lng

Constructs an HTML parent node.

LeafNode :: Builder -> [Attribute] -> Html lng

Constructs an HTML leaf node.

RootNode :: Builder -> [Html lng] -> Html lng

Constructs an HTML root node.

TextNode :: Builder -> Html lng

Constructs a monolingual HTML text node.

IntlNode :: Translatable lng => lng -> Html lng

Constructs a multilingual HTML text node.

Instances

Instances details
IsString (Html lng) Source # 
Instance details

Defined in Html

Methods

fromString :: String -> Html lng #

Show (Html lng) Source # 
Instance details

Defined in Html

Methods

showsPrec :: Int -> Html lng -> ShowS #

show :: Html lng -> String #

showList :: [Html lng] -> ShowS #

Show [Html lng] Source # 
Instance details

Defined in Html

Methods

showsPrec :: Int -> [Html lng] -> ShowS #

show :: [Html lng] -> String #

showList :: [[Html lng]] -> ShowS #

Buildable (Html lng) Source # 
Instance details

Defined in Html

Methods

build :: Html lng -> Builder Source #

Buildable [Html lng] Source # 
Instance details

Defined in Html

Methods

build :: [Html lng] -> Builder Source #

Attribute

data Attribute Source #

Represents an HTML attribute.

Constructors

BoolAttribute Builder Bool

Constructs a boolean HTML attribute.

TextAttribute Builder Builder

Constructs a textual HTML attribute.

Instances

Instances details
Show Attribute Source # 
Instance details

Defined in Html

Buildable Attribute Source # 
Instance details

Defined in Html

Show [Attribute] Source # 
Instance details

Defined in Html

Buildable [Attribute] Source # 
Instance details

Defined in Html

Methods

build :: [Attribute] -> Builder Source #

Classes

Buildable

class Buildable a where Source #

Enables conversion to Builder.

Methods

build :: a -> Builder Source #

Converts to Builder.

Instances

Instances details
Buildable Attribute Source # 
Instance details

Defined in Html

Buildable (Html lng) Source # 
Instance details

Defined in Html

Methods

build :: Html lng -> Builder Source #

Buildable [Attribute] Source # 
Instance details

Defined in Html

Methods

build :: [Attribute] -> Builder Source #

Buildable [Html lng] Source # 
Instance details

Defined in Html

Methods

build :: [Html lng] -> Builder Source #

Translatable

class Translatable a where Source #

Enables the use of multilingual text nodes with Html.

Methods

defaultLanguage :: a -> Builder Source #

Sets the default language to use for internationalization with Html.

Declarations

<!DOCTYPE>

doctype :: [Html lng] -> Html lng Source #

Generates an HTML <!DOCTYPE> declaration with the given contents.

Elements

<a>

a :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <a> element with the given attributes and contents.

<abbr>

abbr :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <abbr> element with the given attributes and contents.

<address>

address :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <address> element with the given attributes and contents.

<area>

area :: [Attribute] -> Html lng Source #

Generates an HTML <area> element with the given attributes.

<article>

article :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <article> element with the given attributes and contents.

<aside>

aside :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <aside> element with the given attributes and contents.

<audio>

audio :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <audio> element with the given attributes and contents.

<b>

b :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <b> element with the given attributes and contents.

<base>

base :: [Attribute] -> Html lng Source #

Generates an HTML <base> element with the given attributes.

<bdi>

bdi :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <bdi> element with the given attributes and contents.

<bdo>

bdo :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <bdo> element with the given attributes and contents.

<blockquote>

blockquote :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <blockquote> element with the given attributes and contents.

<body>

body :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <body> element with the given attributes and contents.

<br>

br :: [Attribute] -> Html lng Source #

Generates an HTML <br> element with the given attributes.

<button>

button :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <button> element with the given attributes and contents.

<canvas>

canvas :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <canvas> element with the given attributes and contents.

<caption>

caption :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <caption> element with the given attributes and contents.

<cite>

cite :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <cite> element with the given attributes and contents.

<code>

code :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <code> element with the given attributes and contents.

<col>

col :: [Attribute] -> Html lng Source #

Generates an HTML <col> element with the given attributes.

<colgroup>

colgroup :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <colgroup> element with the given attributes and contents.

<data>

data_ :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <data> element with the given attributes and contents.

<datalist>

datalist :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <datalist> element with the given attributes and contents.

<dd>

dd :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <dd> element with the given attributes and contents.

<del>

del :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <del> element with the given attributes and contents.

<details>

details :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <details> element with the given attributes and contents.

<dfn>

dfn :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <dfn> element with the given attributes and contents.

<dialog>

dialog :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <dialog> element with the given attributes and contents.

<div>

div :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <div> element with the given attributes and contents.

<dl>

dl :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <dl> element with the given attributes and contents.

<dt>

dt :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <dt> element with the given attributes and contents.

<em>

em :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <em> element with the given attributes and contents.

<embed>

embed :: [Attribute] -> Html lng Source #

Generates an HTML <embed> element with the given attributes.

<fieldset>

fieldset :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <fieldset> element with the given attributes and contents.

<figcaption>

figcaption :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <figcaption> element with the given attributes and contents.

<figure>

figure :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <figure> element with the given attributes and contents.

<footer>

footer :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <footer> element with the given attributes and contents.

<form>

form :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <form> element with the given attributes and contents.

<h1>

h1 :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <h1> element with the given attributes and contents.

<h2>

h2 :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <h2> element with the given attributes and contents.

<h3>

h3 :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <h3> element with the given attributes and contents.

<h4>

h4 :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <h4> element with the given attributes and contents.

<h5>

h5 :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <h5> element with the given attributes and contents.

<h6>

h6 :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <h6> element with the given attributes and contents.

<head>

head :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <head> element with the given attributes and contents.

<header>

header :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <header> element with the given attributes and contents.

<hgroup>

hgroup :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <hgroup> element with the given attributes and contents.

<hr>

hr :: [Attribute] -> Html lng Source #

Generates an HTML <hr> element with the given attributes.

<html>

html :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <html> element with the given attributes and contents.

<i>

i :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <i> element with the given attributes and contents.

<iframe>

iframe :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <iframe> element with the given attributes and contents.

<img>

img :: [Attribute] -> Html lng Source #

Generates an HTML <img> element with the given attributes.

<input>

input :: [Attribute] -> Html lng Source #

Generates an HTML <input> element with the given attributes.

<ins>

ins :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <ins> element with the given attributes and contents.

<kbd>

kbd :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <kbd> element with the given attributes and contents.

<label>

label :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <label> element with the given attributes and contents.

<legend>

legend :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <legend> element with the given attributes and contents.

<li>

li :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <li> element with the given attributes and contents.

<link>

link :: [Attribute] -> Html lng Source #

Generates an HTML <link> element with the given attributes.

<main>

main :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <main> element with the given attributes and contents.

<map>

map :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <map> element with the given attributes and contents.

<mark>

mark :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <mark> element with the given attributes and contents.

<menu>

menu :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <menu> element with the given attributes and contents.

<meta>

meta :: [Attribute] -> Html lng Source #

Generates an HTML <meta> element with the given attributes.

<meter>

meter :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <meter> element with the given attributes and contents.

<nav>

nav :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <nav> element with the given attributes and contents.

<noscript>

noscript :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <noscript> element with the given attributes and contents.

<object>

object :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <object> element with the given attributes and contents.

<ol>

ol :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <ol> element with the given attributes and contents.

<optgroup>

optgroup :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <optgroup> element with the given attributes and contents.

<option>

option :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <option> element with the given attributes and contents.

<output>

output :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <output> element with the given attributes and contents.

<p>

p :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <p> element with the given attributes and contents.

<picture>

picture :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <picture> element with the given attributes and contents.

<pre>

pre :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <pre> element with the given attributes and contents.

<progress>

progress :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <progress> element with the given attributes and contents.

<q>

q :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <q> element with the given attributes and contents.

<rp>

rp :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <rp> element with the given attributes and contents.

<rt>

rt :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <rt> element with the given attributes and contents.

<ruby>

ruby :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <ruby> element with the given attributes and contents.

<s>

s :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <s> element with the given attributes and contents.

<samp>

samp :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <samp> element with the given attributes and contents.

<script>

script :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <script> element with the given attributes and contents.

<section>

section :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <section> element with the given attributes and contents.

<select>

select :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <select> element with the given attributes and contents.

<slot>

slot :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <slot> element with the given attributes and contents.

<small>

small :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <small> element with the given attributes and contents.

<source>

source :: [Attribute] -> Html lng Source #

Generates an HTML <source> element with the given attributes.

<span>

span :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <span> element with the given attributes and contents.

<strong>

strong :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <strong> element with the given attributes and contents.

<style>

style :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <style> element with the given attributes and contents.

<sub>

sub :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <sub> element with the given attributes and contents.

<summary>

summary :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <summary> element with the given attributes and contents.

<sup>

sup :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <sup> element with the given attributes and contents.

<table>

table :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <table> element with the given attributes and contents.

<tbody>

tbody :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <tbody> element with the given attributes and contents.

<td>

td :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <td> element with the given attributes and contents.

<template>

template :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <template> element with the given attributes and contents.

<textarea>

textarea :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <textarea> element with the given attributes and contents.

<tfoot>

tfoot :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <tfoot> element with the given attributes and contents.

<th>

th :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <th> element with the given attributes and contents.

<thead>

thead :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <thead> element with the given attributes and contents.

<time>

time :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <time> element with the given attributes and contents.

<title>

title :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <title> element with the given attributes and contents.

<tr>

tr :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <tr> element with the given attributes and contents.

<track>

track :: [Attribute] -> Html lng Source #

Generates an HTML <track> element with the given attributes.

<u>

u :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <u> element with the given attributes and contents.

<ul>

ul :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <ul> element with the given attributes and contents.

<var>

var :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <var> element with the given attributes and contents.

<video>

video :: [Attribute] -> [Html lng] -> Html lng Source #

Generates an HTML <video> element with the given attributes and contents.

<wbr>

wbr :: [Attribute] -> Html lng Source #

Generates an HTML <wbr> element with the given attributes.