Skip to content

Commit

Permalink
refactor html5 data into separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj committed Mar 6, 2024
1 parent d21aea1 commit 90c2538
Show file tree
Hide file tree
Showing 18 changed files with 2,034 additions and 1,779 deletions.
186 changes: 93 additions & 93 deletions src/Text/Blaze/Html4/FrameSet.hs

Large diffs are not rendered by default.

212 changes: 106 additions & 106 deletions src/Text/Blaze/Html4/FrameSet/Attributes.hs

Large diffs are not rendered by default.

160 changes: 80 additions & 80 deletions src/Text/Blaze/Html4/Strict.hs

Large diffs are not rendered by default.

186 changes: 93 additions & 93 deletions src/Text/Blaze/Html4/Strict/Attributes.hs

Large diffs are not rendered by default.

182 changes: 91 additions & 91 deletions src/Text/Blaze/Html4/Transitional.hs

Large diffs are not rendered by default.

208 changes: 104 additions & 104 deletions src/Text/Blaze/Html4/Transitional/Attributes.hs

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions src/Text/Blaze/Html5.hs

Large diffs are not rendered by default.

348 changes: 174 additions & 174 deletions src/Text/Blaze/Html5/Attributes.hs

Large diffs are not rendered by default.

186 changes: 93 additions & 93 deletions src/Text/Blaze/XHtml1/FrameSet.hs

Large diffs are not rendered by default.

212 changes: 106 additions & 106 deletions src/Text/Blaze/XHtml1/FrameSet/Attributes.hs

Large diffs are not rendered by default.

160 changes: 80 additions & 80 deletions src/Text/Blaze/XHtml1/Strict.hs

Large diffs are not rendered by default.

186 changes: 93 additions & 93 deletions src/Text/Blaze/XHtml1/Strict/Attributes.hs

Large diffs are not rendered by default.

182 changes: 91 additions & 91 deletions src/Text/Blaze/XHtml1/Transitional.hs

Large diffs are not rendered by default.

208 changes: 104 additions & 104 deletions src/Text/Blaze/XHtml1/Transitional/Attributes.hs

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions src/Text/Blaze/XHtml5.hs

Large diffs are not rendered by default.

348 changes: 174 additions & 174 deletions src/Text/Blaze/XHtml5/Attributes.hs

Large diffs are not rendered by default.

64 changes: 7 additions & 57 deletions src/Util/GenerateHtmlCombinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import qualified Data.Map as M
import Data.Char (toLower)
import qualified Data.Set as S

import qualified Util.GenerateHtmlCombinators.Html5 as Html5
import Util.Sanitize (sanitize, prelude)

-- | Datatype for an HTML variant.
Expand Down Expand Up @@ -393,66 +394,15 @@ xhtml1FrameSet = HtmlVariant
}

-- | HTML 5.0
-- A good reference can be found here:
-- http://www.w3schools.com/html5/html5_reference.asp
-- Specified in a different file since this is the only one that is "alive".
--
html5 :: HtmlVariant
html5 = HtmlVariant
{ version = ["Html5"]
, docType = ["<!DOCTYPE HTML>"]
, parents =
[ "a", "abbr", "address", "article", "aside", "audio", "b", "bdi", "bdo"
, "blockquote", "body", "button", "canvas", "caption", "cite", "code"
, "colgroup", "command", "data", "datalist", "dd", "del", "details"
, "dfn", "dialog", "div", "dl", "dt", "em", "fieldset", "figcaption"
, "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head"
, "header", "hgroup", "html", "i", "iframe", "ins", "kbd", "label"
, "legend", "li", "main", "map", "mark", "menu", "meter", "nav"
, "noscript", "object", "ol", "optgroup", "option", "output", "p"
, "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp"
, "search", "script", "section", "select", "slot", "small", "span"
, "strong", "style", "sub", "summary", "sup", "table", "tbody", "td"
, "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr"
, "u", "ul", "var", "video"
]
, leafs =
-- http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#void-elements
[ "area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
, "link", "menuitem", "meta", "param", "source", "track", "wbr"
]
, attributes =
[ "accept", "accept-charset", "accesskey", "action", "alt", "async"
, "autocomplete", "autofocus", "autoplay", "challenge", "charset"
, "checked", "cite", "class", "cols", "colspan", "content"
, "contenteditable", "contextmenu", "controls", "coords", "data"
, "datetime", "defer", "dir", "disabled", "download", "draggable", "enctype", "for"
, "form", "formaction", "formenctype", "formmethod", "formnovalidate"
, "formtarget", "headers", "height", "hidden", "high", "href"
, "hreflang", "http-equiv", "icon", "id", "ismap", "item", "itemprop"
, "itemscope", "itemtype"
, "keytype", "label", "lang", "list", "loop", "low", "manifest", "max"
, "maxlength", "media", "method", "min", "minlength", "multiple", "name"
, "novalidate", "onbeforeonload", "onbeforeprint", "onblur", "oncanplay"
, "oncanplaythrough", "onchange", "oncontextmenu", "onclick"
, "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave"
, "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied"
, "onended", "onerror", "onfocus", "onformchange", "onforminput"
, "onhaschange", "oninput", "oninvalid", "onkeydown", "onkeyup"
, "onload", "onloadeddata", "onloadedmetadata", "onloadstart"
, "onmessage", "onmousedown", "onmousemove", "onmouseout", "onmouseover"
, "onmouseup", "onmousewheel", "ononline", "onpagehide", "onpageshow"
, "onpause", "onplay", "onplaying", "onprogress", "onpropstate"
, "onratechange", "onreadystatechange", "onredo", "onresize", "onscroll"
, "onseeked", "onseeking", "onselect", "onstalled", "onstorage"
, "onsubmit", "onsuspend", "ontimeupdate", "onundo", "onunload"
, "onvolumechange", "onwaiting", "open", "optimum", "pattern", "ping"
, "placeholder", "preload", "property", "pubdate", "radiogroup"
, "readonly", "rel", "required", "reversed", "role", "rows", "rowspan"
, "sandbox", "scope", "scoped", "seamless", "selected", "shape", "size"
, "sizes", "span", "spellcheck", "src", "srcdoc", "start", "step"
, "style", "subject", "summary", "tabindex", "target", "title", "type"
, "usemap", "value", "width", "wrap", "xmlns"
]
{ version = ["Html5"]
, docType = ["<!DOCTYPE HTML>"]
, parents = Html5.parents
, leafs = Html5.leafs
, attributes = Html5.attributes
, selfClosing = False
}

Expand Down
305 changes: 305 additions & 0 deletions src/Util/GenerateHtmlCombinators/Html5.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,305 @@
module Util.GenerateHtmlCombinators.Html5
( parents
, leafs
, attributes
) where

parents :: [String]
parents =
[ "a"
, "abbr"
, "address"
, "article"
, "aside"
, "audio"
, "b"
, "bdi"
, "bdo"
, "blockquote"
, "body"
, "button"
, "canvas"
, "caption"
, "cite"
, "code"
, "colgroup"
, "command"
, "data"
, "datalist"
, "dd"
, "del"
, "details"
, "dfn"
, "dialog"
, "div"
, "dl"
, "dt"
, "em"
, "fieldset"
, "figcaption"
, "figure"
, "footer"
, "form"
, "h1"
, "h2"
, "h3"
, "h4"
, "h5"
, "h6"
, "head"
, "header"
, "hgroup"
, "html"
, "i"
, "iframe"
, "ins"
, "kbd"
, "label"
, "legend"
, "li"
, "main"
, "map"
, "mark"
, "menu"
, "meter"
, "nav"
, "noscript"
, "object"
, "ol"
, "optgroup"
, "option"
, "output"
, "p"
, "picture"
, "pre"
, "progress"
, "q"
, "rp"
, "rt"
, "ruby"
, "s"
, "samp"
, "search"
, "script"
, "section"
, "select"
, "slot"
, "small"
, "span"
, "strong"
, "style"
, "sub"
, "summary"
, "sup"
, "table"
, "tbody"
, "td"
, "template"
, "textarea"
, "tfoot"
, "th"
, "thead"
, "time"
, "title"
, "tr"
, "u"
, "ul"
, "var"
, "video"
]

leafs :: [String]
leafs =
[ "area"
, "base"
, "br"
, "col"
, "embed"
, "hr"
, "img"
, "input"
, "keygen"
, "link"
, "menuitem"
, "meta"
, "param"
, "source"
, "track"
, "wbr"
]

attributes :: [String]
attributes =
[ "accept"
, "accept-charset"
, "accesskey"
, "action"
, "alt"
, "async"
, "autocomplete"
, "autofocus"
, "autoplay"
, "challenge"
, "charset"
, "checked"
, "cite"
, "class"
, "cols"
, "colspan"
, "content"
, "contenteditable"
, "contextmenu"
, "controls"
, "coords"
, "data"
, "datetime"
, "defer"
, "dir"
, "disabled"
, "download"
, "draggable"
, "enctype"
, "for"
, "form"
, "formaction"
, "formenctype"
, "formmethod"
, "formnovalidate"
, "formtarget"
, "headers"
, "height"
, "hidden"
, "high"
, "href"
, "hreflang"
, "http-equiv"
, "icon"
, "id"
, "ismap"
, "item"
, "itemprop"
, "itemscope"
, "itemtype"
, "keytype"
, "label"
, "lang"
, "list"
, "loop"
, "low"
, "manifest"
, "max"
, "maxlength"
, "media"
, "method"
, "min"
, "minlength"
, "multiple"
, "name"
, "novalidate"
, "onbeforeonload"
, "onbeforeprint"
, "onblur"
, "oncanplay"
, "oncanplaythrough"
, "onchange"
, "oncontextmenu"
, "onclick"
, "ondblclick"
, "ondrag"
, "ondragend"
, "ondragenter"
, "ondragleave"
, "ondragover"
, "ondragstart"
, "ondrop"
, "ondurationchange"
, "onemptied"
, "onended"
, "onerror"
, "onfocus"
, "onformchange"
, "onforminput"
, "onhaschange"
, "oninput"
, "oninvalid"
, "onkeydown"
, "onkeyup"
, "onload"
, "onloadeddata"
, "onloadedmetadata"
, "onloadstart"
, "onmessage"
, "onmousedown"
, "onmousemove"
, "onmouseout"
, "onmouseover"
, "onmouseup"
, "onmousewheel"
, "ononline"
, "onpagehide"
, "onpageshow"
, "onpause"
, "onplay"
, "onplaying"
, "onprogress"
, "onpropstate"
, "onratechange"
, "onreadystatechange"
, "onredo"
, "onresize"
, "onscroll"
, "onseeked"
, "onseeking"
, "onselect"
, "onstalled"
, "onstorage"
, "onsubmit"
, "onsuspend"
, "ontimeupdate"
, "onundo"
, "onunload"
, "onvolumechange"
, "onwaiting"
, "open"
, "optimum"
, "pattern"
, "ping"
, "placeholder"
, "preload"
, "property"
, "pubdate"
, "radiogroup"
, "readonly"
, "rel"
, "required"
, "reversed"
, "role"
, "rows"
, "rowspan"
, "sandbox"
, "scope"
, "scoped"
, "seamless"
, "selected"
, "shape"
, "size"
, "sizes"
, "span"
, "spellcheck"
, "src"
, "srcdoc"
, "start"
, "step"
, "style"
, "subject"
, "summary"
, "tabindex"
, "target"
, "title"
, "type"
, "usemap"
, "value"
, "width"
, "wrap"
, "xmlns"
]

0 comments on commit 90c2538

Please sign in to comment.