diff -Nru haskell-blaze-markup-0.5.1.6/blaze-markup.cabal haskell-blaze-markup-0.7.0.3/blaze-markup.cabal --- haskell-blaze-markup-0.5.1.6/blaze-markup.cabal 2013-12-05 10:13:51.000000000 +0000 +++ haskell-blaze-markup-0.7.0.3/blaze-markup.cabal 2015-09-28 09:45:08.000000000 +0000 @@ -1,5 +1,5 @@ Name: blaze-markup -Version: 0.5.1.6 +Version: 0.7.0.3 Homepage: http://jaspervdj.be/blaze Bug-Reports: http://github.com/jaspervdj/blaze-markup/issues License: BSD3 @@ -18,6 +18,9 @@ Build-type: Simple Cabal-version: >= 1.8 +Extra-source-files: + CHANGELOG + Library Hs-source-dirs: src Ghc-Options: -Wall @@ -32,8 +35,8 @@ Build-depends: base >= 4 && < 5, - blaze-builder >= 0.2 && < 0.4, - text >= 0.10 && < 1.1, + blaze-builder >= 0.3 && < 0.5, + text >= 0.10 && < 1.3, bytestring >= 0.9 && < 0.11 Test-suite blaze-markup-tests @@ -47,16 +50,16 @@ Text.Blaze.Tests.Util Build-depends: - HUnit >= 1.2 && < 1.3, - QuickCheck >= 2.4 && < 2.7, + HUnit >= 1.2 && < 1.4, + QuickCheck >= 2.4 && < 2.9, 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.2 && < 0.4, - text >= 0.10 && < 1.1, + blaze-builder >= 0.3 && < 0.5, + text >= 0.10 && < 1.3, bytestring >= 0.9 && < 0.11 Source-repository head diff -Nru haskell-blaze-markup-0.5.1.6/CHANGELOG haskell-blaze-markup-0.7.0.3/CHANGELOG --- haskell-blaze-markup-0.5.1.6/CHANGELOG 1970-01-01 00:00:00.000000000 +0000 +++ haskell-blaze-markup-0.7.0.3/CHANGELOG 2015-09-28 09:45:08.000000000 +0000 @@ -0,0 +1,30 @@ +- 0.7.0.3 + * Relax `HUnit` dependency to allow 1.3 + +- 0.7.0.2 + * Relax `blaze-builder` dependency to allow 0.3 + +- 0.7.0.1 + * Bump `QuickCheck` dependency to allow 2.8 + +- 0.7.0.0 + * Depend on blaze-builder 0.4 + +- 0.6.3.0 + * Add combinators to insert HTML comments + +- 0.6.2.0 + * Add `Applicative` instance for `MarkupM` + +- 0.6.1.1 + * Bump `text` dependency to allow 1.2 + +- 0.6.1.0 + * Add the `null` query to Text.Blaze.Internal. + +- 0.6.0.0 + * Add the operator (!?) for nicely setting conditional attributes + +- 0.5.2.0 + * Provide ToHtml and ToValue instances for Int32, Int64, Word, Word32, + and Word64 diff -Nru haskell-blaze-markup-0.5.1.6/debian/changelog haskell-blaze-markup-0.7.0.3/debian/changelog --- haskell-blaze-markup-0.5.1.6/debian/changelog 2013-12-14 18:06:45.000000000 +0000 +++ haskell-blaze-markup-0.7.0.3/debian/changelog 2015-12-26 05:51:52.000000000 +0000 @@ -1,3 +1,53 @@ +haskell-blaze-markup (0.7.0.3-1~ubuntu14.04.1~ppa1) trusty; urgency=medium + + * No-change backport to trusty + + -- Justin Geibel Sat, 26 Dec 2015 00:51:52 -0500 + +haskell-blaze-markup (0.7.0.3-1) unstable; urgency=medium + + * New upstream release + + -- Clint Adams Thu, 03 Dec 2015 23:53:50 -0500 + +haskell-blaze-markup (0.7.0.2-3) unstable; urgency=medium + + * Switch Vcs-Git/Vcs-Browser headers to new location. + + -- Clint Adams Thu, 03 Dec 2015 14:54:07 -0500 + +haskell-blaze-markup (0.7.0.2-2) experimental; urgency=medium + + * Bump standards-version to 3.9.6 + * Depend on haskell-devscripts >= 0.10 to ensure that this package + builds against GHC in experimental + + -- Joachim Breitner Thu, 20 Aug 2015 10:27:02 +0200 + +haskell-blaze-markup (0.7.0.2-1) unstable; urgency=medium + + * New upstream release + + -- Joachim Breitner Mon, 29 Jun 2015 21:09:02 +0200 + +haskell-blaze-markup (0.6.1.0-3) unstable; urgency=medium + + * Upload to unstable + + -- Joachim Breitner Mon, 27 Apr 2015 11:47:56 +0200 + +haskell-blaze-markup (0.6.1.0-2) experimental; urgency=medium + + * Depend on haskell-devscripts 0.9, found in experimental + + -- Joachim Breitner Sat, 20 Dec 2014 17:09:37 +0100 + +haskell-blaze-markup (0.6.1.0-1) unstable; urgency=medium + + * New upstream release + + -- Joachim Breitner Sun, 27 Jul 2014 21:58:23 +0200 + haskell-blaze-markup (0.5.1.6-1) unstable; urgency=low [ Joachim Breitner ] diff -Nru haskell-blaze-markup-0.5.1.6/debian/control haskell-blaze-markup-0.7.0.3/debian/control --- haskell-blaze-markup-0.5.1.6/debian/control 2013-12-14 18:06:35.000000000 +0000 +++ haskell-blaze-markup-0.7.0.3/debian/control 2015-12-04 05:05:09.000000000 +0000 @@ -1,47 +1,45 @@ Source: haskell-blaze-markup -Priority: extra -Section: haskell Maintainer: Debian Haskell Group Uploaders: Clint Adams -Build-Depends: debhelper (>= 9) - , haskell-devscripts (>= 0.8.15) - , cdbs - , ghc - , ghc-prof - , ghc-doc - , libghc-blaze-builder-dev (>> 0.2) - , libghc-blaze-builder-dev (<< 0.4) - , libghc-blaze-builder-prof - , libghc-text-dev (>> 0.10) - , libghc-text-dev (<< 1.1) - , libghc-text-prof - , libghc-hunit-dev (>> 1.2) - , libghc-hunit-dev (<< 1.3) - , libghc-quickcheck2-dev (>> 2.4) - , libghc-quickcheck2-dev (<< 2.7) - , libghc-test-framework-dev (>> 0.4) - , libghc-test-framework-dev (<< 0.9) - , libghc-test-framework-hunit-dev (>> 0.3) - , libghc-test-framework-hunit-dev (<< 0.4) - , libghc-test-framework-quickcheck2-dev (>> 0.3) - , libghc-test-framework-quickcheck2-dev (<< 0.4) -Build-Depends-Indep: - , libghc-blaze-builder-doc - , libghc-text-doc -Standards-Version: 3.9.5 -Homepage: http://hackage.haskell.org/package/blaze-markup -Vcs-Darcs: http://darcs.debian.org/pkg-haskell/haskell-blaze-markup -Vcs-Browser: http://darcs.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-blaze-markup +Priority: extra +Section: haskell +Build-Depends: debhelper (>= 9), + haskell-devscripts (>= 0.10), + cdbs, + ghc, + ghc-prof, + libghc-blaze-builder-dev (>= 0.3), + libghc-blaze-builder-dev (<< 0.5), + libghc-blaze-builder-prof, + libghc-text-dev (>= 0.10), + libghc-text-dev (<< 1.3), + libghc-text-prof, + libghc-hunit-dev (>= 1.2), + libghc-hunit-dev (<< 1.4), + libghc-quickcheck2-dev (>= 2.4), + libghc-quickcheck2-dev (<< 2.9), + libghc-test-framework-dev (>= 0.4), + libghc-test-framework-dev (<< 0.9), + libghc-test-framework-hunit-dev (>= 0.3), + libghc-test-framework-hunit-dev (<< 0.4), + libghc-test-framework-quickcheck2-dev (>= 0.3), + libghc-test-framework-quickcheck2-dev (<< 0.4), +Build-Depends-Indep: ghc-doc, + libghc-blaze-builder-doc, + libghc-text-doc, +Standards-Version: 3.9.6 +Homepage: http://jaspervdj.be/blaze +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-haskell/DHG_packages.git/ +Vcs-Git: git://git.debian.org/git/pkg-haskell/DHG_packages.git Package: libghc-blaze-markup-dev Architecture: any -Depends: - ${haskell:Depends}, +Depends: ${haskell:Depends}, ${misc:Depends}, - ${shlibs:Depends} -Suggests: ${haskell:Suggests} -Recommends: ${haskell:Recommends} -Provides: ${haskell:Provides} + ${shlibs:Depends}, +Recommends: ${haskell:Recommends}, +Suggests: ${haskell:Suggests}, +Provides: ${haskell:Provides}, Description: blazingly-fast markup combinator library${haskell:ShortBlurb} Core modules of a blazingly fast markup combinator library for the Haskell programming language. The Text.Blaze module is a good starting @@ -51,12 +49,11 @@ Package: libghc-blaze-markup-prof Architecture: any -Depends: - ${haskell:Depends}, - ${misc:Depends} -Suggests: ${haskell:Suggests} -Recommends: ${haskell:Recommends} -Provides: ${haskell:Provides} +Depends: ${haskell:Depends}, + ${misc:Depends}, +Recommends: ${haskell:Recommends}, +Suggests: ${haskell:Suggests}, +Provides: ${haskell:Provides}, Description: blazingly-fast markup combinator library${haskell:ShortBlurb} Core modules of a blazingly fast markup combinator library for the Haskell programming language. The Text.Blaze module is a good starting @@ -65,13 +62,12 @@ ${haskell:Blurb} Package: libghc-blaze-markup-doc -Section: doc Architecture: all -Depends: - ${haskell:Depends}, - ${misc:Depends} -Suggests: ${haskell:Suggests} -Recommends: ${haskell:Recommends} +Section: doc +Depends: ${haskell:Depends}, + ${misc:Depends}, +Recommends: ${haskell:Recommends}, +Suggests: ${haskell:Suggests}, Description: blazingly-fast markup combinator library${haskell:ShortBlurb} Core modules of a blazingly fast markup combinator library for the Haskell programming language. The Text.Blaze module is a good starting diff -Nru haskell-blaze-markup-0.5.1.6/src/Text/Blaze/Internal.hs haskell-blaze-markup-0.7.0.3/src/Text/Blaze/Internal.hs --- haskell-blaze-markup-0.5.1.6/src/Text/Blaze/Internal.hs 2013-12-05 10:13:51.000000000 +0000 +++ haskell-blaze-markup-0.7.0.3/src/Text/Blaze/Internal.hs 2015-09-28 09:45:08.000000000 +0000 @@ -36,6 +36,13 @@ , unsafeByteString , unsafeLazyByteString + -- * Comments + , textComment + , lazyTextComment + , stringComment + , unsafeByteStringComment + , unsafeLazyByteStringComment + -- * Converting values to tags. , textTag , stringTag @@ -53,14 +60,21 @@ -- * Setting attributes , Attributable , (!) + , (!?) -- * Modifying Markup elements , contents , external + + -- * Querying Markup elements + , null ) where +import Prelude hiding (null) +import Control.Applicative (Applicative (..)) import Data.Monoid (Monoid, mappend, mempty, mconcat) import Unsafe.Coerce (unsafeCoerce) +import qualified Data.List as List import Data.ByteString.Char8 (ByteString) import Data.Text (Text) @@ -130,6 +144,9 @@ | CustomLeaf ChoiceString Bool -- | HTML content | Content ChoiceString + -- | HTML comment. Note: you should wrap the 'ChoiceString' in a + -- 'PreEscaped'. + | Comment ChoiceString -- | Concatenation of two HTML pieces | forall b c. Append (MarkupM b) (MarkupM c) -- | Add an attribute to the inner HTML. Raw key, key, value, HTML to @@ -157,6 +174,16 @@ -- Safe because it does not contain a value anyway fmap _ = unsafeCoerce +instance Applicative MarkupM where + pure _ = Empty + {-# INLINE pure #-} + (<*>) = Append + {-# INLINE (<*>) #-} + (*>) = Append + {-# INLINE (*>) #-} + (<*) = Append + {-# INLINE (<*) #-} + instance Monad MarkupM where return _ = Empty {-# INLINE return #-} @@ -311,6 +338,37 @@ unsafeLazyByteString = mconcat . map unsafeByteString . BL.toChunks {-# INLINE unsafeLazyByteString #-} +-- | Create a comment from a 'Text' value. +-- The text should not contain @"--"@. +-- This is not checked by the library. +textComment :: Text -> Markup +textComment = Comment . PreEscaped . Text + +-- | Create a comment from a 'LT.Text' value. +-- The text should not contain @"--"@. +-- This is not checked by the library. +lazyTextComment :: LT.Text -> Markup +lazyTextComment = Comment . mconcat . map (PreEscaped . Text) . LT.toChunks + +-- | Create a comment from a 'String' value. +-- The text should not contain @"--"@. +-- This is not checked by the library. +stringComment :: String -> Markup +stringComment = Comment . PreEscaped . String + +-- | Create a comment from a 'ByteString' value. +-- The text should not contain @"--"@. +-- This is not checked by the library. +unsafeByteStringComment :: ByteString -> Markup +unsafeByteStringComment = Comment . PreEscaped . ByteString + +-- | Create a comment from a 'BL.ByteString' value. +-- The text should not contain @"--"@. +-- This is not checked by the library. +unsafeLazyByteStringComment :: BL.ByteString -> Markup +unsafeLazyByteStringComment = + Comment . mconcat . map (PreEscaped . ByteString) . BL.toChunks + -- | Create a 'Tag' from some 'Text'. -- textTag :: Text -- ^ Text to create a tag from @@ -412,6 +470,19 @@ h ! f = (! f) . h {-# INLINE (!) #-} +-- | Shorthand for setting an attribute depending on a conditional. +-- +-- Example: +-- +-- > p !? (isBig, A.class "big") $ "Hello" +-- +-- Gives the same result as: +-- +-- > (if isBig then p ! A.class "big" else p) "Hello" +-- +(!?) :: Attributable h => h -> (Bool, Attribute) -> h +(!?) h (c, a) = if c then h ! a else h + -- | Mark HTML as external data. External data can be: -- -- * CSS data in a @