{-# LANGUAGE BangPatterns #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} -- | Build HTML tables using @lucid@ and @colonnade@. It is -- recommended that users read the documentation for @colonnade@ first, -- since this library builds on the abstractions introduced there. -- Also, look at the docs for @blaze-colonnade@. These two -- libraries are similar, but blaze offers an HTML pretty printer -- which makes it possible to doctest examples. Since lucid -- does not offer such facilities, examples are omitted here. module Lucid.Colonnade ( -- * Apply encodeHtmlTable , encodeCellTable , encodeTable -- * Cell -- $build , Cell(..) , htmlCell , stringCell , textCell , lazyTextCell , builderCell , htmlFromCell -- * Discussion -- $discussion ) where import Colonnade (Colonnade,Headed,Headless,Fascia,Cornice) import Data.Text (Text) import Control.Monad import Data.Semigroup import Data.Monoid hiding ((<>)) import Data.Foldable import Data.String (IsString(..)) import Data.Maybe (listToMaybe) import Data.Char (isSpace) import Control.Applicative (liftA2) import Lucid import qualified Data.List as List import qualified Colonnade.Encode as E import qualified Data.Text as Text import qualified Data.Text.Lazy as LText import qualified Data.Text.Lazy.Builder as TBuilder -- $build -- -- The 'Cell' type is used to build a 'Colonnade' that -- has 'Html' content inside table cells and may optionally -- have attributes added to the @\
@ and the row -- content the child of a @\ | @. However, it is not possible -- to add attributes to these parent elements. To accomodate this -- situation, it is necessary to introduce 'Cell', which includes -- the possibility of attributes on the parent node. |
---|