| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Drasil.Data.Formats.HTML
Synopsis
- data HTMLBody
- = Div [Attr] [HTMLBody]
- | Paragraph [Attr] [HTMLBody]
- | TextFormat Format [Attr] [HTMLBody]
- | Heading HLevel [Attr] [HTMLBody]
- | List ListType [Attr] [LItem]
- | Section [Attr] [HTMLBody]
- | Table [Attr] [Row]
- | DescriptionList [Attr] [DItem]
- | Anchor URL [Attr] [HTMLBody]
- | Figure [Attr] [HTMLBody]
- | FigCaption [Attr] [HTMLBody]
- | Img File Text [Attr]
- | RawText Text
- | Custom CustomTag [Attr] [HTMLBody]
- | Comment Text
- data TagType
- span :: [Attr] -> Text -> HTMLBody
- data Format
- = Bold
- | Emphasis
- | Subscript
- | Superscript
- | Span
- data HTMLHead
- span_ :: [Attr] -> [HTMLBody] -> HTMLBody
- data HTML = HTML [HTMLHead] [HTMLBody]
- newtype CustomTag = CT Text
- data Attr = Attr Text Text
- data HLevel
- data Row = Row [Attr] [Cell]
- data Cell
- data LItem = LItem [Attr] [HTMLBody]
- data DItem
- data ListType
- attr :: Text -> Text -> Attr
- id_ :: Text -> Attr
- class_ :: [Text] -> Attr
- rawText :: Text -> HTMLBody
- rawText' :: String -> HTMLBody
- customTag :: Text -> CustomTag
- bold :: [Attr] -> Text -> HTMLBody
- bold_ :: [HTMLBody] -> HTMLBody
- emphasis :: [Attr] -> Text -> HTMLBody
- emphasis_ :: [HTMLBody] -> HTMLBody
- subscript :: [Attr] -> Text -> HTMLBody
- subscript_ :: [HTMLBody] -> HTMLBody
- superscript :: [Attr] -> Text -> HTMLBody
- superscript_ :: [HTMLBody] -> HTMLBody
- toHLevel :: Int -> HLevel
- figureImage :: [Attr] -> [Attr] -> File -> Text -> Text -> HTMLBody
- inlineScript :: Text -> HTMLHead
- externalScript :: File -> [Attr] -> HTMLHead
- stylesheet :: Text -> HTMLHead
- renderHTML :: HTMLRenderOptions -> HTML -> Doc ann
- data HTMLRenderOptions = HTMLRO {}
- defaultHTMLRO :: HTMLRenderOptions
Documentation
Body elements
Constructors
| Div [Attr] [HTMLBody] | |
| Paragraph [Attr] [HTMLBody] | |
| TextFormat Format [Attr] [HTMLBody] | |
| Heading HLevel [Attr] [HTMLBody] | |
| List ListType [Attr] [LItem] | |
| Section [Attr] [HTMLBody] | |
| Table [Attr] [Row] | |
| DescriptionList [Attr] [DItem] | |
| Anchor URL [Attr] [HTMLBody] | |
| Figure [Attr] [HTMLBody] | |
| FigCaption [Attr] [HTMLBody] | |
| Img File Text [Attr] | |
| RawText Text | |
| Custom CustomTag [Attr] [HTMLBody] | |
| Comment Text |
A CustomTag is either (a) an ill-supported HTML-spec. node (ill-supported
by HTMLBody, that is) or (b) a purely custom one.
Instances
| Show CustomTag Source # | |
| Eq CustomTag Source # | |
| Ord CustomTag Source # | |
HTML Attrs for tags in the format key="value"
Heading level
Table structure
Ordered/unordered list structure
Instances
Description list elements
Instances
customTag :: Text -> CustomTag Source #
Tag names are used within element start tags and end tags to give the element’s name. HTML elements all have names that only use characters in the range 0–9, a–z, and A–Z.
subscript_ :: [HTMLBody] -> HTMLBody Source #
Smart constructors for formatting HTML elements.
superscript_ :: [HTMLBody] -> HTMLBody Source #
Smart constructors for formatting HTML elements.
figureImage :: [Attr] -> [Attr] -> File -> Text -> Text -> HTMLBody Source #
Creates a figure containing an image and a caption. The first list of attributes is applied to the figure; the second is applied to the image.
inlineScript :: Text -> HTMLHead Source #
Creates an inline script. Does not allow any attributes.
externalScript :: File -> [Attr] -> HTMLHead Source #
Creates an external script. Requires a source file/URL and allows optional attributes.
stylesheet :: Text -> HTMLHead Source #
Create the link to the CSS file.
renderHTML :: HTMLRenderOptions -> HTML -> Doc ann Source #
Render HTML to a Doc
data HTMLRenderOptions Source #
Constructors
| HTMLRO | |
Fields
| |
defaultHTMLRO :: HTMLRenderOptions Source #
Default HTMLRenderOptions with standard indentation and no custom tags.