|
Text.CHXHtml.XHtml1_strict | Portability | portable
Description : CHXHtml (Compliant Haskell XHtml) produces W3C valid XHTML1 strict content in most cases* by building a datastructure based on the DTD. Nesting and allowed tags are controlled by recursive types.
To simplify usage, type classes are used to substitute the corret constructor for the given context, or throw a type error if the tag is not allowed in that context.
As a result, a single function exists per tag as well as attribute names.
Each tag has two variants, one with and one without parameters, specified as @_{tag} [{children tags}]@ or @{tag}_ [{attributes}] [{children tags}]@.
Underscores prevents namespace conflicts with @Prelude@ as well as cleaning up the syntax otherwise present using imported qualified.
Textual data is entered with the function @pcdata "String"@ wherever pcdata is allowed. pcdata is HTML excaped for safety.
For speed the variant @pcdata_bs "Data.ByteString"@ can be used which bypasses excaping.
Attributes are specified by the functions @{attribute name}_att@, followed by its value of the correct type. See below for specifics.
For W3C compliance only the last attribute will be used if duplicate names exist.
Rendering to a "String" is done with the 'render' function, or to a "Data.ByteString" via the 'render_bs' function. Note that "Data.ByteString" is significatly faster than Strings.
Under the hood we use a myriad of datatypes for tags and attributes whos details have been omitted below for brevity. To assist in selecting allowed tags and attributes
'htmlHelp' is provided which produces allowed children and attributes given a tag's nesting position. See 'htmlHelp' below for usage.
\*Note we do not enforce tag ordering as described in the DTD. | Stability | experimental | Maintainer | paul@fuzzpault.com |
|
|
|
|
|
Description |
|
|
Synopsis |
|
|
|
|
Tag & Attribute Help
|
|
htmlHelp :: [String] -> [[String]] |
htmlHelp provides a way of finding allowed children tags and attributes. For example a h1 inside a body tag inside an html tag is queried with
htmlHelp ["html","body","h1"]
= [["a","abbr",..,"tt","var"],["alt_att","class_att","dir_att",..,"usemap_att","width_att"]]
which returns a list of 2 elements, each their own list. The first is the allowed children tags, in this case 34. The second is a list of allowed attributes for
the h1 tag. Remember to add a _ as a prefix or suffix of all tags, as well as _bs if providing a Data.ByteString to an attribute.
|
|
Rendering
|
|
render :: Render a => a -> String |
|
render_bs :: Render a => a -> ByteString |
|
Tags
|
|
pcdata :: C_PCDATA a => String -> a |
|
pcdata_bs :: C_PCDATA a => ByteString -> a |
|
s2b |
|
_html :: [Ent0] -> Ent |
|
html_ :: [Att0] -> [Ent0] -> Ent |
|
_a :: C_A a b => [b] -> a |
|
a_ :: C_A a b => [Att16] -> [b] -> a |
|
_abbr :: C_Abbr a b => [b] -> a |
|
abbr_ :: C_Abbr a b => [Att11] -> [b] -> a |
|
_acronym :: C_Acronym a b => [b] -> a |
|
acronym_ :: C_Acronym a b => [Att11] -> [b] -> a |
|
_address :: C_Address a b => [b] -> a |
|
address_ :: C_Address a b => [Att11] -> [b] -> a |
|
_area :: C_Area a => a |
|
area_ :: C_Area a => [Att27] -> a |
|
_b :: C_B a b => [b] -> a |
|
b_ :: C_B a b => [Att11] -> [b] -> a |
|
_base :: C_Base a => a |
|
base_ :: C_Base a => [Att3] -> a |
|
_bdo :: C_Bdo a b => [b] -> a |
|
bdo_ :: C_Bdo a b => [Att11] -> [b] -> a |
|
_big :: C_Big a b => [b] -> a |
|
big_ :: C_Big a b => [Att11] -> [b] -> a |
|
_blockquote :: C_Blockquote a b => [b] -> a |
|
blockquote_ :: C_Blockquote a b => [Att14] -> [b] -> a |
|
_body :: C_Body a b => [b] -> a |
|
body_ :: C_Body a b => [Att12] -> [b] -> a |
|
_br :: C_Br a => a |
|
br_ :: C_Br a => [Att19] -> a |
|
_button :: C_Button a b => [b] -> a |
|
button_ :: C_Button a b => [Att40] -> [b] -> a |
|
_caption :: C_Caption a b => [b] -> a |
|
caption_ :: C_Caption a b => [Att11] -> [b] -> a |
|
_cite :: C_Cite a b => [b] -> a |
|
cite_ :: C_Cite a b => [Att11] -> [b] -> a |
|
_code :: C_Code a b => [b] -> a |
|
code_ :: C_Code a b => [Att11] -> [b] -> a |
|
_col :: C_Col a => a |
|
col_ :: C_Col a => [Att43] -> a |
|
_colgroup :: C_Colgroup a b => [b] -> a |
|
colgroup_ :: C_Colgroup a b => [Att43] -> [b] -> a |
|
_dd :: C_Dd a b => [b] -> a |
|
dd_ :: C_Dd a b => [Att11] -> [b] -> a |
|
_del :: C_Del a b => [b] -> a |
|
del_ :: C_Del a b => [Att15] -> [b] -> a |
|
_dfn :: C_Dfn a b => [b] -> a |
|
dfn_ :: C_Dfn a b => [Att11] -> [b] -> a |
|
_div :: C_Div a b => [b] -> a |
|
div_ :: C_Div a b => [Att11] -> [b] -> a |
|
_dl :: C_Dl a b => [b] -> a |
|
dl_ :: C_Dl a b => [Att11] -> [b] -> a |
|
_dt :: C_Dt a b => [b] -> a |
|
dt_ :: C_Dt a b => [Att11] -> [b] -> a |
|
_em :: C_Em a b => [b] -> a |
|
em_ :: C_Em a b => [Att11] -> [b] -> a |
|
_fieldset :: C_Fieldset a b => [b] -> a |
|
fieldset_ :: C_Fieldset a b => [Att11] -> [b] -> a |
|
_form :: C_Form a b => [b] -> a |
|
form_ :: C_Form a b => [Att28] -> [b] -> a |
|
_h1 :: C_H1 a b => [b] -> a |
|
h1_ :: C_H1 a b => [Att11] -> [b] -> a |
|
_h2 :: C_H2 a b => [b] -> a |
|
h2_ :: C_H2 a b => [Att11] -> [b] -> a |
|
_h3 :: C_H3 a b => [b] -> a |
|
h3_ :: C_H3 a b => [Att11] -> [b] -> a |
|
_h4 :: C_H4 a b => [b] -> a |
|
h4_ :: C_H4 a b => [Att11] -> [b] -> a |
|
_h5 :: C_H5 a b => [b] -> a |
|
h5_ :: C_H5 a b => [Att11] -> [b] -> a |
|
_h6 :: C_H6 a b => [b] -> a |
|
h6_ :: C_H6 a b => [Att11] -> [b] -> a |
|
_head :: C_Head a b => [b] -> a |
|
head_ :: C_Head a b => [Att1] -> [b] -> a |
|
_hr :: C_Hr a => a |
|
hr_ :: C_Hr a => [Att11] -> a |
|
_i :: C_I a b => [b] -> a |
|
i_ :: C_I a b => [Att11] -> [b] -> a |
|
_img :: C_Img a => a |
|
img_ :: C_Img a => [Att22] -> a |
|
_input :: C_Input a => a |
|
input_ :: C_Input a => [Att31] -> a |
|
_ins :: C_Ins a b => [b] -> a |
|
ins_ :: C_Ins a b => [Att15] -> [b] -> a |
|
_kbd :: C_Kbd a b => [b] -> a |
|
kbd_ :: C_Kbd a b => [Att11] -> [b] -> a |
|
_label :: C_Label a b => [b] -> a |
|
label_ :: C_Label a b => [Att30] -> [b] -> a |
|
_legend :: C_Legend a b => [b] -> a |
|
legend_ :: C_Legend a b => [Att39] -> [b] -> a |
|
_li :: C_Li a b => [b] -> a |
|
li_ :: C_Li a b => [Att11] -> [b] -> a |
|
_link :: C_Link a => a |
|
link_ :: C_Link a => [Att7] -> a |
|
_map :: C_Map a b => [b] -> a |
|
map_ :: C_Map a b => [Att25] -> [b] -> a |
|
_meta :: C_Meta a => a |
|
meta_ :: C_Meta a => [Att5] -> a |
|
_noscript :: C_Noscript a b => [b] -> a |
|
noscript_ :: C_Noscript a b => [Att11] -> [b] -> a |
|
_object :: C_Object a b => [b] -> a |
|
object_ :: C_Object a b => [Att20] -> [b] -> a |
|
_ol :: C_Ol a b => [b] -> a |
|
ol_ :: C_Ol a b => [Att11] -> [b] -> a |
|
_optgroup :: C_Optgroup a b => [b] -> a |
|
optgroup_ :: C_Optgroup a b => [Att33] -> [b] -> a |
|
_option :: C_Option a b => [b] -> a |
|
option_ :: C_Option a b => [Att35] -> [b] -> a |
|
_p :: C_P a b => [b] -> a |
|
p_ :: C_P a b => [Att11] -> [b] -> a |
|
_param :: C_Param a => a |
|
param_ :: C_Param a => [Att21] -> a |
|
_pre :: C_Pre a b => [b] -> a |
|
pre_ :: C_Pre a b => [Att13] -> [b] -> a |
|
_q :: C_Q a b => [b] -> a |
|
q_ :: C_Q a b => [Att14] -> [b] -> a |
|
_samp :: C_Samp a b => [b] -> a |
|
samp_ :: C_Samp a b => [Att11] -> [b] -> a |
|
_script :: C_Script a b => [b] -> a |
|
script_ :: C_Script a b => [Att10] -> [b] -> a |
|
_select :: C_Select a b => [b] -> a |
|
select_ :: C_Select a b => [Att32] -> [b] -> a |
|
_small :: C_Small a b => [b] -> a |
|
small_ :: C_Small a b => [Att11] -> [b] -> a |
|
_span :: C_Span a b => [b] -> a |
|
span_ :: C_Span a b => [Att11] -> [b] -> a |
|
_strong :: C_Strong a b => [b] -> a |
|
strong_ :: C_Strong a b => [Att11] -> [b] -> a |
|
_style :: C_Style a b => [b] -> a |
|
style_ :: C_Style a b => [Att8] -> [b] -> a |
|
_sub :: C_Sub a b => [b] -> a |
|
sub_ :: C_Sub a b => [Att11] -> [b] -> a |
|
_sup :: C_Sup a b => [b] -> a |
|
sup_ :: C_Sup a b => [Att11] -> [b] -> a |
|
_table :: C_Table a b => [b] -> a |
|
table_ :: C_Table a b => [Att41] -> [b] -> a |
|
_tbody :: C_Tbody a b => [b] -> a |
|
tbody_ :: C_Tbody a b => [Att42] -> [b] -> a |
|
_td :: C_Td a b => [b] -> a |
|
td_ :: C_Td a b => [Att44] -> [b] -> a |
|
_textarea :: C_Textarea a b => [b] -> a |
|
textarea_ :: C_Textarea a b => [Att36] -> [b] -> a |
|
_tfoot :: C_Tfoot a b => [b] -> a |
|
tfoot_ :: C_Tfoot a b => [Att42] -> [b] -> a |
|
_th :: C_Th a b => [b] -> a |
|
th_ :: C_Th a b => [Att44] -> [b] -> a |
|
_thead :: C_Thead a b => [b] -> a |
|
thead_ :: C_Thead a b => [Att42] -> [b] -> a |
|
_title :: C_Title a b => [b] -> a |
|
title_ :: C_Title a b => [Att2] -> [b] -> a |
|
_tr :: C_Tr a b => [b] -> a |
|
tr_ :: C_Tr a b => [Att42] -> [b] -> a |
|
_tt :: C_Tt a b => [b] -> a |
|
tt_ :: C_Tt a b => [Att11] -> [b] -> a |
|
_ul :: C_Ul a b => [b] -> a |
|
ul_ :: C_Ul a b => [Att11] -> [b] -> a |
|
_var :: C_Var a b => [b] -> a |
|
var_ :: C_Var a b => [Att11] -> [b] -> a |
|
Attributes
|
|
http_equiv_att :: A_Http_equiv a => String -> a |
|
http_equiv_att_bs :: A_Http_equiv a => ByteString -> a |
|
content_att :: A_Content a => String -> a |
|
content_att_bs :: A_Content a => ByteString -> a |
|
nohref_att :: A_Nohref a => String -> a |
|
onkeydown_att :: A_Onkeydown a => String -> a |
|
onkeydown_att_bs :: A_Onkeydown a => ByteString -> a |
|
onkeyup_att :: A_Onkeyup a => String -> a |
|
onkeyup_att_bs :: A_Onkeyup a => ByteString -> a |
|
onreset_att :: A_Onreset a => String -> a |
|
onreset_att_bs :: A_Onreset a => ByteString -> a |
|
onmouseup_att :: A_Onmouseup a => String -> a |
|
onmouseup_att_bs :: A_Onmouseup a => ByteString -> a |
|
scope_att :: A_Scope a => ScopeEnum -> a |
|
onmouseover_att :: A_Onmouseover a => String -> a |
|
onmouseover_att_bs :: A_Onmouseover a => ByteString -> a |
|
align_att :: A_Align a => AlignEnum -> a |
|
lang_att :: A_Lang a => String -> a |
|
lang_att_bs :: A_Lang a => ByteString -> a |
|
valign_att :: A_Valign a => ValignEnum -> a |
|
name_att :: A_Name a => String -> a |
|
name_att_bs :: A_Name a => ByteString -> a |
|
charset_att :: A_Charset a => String -> a |
|
charset_att_bs :: A_Charset a => ByteString -> a |
|
scheme_att :: A_Scheme a => String -> a |
|
scheme_att_bs :: A_Scheme a => ByteString -> a |
|
accept_charset_att :: A_Accept_charset a => String -> a |
|
accept_charset_att_bs :: A_Accept_charset a => ByteString -> a |
|
onmousedown_att :: A_Onmousedown a => String -> a |
|
onmousedown_att_bs :: A_Onmousedown a => ByteString -> a |
|
rev_att :: A_Rev a => String -> a |
|
rev_att_bs :: A_Rev a => ByteString -> a |
|
span_att :: A_Span a => String -> a |
|
span_att_bs :: A_Span a => ByteString -> a |
|
title_att :: A_Title a => String -> a |
|
title_att_bs :: A_Title a => ByteString -> a |
|
onclick_att :: A_Onclick a => String -> a |
|
onclick_att_bs :: A_Onclick a => ByteString -> a |
|
width_att :: A_Width a => String -> a |
|
width_att_bs :: A_Width a => ByteString -> a |
|
enctype_att :: A_Enctype a => String -> a |
|
enctype_att_bs :: A_Enctype a => ByteString -> a |
|
ismap_att :: A_Ismap a => String -> a |
|
usemap_att :: A_Usemap a => String -> a |
|
usemap_att_bs :: A_Usemap a => ByteString -> a |
|
coords_att :: A_Coords a => String -> a |
|
coords_att_bs :: A_Coords a => ByteString -> a |
|
frame_att :: A_Frame a => FrameEnum -> a |
|
size_att :: A_Size a => String -> a |
|
size_att_bs :: A_Size a => ByteString -> a |
|
onblur_att :: A_Onblur a => String -> a |
|
onblur_att_bs :: A_Onblur a => ByteString -> a |
|
datetime_att :: A_Datetime a => String -> a |
|
datetime_att_bs :: A_Datetime a => ByteString -> a |
|
dir_att :: A_Dir a => DirEnum -> a |
|
summary_att :: A_Summary a => String -> a |
|
summary_att_bs :: A_Summary a => ByteString -> a |
|
method_att :: A_Method a => MethodEnum -> a |
|
standby_att :: A_Standby a => String -> a |
|
standby_att_bs :: A_Standby a => ByteString -> a |
|
tabindex_att :: A_Tabindex a => String -> a |
|
tabindex_att_bs :: A_Tabindex a => ByteString -> a |
|
style_att :: A_Style a => String -> a |
|
style_att_bs :: A_Style a => ByteString -> a |
|
onmousemove_att :: A_Onmousemove a => String -> a |
|
onmousemove_att_bs :: A_Onmousemove a => ByteString -> a |
|
height_att :: A_Height a => String -> a |
|
height_att_bs :: A_Height a => ByteString -> a |
|
codetype_att :: A_Codetype a => String -> a |
|
codetype_att_bs :: A_Codetype a => ByteString -> a |
|
char_att :: A_Char a => String -> a |
|
char_att_bs :: A_Char a => ByteString -> a |
|
multiple_att :: A_Multiple a => String -> a |
|
codebase_att :: A_Codebase a => String -> a |
|
codebase_att_bs :: A_Codebase a => ByteString -> a |
|
xmlns_att :: A_Xmlns a => String -> a |
|
xmlns_att_bs :: A_Xmlns a => ByteString -> a |
|
profile_att :: A_Profile a => String -> a |
|
profile_att_bs :: A_Profile a => ByteString -> a |
|
rel_att :: A_Rel a => String -> a |
|
rel_att_bs :: A_Rel a => ByteString -> a |
|
onsubmit_att :: A_Onsubmit a => String -> a |
|
onsubmit_att_bs :: A_Onsubmit a => ByteString -> a |
|
ondblclick_att :: A_Ondblclick a => String -> a |
|
ondblclick_att_bs :: A_Ondblclick a => ByteString -> a |
|
axis_att :: A_Axis a => String -> a |
|
axis_att_bs :: A_Axis a => ByteString -> a |
|
cols_att :: A_Cols a => String -> a |
|
cols_att_bs :: A_Cols a => ByteString -> a |
|
abbr_att :: A_Abbr a => String -> a |
|
abbr_att_bs :: A_Abbr a => ByteString -> a |
|
onchange_att :: A_Onchange a => String -> a |
|
onchange_att_bs :: A_Onchange a => ByteString -> a |
|
readonly_att :: A_Readonly a => String -> a |
|
href_att :: A_Href a => String -> a |
|
href_att_bs :: A_Href a => ByteString -> a |
|
media_att :: A_Media a => String -> a |
|
media_att_bs :: A_Media a => ByteString -> a |
|
id_att :: A_Id a => String -> a |
|
id_att_bs :: A_Id a => ByteString -> a |
|
for_att :: A_For a => String -> a |
|
for_att_bs :: A_For a => ByteString -> a |
|
src_att :: A_Src a => String -> a |
|
src_att_bs :: A_Src a => ByteString -> a |
|
value_att :: A_Value a => String -> a |
|
value_att_bs :: A_Value a => ByteString -> a |
|
data_att :: A_Data a => String -> a |
|
data_att_bs :: A_Data a => ByteString -> a |
|
hreflang_att :: A_Hreflang a => String -> a |
|
hreflang_att_bs :: A_Hreflang a => ByteString -> a |
|
checked_att :: A_Checked a => String -> a |
|
declare_att :: A_Declare a => String -> a |
|
onkeypress_att :: A_Onkeypress a => String -> a |
|
onkeypress_att_bs :: A_Onkeypress a => ByteString -> a |
|
label_att :: A_Label a => String -> a |
|
label_att_bs :: A_Label a => ByteString -> a |
|
class_att :: A_Class a => String -> a |
|
class_att_bs :: A_Class a => ByteString -> a |
|
type_att :: A_Type a => String -> a |
|
type_att_bs :: A_Type a => ByteString -> a |
|
shape_att :: A_Shape a => ShapeEnum -> a |
|
accesskey_att :: A_Accesskey a => String -> a |
|
accesskey_att_bs :: A_Accesskey a => ByteString -> a |
|
headers_att :: A_Headers a => String -> a |
|
headers_att_bs :: A_Headers a => ByteString -> a |
|
disabled_att :: A_Disabled a => String -> a |
|
rules_att :: A_Rules a => RulesEnum -> a |
|
rows_att :: A_Rows a => String -> a |
|
rows_att_bs :: A_Rows a => ByteString -> a |
|
onfocus_att :: A_Onfocus a => String -> a |
|
onfocus_att_bs :: A_Onfocus a => ByteString -> a |
|
colspan_att :: A_Colspan a => String -> a |
|
colspan_att_bs :: A_Colspan a => ByteString -> a |
|
rowspan_att :: A_Rowspan a => String -> a |
|
rowspan_att_bs :: A_Rowspan a => ByteString -> a |
|
defer_att :: A_Defer a => String -> a |
|
cellspacing_att :: A_Cellspacing a => String -> a |
|
cellspacing_att_bs :: A_Cellspacing a => ByteString -> a |
|
charoff_att :: A_Charoff a => String -> a |
|
charoff_att_bs :: A_Charoff a => ByteString -> a |
|
cite_att :: A_Cite a => String -> a |
|
cite_att_bs :: A_Cite a => ByteString -> a |
|
maxlength_att :: A_Maxlength a => String -> a |
|
maxlength_att_bs :: A_Maxlength a => ByteString -> a |
|
onselect_att :: A_Onselect a => String -> a |
|
onselect_att_bs :: A_Onselect a => ByteString -> a |
|
accept_att :: A_Accept a => String -> a |
|
accept_att_bs :: A_Accept a => ByteString -> a |
|
archive_att :: A_Archive a => String -> a |
|
archive_att_bs :: A_Archive a => ByteString -> a |
|
alt_att :: A_Alt a => String -> a |
|
alt_att_bs :: A_Alt a => ByteString -> a |
|
classid_att :: A_Classid a => String -> a |
|
classid_att_bs :: A_Classid a => ByteString -> a |
|
longdesc_att :: A_Longdesc a => String -> a |
|
longdesc_att_bs :: A_Longdesc a => ByteString -> a |
|
onmouseout_att :: A_Onmouseout a => String -> a |
|
onmouseout_att_bs :: A_Onmouseout a => ByteString -> a |
|
space_att :: A_Space a => String -> a |
|
border_att :: A_Border a => String -> a |
|
border_att_bs :: A_Border a => ByteString -> a |
|
onunload_att :: A_Onunload a => String -> a |
|
onunload_att_bs :: A_Onunload a => ByteString -> a |
|
onload_att :: A_Onload a => String -> a |
|
onload_att_bs :: A_Onload a => ByteString -> a |
|
action_att :: A_Action a => String -> a |
|
action_att_bs :: A_Action a => ByteString -> a |
|
cellpadding_att :: A_Cellpadding a => String -> a |
|
cellpadding_att_bs :: A_Cellpadding a => ByteString -> a |
|
valuetype_att :: A_Valuetype a => ValuetypeEnum -> a |
|
selected_att :: A_Selected a => String -> a |
|
Enumerated Attribute Values
|
|
data ValuetypeEnum |
Constructors | | Instances | |
|
|
data RulesEnum |
Constructors | | Instances | |
|
|
data ShapeEnum |
Constructors | | Instances | |
|
|
data MethodEnum |
Constructors | | Instances | |
|
|
data DirEnum |
Constructors | | Instances | |
|
|
data FrameEnum |
Constructors | Void | | Above | | Below | | Hsides | | Lhs | | Rhs | | Vsides | | Box | | Border | |
| Instances | |
|
|
data ValignEnum |
Constructors | | Instances | |
|
|
data AlignEnum |
Constructors | Left | | Center | | Right | | Justify | | Char | |
| Instances | |
|
|
data ScopeEnum |
Constructors | | Instances | |
|
|
Produced by Haddock version 2.4.2 |