blaze-html-0.9.0.1/0000755000000000000000000000000013043670060012103 5ustar0000000000000000blaze-html-0.9.0.1/Setup.hs0000644000000000000000000000005613043670060013540 0ustar0000000000000000import Distribution.Simple main = defaultMain blaze-html-0.9.0.1/CHANGELOG0000644000000000000000000000220513043670060013314 0ustar0000000000000000# Changelog - 0.9.0.1 * Fix CHANGELOG - 0.9.0.0 * Bump blaze-html dependency to 0.8. This has a few consequences: - Make `MarkupM` finally adhere to the Monad laws - Stricten the `IsString` instance to only work with `MarkupM ()` and not `MarkupM a` - Change the type of `contents` to `MarkupM a -> MarkupM a` - Add a `Semigroup` instance for `MarkupM` - 0.7.1.1 - 0.8.1.3 * Bump HUnit dependency to 1.5 - 0.8.1.2 * Bump QuickCheck dependency to 2.9 - 0.8.1.1 * Bump HUnit dependency to 1.3 - 0.8.1.0 * Add `
` element to HTML5 - 0.8.0.2 * Relax blaze-builder dependency to include 0.3 again - 0.8.0.1 * Bump QuickCheck dependency to 2.8 - 0.8.0.0 * Bump blaze-builder dependency to 0.4 - 0.7.1.0 * Add `itemscope` and `itemprop` attributes * Constraint `blaze-markup` dependency - 0.7.0.3 * Dependency bump to allow `text-1.2` - 0.7.0.2 * Bump QuickCheck dependency to 2.7 - 0.7.0.1 * Fix incorrect blaze-markup dependency in tests - 0.7.0.0 * Bump blaze-markup so we get the (!?) operator for conditionally setting attributes blaze-html-0.9.0.1/blaze-html.cabal0000644000000000000000000000504613043670060015133 0ustar0000000000000000Name: blaze-html Version: 0.9.0.1 Homepage: http://jaspervdj.be/blaze Bug-Reports: http://github.com/jaspervdj/blaze-html/issues License: BSD3 License-file: LICENSE Author: Jasper Van der Jeugt, Simon Meier Maintainer: Jasper Van der Jeugt Stability: Experimental Category: Text Synopsis: A blazingly fast HTML combinator library for Haskell Description: A blazingly fast HTML combinator library for the Haskell programming language. The Text.Blaze module is a good starting point, as well as this tutorial: . Build-type: Simple Cabal-version: >= 1.8 Extra-source-files: CHANGELOG src/Util/Sanitize.hs src/Util/GenerateHtmlCombinators.hs Library Hs-source-dirs: src Ghc-Options: -Wall Exposed-modules: Text.Blaze.Html Text.Blaze.Html.Renderer.Pretty Text.Blaze.Html.Renderer.String Text.Blaze.Html.Renderer.Text Text.Blaze.Html.Renderer.Utf8 Text.Blaze.Html4.FrameSet Text.Blaze.Html4.FrameSet.Attributes Text.Blaze.Html4.Strict Text.Blaze.Html4.Strict.Attributes Text.Blaze.Html4.Transitional Text.Blaze.Html4.Transitional.Attributes Text.Blaze.Html5 Text.Blaze.Html5.Attributes Text.Blaze.XHtml1.FrameSet Text.Blaze.XHtml1.FrameSet.Attributes Text.Blaze.XHtml1.Strict 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, blaze-builder >= 0.3 && < 0.5, blaze-markup >= 0.8 && < 0.9, bytestring >= 0.9 && < 0.11, text >= 0.10 && < 1.3 Test-suite blaze-html-tests Type: exitcode-stdio-1.0 Hs-source-dirs: src tests Main-is: TestSuite.hs Ghc-options: -Wall Other-modules: Text.Blaze.Html.Tests Text.Blaze.Html.Tests.Util Util.Tests Build-depends: HUnit >= 1.2 && < 1.6, QuickCheck >= 2.4 && < 2.10, containers >= 0.3 && < 0.6, test-framework >= 0.4 && < 0.9, test-framework-hunit >= 0.3 && < 0.4, test-framework-quickcheck2 >= 0.3 && < 0.4, -- Copied from regular dependencies... base >= 4 && < 5, blaze-builder >= 0.3 && < 0.5, blaze-markup >= 0.8 && < 0.9, bytestring >= 0.9 && < 0.11, text >= 0.10 && < 1.3 Source-repository head Type: git Location: http://github.com/jaspervdj/blaze-html.git blaze-html-0.9.0.1/LICENSE0000644000000000000000000000277513043670060013123 0ustar0000000000000000Copyright Jasper Van der Jeugt 2010 All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Jasper Van der Jeugt nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. blaze-html-0.9.0.1/tests/0000755000000000000000000000000013043670060013245 5ustar0000000000000000blaze-html-0.9.0.1/tests/TestSuite.hs0000644000000000000000000000052213043670060015531 0ustar0000000000000000-- | Main module to run all tests. -- module Main where import Test.Framework (defaultMain, testGroup) import qualified Text.Blaze.Html.Tests import qualified Util.Tests main :: IO () main = defaultMain [ testGroup "Text.Blaze.Html.Tests" Text.Blaze.Html.Tests.tests , testGroup "Util.Tests" Util.Tests.tests ] blaze-html-0.9.0.1/tests/Util/0000755000000000000000000000000013043670060014162 5ustar0000000000000000blaze-html-0.9.0.1/tests/Util/Tests.hs0000644000000000000000000000076113043670060015624 0ustar0000000000000000module Util.Tests ( tests ) where import Test.Framework import Test.Framework.Providers.HUnit import Test.HUnit hiding (Test) import Util.Sanitize (sanitize) tests :: [Test] tests = [ testCase "sanitize case 1" sanitize1 , testCase "sanitize case 2" sanitize2 ] -- | Simple sanitize test case -- sanitize1 :: Assertion sanitize1 = "class_" @=? sanitize "CLASS" -- | Simple sanitize test case -- sanitize2 :: Assertion sanitize2 = "httpEquiv" @=? sanitize "http-equiv" blaze-html-0.9.0.1/tests/Text/0000755000000000000000000000000013043670060014171 5ustar0000000000000000blaze-html-0.9.0.1/tests/Text/Blaze/0000755000000000000000000000000013043670060015226 5ustar0000000000000000blaze-html-0.9.0.1/tests/Text/Blaze/Html/0000755000000000000000000000000013043670060016132 5ustar0000000000000000blaze-html-0.9.0.1/tests/Text/Blaze/Html/Tests.hs0000644000000000000000000000666013043670060017600 0ustar0000000000000000-- | A whole bunch of simple test cases -- {-# LANGUAGE OverloadedStrings #-} module Text.Blaze.Html.Tests ( tests ) where import Prelude hiding (div, id) import Control.Monad (forM_) import Data.Monoid (mempty, mappend, mconcat) import Data.Text (Text) import Test.HUnit ((@=?)) import Test.Framework.Providers.HUnit (testCase) import Test.Framework (Test) import qualified Data.ByteString.Lazy.Char8 as LBC import Text.Blaze.Html.Tests.Util import Text.Blaze.Html5 hiding (map) import Text.Blaze.Html5.Attributes import Text.Blaze.Internal import qualified Text.Blaze.Html5 as H -- | Type for a simple HTML test. This data type contains the expected output -- and the HTML template. -- data HtmlTest = HtmlTest LBC.ByteString Html -- | Create tests from an HTML test -- makeTests :: String -> HtmlTest -> [Test] makeTests baseName (HtmlTest expected h) = [ testCase (baseName ++ " (String)") $ expected @=? renderUsingString h , testCase (baseName ++ " (Text)") $ expected @=? renderUsingText h , testCase (baseName ++ " (Utf8)") $ expected @=? renderUsingUtf8 h ] -- | Actual tests -- tests :: [Test] tests = concatMap (uncurry makeTests) $ zip names -- Simple cases [ HtmlTest "

banana

banana
" $ div ! id "foo" $ do p "banana" H.span "banana" , HtmlTest "\"bar\"" $ img ! src "foo.png" ! alt "bar" -- Escaping cases , HtmlTest ""&"" "\"&\"" , HtmlTest "<img>" $ toHtml ("" :: Text) , HtmlTest ""'"" "\"'\"" , HtmlTest "" $ img ! src "&" -- Pre-escaping cases , HtmlTest "<3 Haskell" $ preEscapedToMarkup ("<3 Haskell" :: String) , HtmlTest " -- script :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. script = Parent "script" "" . external {-# INLINE script #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\
@ element. -- -- Example: -- -- > section $ span $ toHtml "foo" -- -- Result: -- -- >
foo
-- section :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. section = Parent "section" "" {-# INLINE section #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\foo -- select :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. select = Parent "select" "" {-# INLINE select #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > small $ span $ toHtml "foo" -- -- Result: -- -- > foo -- small :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. small = Parent "small" "" {-# INLINE small #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:226 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > source -- -- Result: -- -- > -- source :: Html -- ^ Resulting HTML. source = Leaf "source" "" () {-# INLINE source #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > span $ span $ toHtml "foo" -- -- Result: -- -- > foo -- span :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. span = Parent "span" "" {-# INLINE span #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > strong $ span $ toHtml "foo" -- -- Result: -- -- > foo -- strong :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. strong = Parent "strong" "" {-# INLINE strong #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\ -- style :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. style = Parent "style" "" . external {-# INLINE style #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > sub $ span $ toHtml "foo" -- -- Result: -- -- > foo -- sub :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. sub = Parent "sub" "" {-# INLINE sub #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > summary $ span $ toHtml "foo" -- -- Result: -- -- > foo -- summary :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. summary = Parent "summary" "" {-# INLINE summary #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > sup $ span $ toHtml "foo" -- -- Result: -- -- > foo -- sup :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. sup = Parent "sup" "" {-# INLINE sup #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > table $ span $ toHtml "foo" -- -- Result: -- -- >
foo
-- table :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. table = Parent "table" "" {-# INLINE table #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > tbody $ span $ toHtml "foo" -- -- Result: -- -- > foo -- tbody :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. tbody = Parent "tbody" "" {-# INLINE tbody #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > td $ span $ toHtml "foo" -- -- Result: -- -- > foo -- td :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. td = Parent "td" "" {-# INLINE td #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\ -- textarea :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. textarea = Parent "textarea" "" {-# INLINE textarea #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > tfoot $ span $ toHtml "foo" -- -- Result: -- -- > foo -- tfoot :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. tfoot = Parent "tfoot" "" {-# INLINE tfoot #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > th $ span $ toHtml "foo" -- -- Result: -- -- > foo -- th :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. th = Parent "th" "" {-# INLINE th #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\@ element. -- -- Example: -- -- > thead $ span $ toHtml "foo" -- -- Result: -- -- > foo -- thead :: Html -- ^ Inner HTML. -> Html -- ^ Resulting HTML. thead = Parent "thead" "" {-# INLINE thead #-} -- WARNING: The next block of code was automatically generated by -- src/Util/GenerateHtmlCombinators.hs:199 -- -- | Combinator for the @\