{-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {- | 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 , encodeCellTableSized , encodeTable -- * Cell -- $build , Cell (..) , charCell , htmlCell , stringCell , textCell , lazyTextCell , builderCell , htmlFromCell , encodeBodySized , sectioned -- * Discussion -- $discussion ) where #if MIN_VERSION_base(4,18,0) #else import Control.Applicative (liftA2) #endif import Colonnade (Colonnade) import Control.Monad import Data.Foldable import Data.String (IsString (..)) import Data.Text (Text) import Lucid hiding (for_) import qualified Colonnade.Encode as E import qualified Data.Text as T import qualified Data.Text as Text import qualified Data.Text.Lazy as LText import qualified Data.Text.Lazy.Builder as TBuilder import qualified Data.Vector as V {- $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.
-}
sectioned ::
(Foldable f, E.Headedness h, Foldable g, Monoid c) =>
-- | @\ |
---|