packages feed

blaze 0.0.0 → 0.0.1

raw patch · 6 files changed

+153/−10 lines, 6 files

Files

blaze.cabal view
@@ -1,18 +1,22 @@ name:                blaze-version:             0.0.0-synopsis:            Common blaze operations-description:         Common blaze operations+version:             0.0.1+synopsis:            Blaze-html-based HTML5 library+description:         A host of HTML5 functions to make writing HTML5 with blaze-html practical. license:             BSD3 license-file:        LICENSE author:              Chris Done maintainer:          chrisdone@gmail.com copyright:           2013 Chris Done-category:            CATEGORY+category:            HTML, Web build-type:          Simple cabal-version:       >=1.8  library-  exposed-modules:   Blaze.Html5+  exposed-modules:   Blaze,+                     Blaze.Html5,+                     Blaze.Elements,+                     Blaze.Attributes,+                     Blaze.Bootstrap   hs-source-dirs:    src/   build-depends:     base > 4 && <5,                      blaze-markup,
+ src/Blaze.hs view
@@ -0,0 +1,19 @@+-- | A host of HTML5 functions to make writing HTML5 with blaze-html+-- practical.+--+-- Common imports to make:+--+-- > import Blaze+-- > import Blaze.Elements as E+-- > import Blaze.Attributes as A+-- > import Blaze.Bootstrap++module Blaze+  (-- * Main library+   module Blaze.Html5+  -- * Rendering+  ,renderHtml)+  where++import Blaze.Html5+import Text.Blaze.Html.Renderer.Text (renderHtml)
+ src/Blaze/Attributes.hs view
@@ -0,0 +1,7 @@+-- | Re-export of all HTML5 attributes.++module Blaze.Attributes+  (module Text.Blaze.Html5.Attributes)+  where++import Text.Blaze.Html5.Attributes
+ src/Blaze/Bootstrap.hs view
@@ -0,0 +1,96 @@+{-# LANGUAGE OverloadedStrings #-}++-- | Bootstrap layout elements. See+-- <http://getbootstrap.com/2.3.2/scaffolding.html> for more+-- information.++module Blaze.Bootstrap+ (+  -- * Containers+  container+ ,containerFluid+ -- * Rows+ ,row+ ,rowFluid+ -- * Spans+ ,span1+ ,span2+ ,span3+ ,span4+ ,span5+ ,span6+ ,span7+ ,span8+ ,span9+ ,span10+ ,span11+ ,span12+ )+  where++import Prelude hiding (div)+import Blaze.Html5++-- | A grid container.+container :: Html -> Html+container x = div !. "container" $ x++-- | A fluid grid container.+containerFluid :: Html -> Html+containerFluid x = div !. "container-fluid" $ x++-- | A grid row.+row :: Html -> Html+row x = div !. "row" $ x++-- | A fluid grid row.+rowFluid :: Html -> Html+rowFluid x = div !. "row-fluid" $ x++-- | A span of 1 columns.+span1 :: Html -> Html+span1 x = div !. "span1" $ x++-- | A span of 2 columns.+span2 :: Html -> Html+span2 x = div !. "span2" $ x++-- | A span of 3 columns.+span3 :: Html -> Html+span3 x = div !. "span3" $ x++-- | A span of 4 columns.+span4 :: Html -> Html+span4 x = div !. "span4" $ x++-- | A span of 5 columns.+span5 :: Html -> Html+span5 x = div !. "span5" $ x++-- | A span of 6 columns.+span6 :: Html -> Html+span6 x = div !. "span6" $ x++-- | A span of 7 columns.+span7 :: Html -> Html+span7 x = div !. "span7" $ x++-- | A span of 8 columns.+span8 :: Html -> Html+span8 x = div !. "span8" $ x++-- | A span of 9 columns.+span9 :: Html -> Html+span9 x = div !. "span9" $ x++-- | A span of 10 columns.+span10 :: Html -> Html+span10 x = div !. "span10" $ x++-- | A span of 11 columns.+span11 :: Html -> Html+span11 x = div !. "span11" $ x++-- | A span of 12 columns.+span12 :: Html -> Html+span12 x = div !. "span12" $ x
+ src/Blaze/Elements.hs view
@@ -0,0 +1,7 @@+-- | Re-export of all HTML5 attributes.++module Blaze.Elements+  (module Text.Blaze.Html5)+  where++import Text.Blaze.Html5
src/Blaze/Html5.hs view
@@ -1,27 +1,37 @@ {-# LANGUAGE OverloadedStrings #-}+{-# OPTIONS -fno-warn-unused-do-bind #-}  module Blaze.Html5-  (module Text.Blaze+  (+  -- * Re-exports+   module Text.Blaze   ,module Text.Blaze.Html5+  ,module Text.Blaze.Html5.Attributes+  -- * Attribute combinators   ,Attributable   ,(!.)   ,(!#)-  ,linesToHtml)+  -- * Common operations+  ,linesToHtml+  ,htmlIntercalate+  ,htmlCommasAnd+  ,htmlCommas)   where  import           Data.Monoid import           Text.Blaze-import           Text.Blaze.Html5 hiding (map)+import           Text.Blaze.Html5 hiding (map,style,title) import qualified Text.Blaze.Html5.Attributes as A+import           Text.Blaze.Html5.Attributes hiding (span,label,cite,form,summary,min) import           Text.Blaze.Internal (Attributable)  -- | Class attribute. (!.) :: (Attributable h) => h -> AttributeValue -> h-elem !. className = elem ! A.class_ className+e !. className = e ! A.class_ className  -- | Id attribute. (!#) :: (Attributable h) => h -> AttributeValue -> h-elem !# idName = elem ! A.id idName+e !# idName = e ! A.id idName  -- | Render the lines as HTML lines. linesToHtml :: [Html] -> Html