drasil-data-formats-0.0.1: A framework for code and document generation for scientific software
Safe HaskellNone
LanguageGHC2024

Drasil.Data.Formats.HTML.Core

Synopsis

HTML

AST

data HTML Source #

Constructors

HTML [HTMLHead] [HTMLBody] 

Instances

Instances details
Show HTML Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

showsPrec :: Int -> HTML -> ShowS #

show :: HTML -> String #

showList :: [HTML] -> ShowS #

Eq HTML Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: HTML -> HTML -> Bool #

(/=) :: HTML -> HTML -> Bool #

data HTMLHead Source #

Head elements

Constructors

Script [Attr] Text 
Title Text 
Meta [Attr] 
Link Relation File [Attr] 

Instances

Instances details
Show HTMLHead Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Eq HTMLHead Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

data TagType Source #

Constructors

Standard 
Void 

Instances

Instances details
Show TagType Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Eq TagType Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: TagType -> TagType -> Bool #

(/=) :: TagType -> TagType -> Bool #

newtype CustomTag Source #

A CustomTag is either (a) an ill-supported HTML-spec. node (ill-supported by HTMLBody, that is) or (b) a purely custom one.

Constructors

CT Text 

data Attr Source #

HTML Attrs for tags in the format key="value"

Constructors

Attr 

Fields

Instances

Instances details
Show Attr Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

showsPrec :: Int -> Attr -> ShowS #

show :: Attr -> String #

showList :: [Attr] -> ShowS #

Eq Attr Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: Attr -> Attr -> Bool #

(/=) :: Attr -> Attr -> Bool #

data Format Source #

Text format

Instances

Instances details
Show Format Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Eq Format Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: Format -> Format -> Bool #

(/=) :: Format -> Format -> Bool #

data HLevel Source #

Heading level

Constructors

H1 
H2 
H3 
H4 
H5 
H6 

Instances

Instances details
Bounded HLevel Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Enum HLevel Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Show HLevel Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Eq HLevel Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: HLevel -> HLevel -> Bool #

(/=) :: HLevel -> HLevel -> Bool #

data Row Source #

Table structure

Constructors

Row [Attr] [Cell] 

Instances

Instances details
Show Row Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

showsPrec :: Int -> Row -> ShowS #

show :: Row -> String #

showList :: [Row] -> ShowS #

Eq Row Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: Row -> Row -> Bool #

(/=) :: Row -> Row -> Bool #

data Cell Source #

Constructors

THeader [Attr] [HTMLBody] 
TData [Attr] [HTMLBody] 

Instances

Instances details
Show Cell Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

showsPrec :: Int -> Cell -> ShowS #

show :: Cell -> String #

showList :: [Cell] -> ShowS #

Eq Cell Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: Cell -> Cell -> Bool #

(/=) :: Cell -> Cell -> Bool #

data LItem Source #

Ordered/unordered list structure

Constructors

LItem [Attr] [HTMLBody] 

Instances

Instances details
Show LItem Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

showsPrec :: Int -> LItem -> ShowS #

show :: LItem -> String #

showList :: [LItem] -> ShowS #

Eq LItem Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: LItem -> LItem -> Bool #

(/=) :: LItem -> LItem -> Bool #

data DItem Source #

Description list elements

Constructors

DTerm [Attr] [HTMLBody] 
DDetails [Attr] [HTMLBody] 

Instances

Instances details
Show DItem Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

showsPrec :: Int -> DItem -> ShowS #

show :: DItem -> String #

showList :: [DItem] -> ShowS #

Eq DItem Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Methods

(==) :: DItem -> DItem -> Bool #

(/=) :: DItem -> DItem -> Bool #

data ListType Source #

List type

Constructors

Ordered 
Unordered 

Instances

Instances details
Show ListType Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Eq ListType Source # 
Instance details

Defined in Drasil.Data.Formats.HTML.Core

Smart Constructors

attr :: Text -> Text -> Attr Source #

Creates a generic HTML attribute from a key and value.

id_ :: Text -> Attr Source #

Creates an id attribute.

class_ :: [Text] -> Attr Source #

Creates a class attribute from a list of class names.

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.

bold :: [Attr] -> Text -> HTMLBody Source #

Smart constructors for formatting text.

bold_ :: [HTMLBody] -> HTMLBody Source #

Smart constructors for formatting HTML elements.

emphasis :: [Attr] -> Text -> HTMLBody Source #

Smart constructors for formatting text.

emphasis_ :: [HTMLBody] -> HTMLBody Source #

Smart constructors for formatting HTML elements.

subscript :: [Attr] -> Text -> HTMLBody Source #

Smart constructors for formatting text.

subscript_ :: [HTMLBody] -> HTMLBody Source #

Smart constructors for formatting HTML elements.

superscript :: [Attr] -> Text -> HTMLBody Source #

Smart constructors for formatting text.

superscript_ :: [HTMLBody] -> HTMLBody Source #

Smart constructors for formatting HTML elements.

span :: [Attr] -> Text -> HTMLBody Source #

Smart constructors for formatting text.

span_ :: [Attr] -> [HTMLBody] -> HTMLBody Source #

Smart constructors for span elements.

toHLevel :: Int -> HLevel Source #

Converts a 0-indexed integer to a heading level (capped at H6).

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.