Idris2Doc : Text.Html.Elements.Raw

Text.Html.Elements.Raw

(source)
Raw constructors for elements without any checks.

Those constructors do not carry any checks. They are therefore fast and
and simple to use at run-time. On the other hand, they don't provide any
form of guarantee when it comes to the correctness of the HTML code.

They are preceded by `raw_` to distinguish them from the standard
elements functions with compile time checks. This is to avoid name clashes
as this module must also be exported since those functions are used by the
standard functions. 

Definitions

mkRawNormalElem : String -> Elab ()
  Generates a normal element raw function using the element's name.

The function will be named `raw_<name>` and will create a `<name>` element.

The type of the generated function is:
`List Attribute -> List Element -> List Element`

The following example:

```idris2 example
%runElab mkNormalElem "a"
```

generates the below code:

```idris2
public export
raw_a : List Attribute -> List Element -> List Element
raw_a attrs elems = pure $ NormalElement "a" attrs elems
```

Totality: total
Visibility: export
mkRawVoidElem : String -> Elab ()
  Generates a void element raw function using the element's name.

The function will be named `raw_<name>` and will create a `<name>` element.

The type of the generated function is:
`List Attribute -> List Element`

The following example:

```idris2 example
%runElab mkNormalElem "br"
```

generates the below code:

```idris2
public export
raw_br : List Attribute -> List Element
raw_br elems = pure $ VoidElement "br" attrs
```

Totality: total
Visibility: export
mkRawElems : List Config -> Elab ()
  Generates element raw functions using the elements' names.

The functions will be named `raw_<name>` and will create `<name>`
elements.

Totality: total
Visibility: export
htmlCode : String -> List Element
  Unescaped HTML code.

This can be useful, if you need to inject some HTML code from another source
typically from a conversion from Markdown.

> [!WARNING]
> To use with caution of course, as the HTML will not be escaped. You must
> be certain of the source of this HTML code and that it cannot be
> malicious.

Totality: total
Visibility: public export
plainText : String -> List Element
  Plain text which can be used inside a HTML element.

Note: HTML code is escaped.

Totality: total
Visibility: public export
scriptContent : String -> List Element
  Script content which can be used inside a **script** element.

Note: the script code is escaped.

Totality: total
Visibility: public export
styleContent : String -> List Element
  CSS content which can be used inside a **style** element.

Note: the CSS code is escaped.

Totality: total
Visibility: public export
raw_html5 : List Attribute -> List Element -> Html
  Both a doctype preambule and a **html** element.

Totality: total
Visibility: public export
raw_title : List Attribute -> NonWhitespace -> List Element
  The **title** element.

Totality: total
Visibility: public export