Permalink
Browse files

Add XHTML5 option, patch by Hugo Landau

  • Loading branch information...
1 parent 5462b1e commit 844c3ce097c5251e4c935a00f9e8a4b23595c02a @jaspervdj committed Sep 4, 2012
Showing with 21 additions and 4 deletions.
  1. +2 −0 .gitignore
  2. +3 −4 Makefile
  3. +2 −0 blaze-html.cabal
  4. +14 −0 src/Util/GenerateHtmlCombinators.hs
View
@@ -39,3 +39,5 @@ src/Text/Blaze/XHtml1/Strict.hs
src/Text/Blaze/XHtml1/Strict/Attributes.hs
src/Text/Blaze/XHtml1/Transitional.hs
src/Text/Blaze/XHtml1/Transitional/Attributes.hs
+src/Text/Blaze/XHtml5.hs
+src/Text/Blaze/XHtml5/Attributes.hs
View
@@ -82,7 +82,6 @@ blaze-from-html: hide-cabal-files
# Cleanup
clean:
- rm -rf doc/examples/BenchmarkServer doc/examples/*.hi
- rm -rf benchmarks/HtmlBenchmarks benchmarks/*.hi
- rm -rf Text/Blaze/*.hi Text/Blaze/Html4/*.hi Text/Blaze/Html5/*.hi Text/Blaze/Renderer/*.hi Text/*.hi
- rm -rf Text/Blaze/*.o Text/Blaze/Html4/*.o Text/Blaze/Html5/*.o Text/Blaze/Renderer/*.o Text/*.o
+ rm -rf doc/examples/BenchmarkServer
+ rm -rf benchmarks/HtmlBenchmarks
+ find . -name '*.o' -o -name '*.hi' | xargs rm
View
@@ -46,6 +46,8 @@ Library
Text.Blaze.XHtml1.Strict.Attributes
Text.Blaze.XHtml1.Transitional
Text.Blaze.XHtml1.Transitional.Attributes
+ Text.Blaze.XHtml5
+ Text.Blaze.XHtml5.Attributes
Build-depends:
base >= 4 && < 5,
@@ -453,6 +453,19 @@ html5 = HtmlVariant
, selfClosing = False
}
+-- | XHTML 5.0
+--
+xhtml5 :: HtmlVariant
+xhtml5 = HtmlVariant
+ { version = ["XHtml5"]
+ , docType = ["<!DOCTYPE HTML>"]
+ , parents = parents html5
+ , leafs = leafs html5
+ , attributes = attributes html5
+ , selfClosing = True
+ }
+
+
-- | A map of HTML variants, per version, lowercase.
--
htmlVariants :: Map String HtmlVariant
@@ -464,6 +477,7 @@ htmlVariants = M.fromList $ map (show &&& id)
, xhtml1Transitional
, xhtml1FrameSet
, html5
+ , xhtml5
]
main :: IO ()

0 comments on commit 844c3ce

Please sign in to comment.