-- |Pretty-printer for HTML. This modules exports no names. It only defines -- instances of 'PrettyPrintable' for HTML. module WebBits.Html.PrettyPrint ( -- this module exports no names ) where import qualified Data.List as List import qualified Data.Char as Char import Text.PrettyPrint.HughesPJ import WebBits.Common (PrettyPrintable(..)) import WebBits.Html.Syntax vert [] = empty vert [doc] = doc vert (doc:docs) = doc <> text "" <> vert docs instance PrettyPrintable s => PrettyPrintable (Attribute a s) where pp (Attribute name value _) = text name <> equals <> doubleQuotes (text value) pp (AttributeExpr _ n v "") = text n <> equals <> text "{!" <+> pp v <+> text "!}" pp (AttributeExpr _ n v d) = text n <> equals <> text "{!" <+> pp v <+> text "|||" <+> text d <+> text "!}" instance PrettyPrintable s => PrettyPrintable (Html a s) where -- The . --