Copyright | (c) Joshua Obritsch 2021 |
---|---|
License | MIT |
Maintainer | joshua@obritsch.com |
Stability | Experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Types
- Classes
- Declarations
- Elements
- <a>
- <abbr>
- <address>
- <area>
- <article>
- <aside>
- <audio>
- <b>
- <base>
- <bdi>
- <bdo>
- <blockquote>
- <body>
- <br>
- <button>
- <canvas>
- <caption>
- <cite>
- <code>
- <col>
- <colgroup>
- <data>
- <datalist>
- <dd>
- <del>
- <details>
- <dfn>
- <dialog>
- <div>
- <dl>
- <dt>
- <em>
- <embed>
- <fieldset>
- <figcaption>
- <figure>
- <footer>
- <form>
- <h1>
- <h2>
- <h3>
- <h4>
- <h5>
- <h6>
- <head>
- <header>
- <hgroup>
- <hr>
- <html>
- <i>
- <iframe>
- <img>
- <input>
- <ins>
- <kbd>
- <label>
- <legend>
- <li>
- <link>
- <main>
- <map>
- <mark>
- <menu>
- <meta>
- <meter>
- <nav>
- <noscript>
- <object>
- <ol>
- <optgroup>
- <option>
- <output>
- <p>
- <picture>
- <pre>
- <progress>
- <q>
- <rp>
- <rt>
- <ruby>
- <s>
- <samp>
- <script>
- <section>
- <select>
- <slot>
- <small>
- <source>
- <span>
- <strong>
- <style>
- <sub>
- <summary>
- <sup>
- <table>
- <tbody>
- <td>
- <template>
- <textarea>
- <tfoot>
- <th>
- <thead>
- <time>
- <title>
- <tr>
- <track>
- <u>
- <ul>
- <var>
- <video>
- <wbr>
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
- data Html lng where
- data Attribute
- class Buildable a where
- class Translatable a where
- defaultLanguage :: a -> Builder
- doctype :: [Html lng] -> Html lng
- a :: [Attribute] -> [Html lng] -> Html lng
- abbr :: [Attribute] -> [Html lng] -> Html lng
- address :: [Attribute] -> [Html lng] -> Html lng
- area :: [Attribute] -> Html lng
- article :: [Attribute] -> [Html lng] -> Html lng
- aside :: [Attribute] -> [Html lng] -> Html lng
- audio :: [Attribute] -> [Html lng] -> Html lng
- b :: [Attribute] -> [Html lng] -> Html lng
- base :: [Attribute] -> Html lng
- bdi :: [Attribute] -> [Html lng] -> Html lng
- bdo :: [Attribute] -> [Html lng] -> Html lng
- blockquote :: [Attribute] -> [Html lng] -> Html lng
- body :: [Attribute] -> [Html lng] -> Html lng
- br :: [Attribute] -> Html lng
- button :: [Attribute] -> [Html lng] -> Html lng
- canvas :: [Attribute] -> [Html lng] -> Html lng
- caption :: [Attribute] -> [Html lng] -> Html lng
- cite :: [Attribute] -> [Html lng] -> Html lng
- code :: [Attribute] -> [Html lng] -> Html lng
- col :: [Attribute] -> Html lng
- colgroup :: [Attribute] -> [Html lng] -> Html lng
- data_ :: [Attribute] -> [Html lng] -> Html lng
- datalist :: [Attribute] -> [Html lng] -> Html lng
- dd :: [Attribute] -> [Html lng] -> Html lng
- del :: [Attribute] -> [Html lng] -> Html lng
- details :: [Attribute] -> [Html lng] -> Html lng
- dfn :: [Attribute] -> [Html lng] -> Html lng
- dialog :: [Attribute] -> [Html lng] -> Html lng
- div :: [Attribute] -> [Html lng] -> Html lng
- dl :: [Attribute] -> [Html lng] -> Html lng
- dt :: [Attribute] -> [Html lng] -> Html lng
- em :: [Attribute] -> [Html lng] -> Html lng
- embed :: [Attribute] -> Html lng
- fieldset :: [Attribute] -> [Html lng] -> Html lng
- figcaption :: [Attribute] -> [Html lng] -> Html lng
- figure :: [Attribute] -> [Html lng] -> Html lng
- footer :: [Attribute] -> [Html lng] -> Html lng
- form :: [Attribute] -> [Html lng] -> Html lng
- h1 :: [Attribute] -> [Html lng] -> Html lng
- h2 :: [Attribute] -> [Html lng] -> Html lng
- h3 :: [Attribute] -> [Html lng] -> Html lng
- h4 :: [Attribute] -> [Html lng] -> Html lng
- h5 :: [Attribute] -> [Html lng] -> Html lng
- h6 :: [Attribute] -> [Html lng] -> Html lng
- head :: [Attribute] -> [Html lng] -> Html lng
- header :: [Attribute] -> [Html lng] -> Html lng
- hgroup :: [Attribute] -> [Html lng] -> Html lng
- hr :: [Attribute] -> Html lng
- html :: [Attribute] -> [Html lng] -> Html lng
- i :: [Attribute] -> [Html lng] -> Html lng
- iframe :: [Attribute] -> [Html lng] -> Html lng
- img :: [Attribute] -> Html lng
- input :: [Attribute] -> Html lng
- ins :: [Attribute] -> [Html lng] -> Html lng
- kbd :: [Attribute] -> [Html lng] -> Html lng
- label :: [Attribute] -> [Html lng] -> Html lng
- legend :: [Attribute] -> [Html lng] -> Html lng
- li :: [Attribute] -> [Html lng] -> Html lng
- link :: [Attribute] -> Html lng
- main :: [Attribute] -> [Html lng] -> Html lng
- map :: [Attribute] -> [Html lng] -> Html lng
- mark :: [Attribute] -> [Html lng] -> Html lng
- menu :: [Attribute] -> [Html lng] -> Html lng
- meta :: [Attribute] -> Html lng
- meter :: [Attribute] -> [Html lng] -> Html lng
- nav :: [Attribute] -> [Html lng] -> Html lng
- noscript :: [Attribute] -> [Html lng] -> Html lng
- object :: [Attribute] -> [Html lng] -> Html lng
- ol :: [Attribute] -> [Html lng] -> Html lng
- optgroup :: [Attribute] -> [Html lng] -> Html lng
- option :: [Attribute] -> [Html lng] -> Html lng
- output :: [Attribute] -> [Html lng] -> Html lng
- p :: [Attribute] -> [Html lng] -> Html lng
- picture :: [Attribute] -> [Html lng] -> Html lng
- pre :: [Attribute] -> [Html lng] -> Html lng
- progress :: [Attribute] -> [Html lng] -> Html lng
- q :: [Attribute] -> [Html lng] -> Html lng
- rp :: [Attribute] -> [Html lng] -> Html lng
- rt :: [Attribute] -> [Html lng] -> Html lng
- ruby :: [Attribute] -> [Html lng] -> Html lng
- s :: [Attribute] -> [Html lng] -> Html lng
- samp :: [Attribute] -> [Html lng] -> Html lng
- script :: [Attribute] -> [Html lng] -> Html lng
- section :: [Attribute] -> [Html lng] -> Html lng
- select :: [Attribute] -> [Html lng] -> Html lng
- slot :: [Attribute] -> [Html lng] -> Html lng
- small :: [Attribute] -> [Html lng] -> Html lng
- source :: [Attribute] -> Html lng
- span :: [Attribute] -> [Html lng] -> Html lng
- strong :: [Attribute] -> [Html lng] -> Html lng
- style :: [Attribute] -> [Html lng] -> Html lng
- sub :: [Attribute] -> [Html lng] -> Html lng
- summary :: [Attribute] -> [Html lng] -> Html lng
- sup :: [Attribute] -> [Html lng] -> Html lng
- table :: [Attribute] -> [Html lng] -> Html lng
- tbody :: [Attribute] -> [Html lng] -> Html lng
- td :: [Attribute] -> [Html lng] -> Html lng
- template :: [Attribute] -> [Html lng] -> Html lng
- textarea :: [Attribute] -> [Html lng] -> Html lng
- tfoot :: [Attribute] -> [Html lng] -> Html lng
- th :: [Attribute] -> [Html lng] -> Html lng
- thead :: [Attribute] -> [Html lng] -> Html lng
- time :: [Attribute] -> [Html lng] -> Html lng
- title :: [Attribute] -> [Html lng] -> Html lng
- tr :: [Attribute] -> [Html lng] -> Html lng
- track :: [Attribute] -> Html lng
- u :: [Attribute] -> [Html lng] -> Html lng
- ul :: [Attribute] -> [Html lng] -> Html lng
- var :: [Attribute] -> [Html lng] -> Html lng
- video :: [Attribute] -> [Html lng] -> Html lng
- wbr :: [Attribute] -> Html lng
Types
Html
Represents an HTML element.
Note: The type variable lng stands for language and is used to facilitate internationalization.
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. |
Attribute
Represents an HTML attribute.
BoolAttribute Builder Bool | Constructs a boolean HTML attribute. |
TextAttribute Builder Builder | Constructs a textual HTML attribute. |
Classes
Buildable
class Buildable a where Source #
Enables conversion to Builder
.
Translatable
class Translatable a where Source #
Enables the use of multilingual text nodes with Html
.
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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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.