Documentation

Lean.Data.Html.Basic

inductive Lean.Html :

HTML content, which may be either a single node or a sequence of sibling nodes.

This type is optimized for convenient authoring of HTML documents. It is not formally related to the HTML DOM representation. It is analogous to React's Fragment.

  • element (tag : String) (attrs : Array (String × String)) (children : Html) : Html

    An element with the given tag name, attributes, and children.

  • text : String → Html

    Textual content.

    The characters &, <, and > are always escaped to HTML entities during rendering. Use raw in raw text elements (script and style) instead.

  • raw : String → Html

    Characters to be copied verbatim (and not escaped) during rendering.

  • seq : Array Html → Html

    A sequence of HTML values.

Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations

    Empty HTML.

    Equations
    Instances For
      @[irreducible]

      Whether this HTML is rendered as the empty string.

      Equations
      Instances For
        def Lean.Html.ofString (escape : Bool) :

        If escape is true, then characters such as & are escaped to entities such as &amp; during rendering.

        Use false in raw text elements (script and style).

        Equations
        Instances For

          Appends two HTML forests.

          Equations
          Instances For
            @[instance_reducible]
            Equations
            def Lean.Html.ofCollection {ρ : Type w} [ForIn Id ρ Html] (hs : ρ) :

            Merges a collection of HTML values by appending them.

            Like seq (ForIn.toArray hs), but may produce a more compact representation.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Merges an array of HTML values by appending them.

              Like seq, but may produce a more compact representation.

              Equations
              Instances For

                Merges a list of HTML values by appending them.

                Like seq hs.toArray, but may produce a more compact representation.

                Equations
                Instances For

                  Returns the given HTML, or empty when the input is none.

                  Equations
                  Instances For
                    @[instance_reducible]
                    Equations
                    @[instance_reducible]

                    A compact JSON encoding of Html.

                    Equations
                    @[instance_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.
                    partial def Lean.Html.rewritePostM {m : Type → Type u_1} [Monad m] (fn : Html → m Html) :
                    Html → m Html

                    Rewrites the forest by using fn to transform every node. Traversal proceeds in post-order: fn receives element and seq nodes with already-rewritten children.

                    def Lean.Html.rewritePost (fn : Html → Html) (h : Html) :

                    Rewrites the forest by using fn to transform every node. Traversal proceeds in post-order: fn receives element and seq nodes with already-rewritten children.

                    Equations
                    Instances For