Idris2Doc : Text.Html.Generator

Text.Html.Generator

(source)
HTML code generator.

This module offers functions to convert a `Html` type to a string.
The two main functions are:

- `genHtml`: which renders the HTML on multiple lines with an indentation
   of two spaces for each level of the HTML tree to ensure good readability;
   and
- `genHtmlMin`: which renders the HTML on one single line to minify the
   output.

Alternatively, you can provide your own configuration to the `genHtmlConf`
function. This allows to use tabs instead of spaces or to set your own
indentation, such as four spaces for example.

For convenience, the below functions are also exported, in case you would
like to render a particular attribute or element:

- `genAttribute`
- `genElement`

Note that you will need to provide your own configuration and, for
`genElement`, provide the indentation.

Definitions

data Mode : Type
  The generation mode.

It can be the default one on multiple lines or the minify version on a
single line.

Totality: total
Visibility: public export
Constructors:
Default : Mode
Minify : Mode
data IndentChar : Type
  The indentation character to use (space or tab).

Totality: total
Visibility: public export
Constructors:
Space : IndentChar
Tab : IndentChar
record Config : Type
  A generation configuration.

Totality: total
Visibility: public export
Constructor: 
MkConfig : IndentChar -> Nat -> Mode -> Config

Projections:
.indentChar : Config -> IndentChar
  The indentation character (`Space` or `Tab`).
.indentSize : Config -> Nat
  The number of characters for each indentation.
.mode : Config -> Mode
  The generation mode (`Default` or `Minify`).
.indentChar : Config -> IndentChar
  The indentation character (`Space` or `Tab`).

Totality: total
Visibility: public export
indentChar : Config -> IndentChar
  The indentation character (`Space` or `Tab`).

Totality: total
Visibility: public export
.indentSize : Config -> Nat
  The number of characters for each indentation.

Totality: total
Visibility: public export
indentSize : Config -> Nat
  The number of characters for each indentation.

Totality: total
Visibility: public export
.mode : Config -> Mode
  The generation mode (`Default` or `Minify`).

Totality: total
Visibility: public export
mode : Config -> Mode
  The generation mode (`Default` or `Minify`).

Totality: total
Visibility: public export
genAttribute : Attribute -> String
  Generates an attribute.

Totality: total
Visibility: export
genElementsConf : Config -> Nat -> List Element -> String
  Generates a list of elements.

Totality: total
Visibility: export
genElementConf : Config -> Nat -> Element -> String
  Generates an element.

For plain text, in default mode, if the text is longer than 80 characters
or it contains a return line character, then it's displayed below the HTML
tag and indented. Otherwise, it's displayed on the same line as the
opening and closing tags.

Totality: total
Visibility: export
genElement : Element -> String
  Generates HTML code based on the provided element.

Each child is displayed on its own line and 2 spaces are used for the
indentation.

Totality: total
Visibility: export
genElementMin : Element -> String
  Generates HTML code based on the provided element as a one liner.

Totality: total
Visibility: export
genElements : List Element -> String
  Generates HTML code based on the provided list of elements.

Each element is displayed on its own line and 2 spaces are used for the
indentation.

Totality: total
Visibility: export
genElementsMin : List Element -> String
  Generates HTML code based on the provided list of elements as a one liner.

Totality: total
Visibility: export
genHtmlConf : Config -> Html -> String
  Generates the HTML based on the provided configuration.

Totality: total
Visibility: export
genHtml : Html -> String
  Generates the HTML using a default of 2 spaces for the indentation.

Totality: total
Visibility: export
genHtmlMin : Html -> String
  Generates a one liner HTML.

Totality: total
Visibility: export