-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Helper functions for using blaze-html with colonnade
--   
--   Blaze HTML and colonnade
@package blaze-colonnade
@version 1.2.2


-- | Build HTML tables using <tt>blaze-html</tt> and <tt>colonnade</tt>.
--   The bottom of this page has a tutorial that walks through a full
--   example, illustrating how to meet typical needs with this library. It
--   is recommended that users read the documentation for
--   <tt>colonnade</tt> first, since this library builds on the
--   abstractions introduced there. A concise example of this library's
--   use:
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings
--   
--   &gt;&gt;&gt; :module + Colonnade Text.Blaze.Html Text.Blaze.Colonnade
--   
--   &gt;&gt;&gt; let col = headed "Grade" (toHtml . fst) &lt;&gt; headed "Letter" (toHtml . snd)
--   
--   &gt;&gt;&gt; let rows = [("90-100",'A'),("80-89",'B'),("70-79",'C')]
--   
--   &gt;&gt;&gt; printVeryCompactHtml (encodeHtmlTable mempty col rows)
--   &lt;table&gt;
--       &lt;thead&gt;
--           &lt;tr&gt;&lt;th&gt;Grade&lt;/th&gt;&lt;th&gt;Letter&lt;/th&gt;&lt;/tr&gt;
--       &lt;/thead&gt;
--       &lt;tbody&gt;
--           &lt;tr&gt;&lt;td&gt;90-100&lt;/td&gt;&lt;td&gt;A&lt;/td&gt;&lt;/tr&gt;
--           &lt;tr&gt;&lt;td&gt;80-89&lt;/td&gt;&lt;td&gt;B&lt;/td&gt;&lt;/tr&gt;
--           &lt;tr&gt;&lt;td&gt;70-79&lt;/td&gt;&lt;td&gt;C&lt;/td&gt;&lt;/tr&gt;
--       &lt;/tbody&gt;
--   &lt;/table&gt;
--   </pre>
module Text.Blaze.Colonnade

-- | Encode a table. Table cell element do not have any attributes applied
--   to them.
encodeHtmlTable :: (Foldable f, Headedness h) => Attribute -> Colonnade h a Html -> f a -> Html

-- | Encode a table. Table cells may have attributes applied to them.
encodeCellTable :: Foldable f => Attribute -> Colonnade Headed a Cell -> f a -> Html

-- | Encode a table. This handles a very general case and is seldom needed
--   by users. One of the arguments provided is used to add attributes to
--   the generated <tt>&lt;tr&gt;</tt> elements.
encodeTable :: forall h f a c. (Foldable f, Headedness h) => h (Attribute, Attribute) -> Attribute -> (a -> Attribute) -> ((Html -> Html) -> c -> Html) -> Attribute -> Colonnade h a c -> f a -> Html

-- | Encode a table with tiered header rows. This is the most general
--   function in this library for encoding a <a>Cornice</a>.
encodeCappedTable :: Foldable f => Attribute -> Attribute -> (a -> Attribute) -> ((Html -> Html) -> c -> Html) -> Attribute -> Fascia p Attribute -> Cornice Headed p a c -> f a -> Html

-- | The attributes that will be applied to a <tt>&lt;td&gt;</tt> and the
--   HTML content that will go inside it. When using this type, remember
--   that <a>Attribute</a>, defined in <tt>blaze-markup</tt>, is actually a
--   collection of attributes, not a single attribute.
data Cell
Cell :: !Attribute -> !Html -> Cell
[cellAttribute] :: Cell -> !Attribute
[cellHtml] :: Cell -> !Html

-- | Create a <a>Cell</a> from a <tt>Widget</tt>
htmlCell :: Html -> Cell

-- | Create a <a>Cell</a> from a <a>String</a>
stringCell :: String -> Cell

-- | Create a <a>Cell</a> from a <a>Text</a>
textCell :: Text -> Cell

-- | Create a <a>Cell</a> from a lazy text
lazyTextCell :: Text -> Cell

-- | Create a <a>Cell</a> from a text builder
builderCell :: Builder -> Cell

-- | Convert a <a>Cell</a> to <a>Html</a> by wrapping the content with a
--   tag and applying the <a>Cell</a> attributes to that tag.
htmlFromCell :: (Html -> Html) -> Cell -> Html

-- | Pretty print an HTML table, stripping whitespace from inside
--   <tt>&lt;td&gt;</tt>, <tt>&lt;th&gt;</tt>, and common inline tags. The
--   implementation is inefficient and is incorrect in many corner cases.
--   It is only provided to reduce the line count of the HTML printed by
--   GHCi examples in this module's documentation. Use of this function is
--   discouraged.
printCompactHtml :: Html -> IO ()

-- | Similar to <a>printCompactHtml</a>. Additionally strips all whitespace
--   inside <tt>&lt;tr&gt;</tt> elements and <tt>&lt;thead&gt;</tt>
--   elements.
printVeryCompactHtml :: Html -> IO ()
instance Data.String.IsString Text.Blaze.Colonnade.Cell
instance GHC.Base.Semigroup Text.Blaze.Colonnade.Cell
instance GHC.Base.Monoid Text.Blaze.Colonnade.Cell
