Documentation

DocGen4.Output.Base

Equations
Instances For
    Equations
    Instances For

      The structure representing a processed bibitem.

      • citekey : String

        The cite key as in the bib file.

      • tag : String

        The tag generated by bib processor, e.g. [Doe12]. Should be plain text and should not be escaped.

      • html : String

        The HTML generated by bib processor, e.g. John Doe. <i>Test</i>. 2012.

      • plaintext : String

        The plain text form of html field. Should not be escaped.

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

            The structure representing a backref item.

            • citekey : String

              The cite key as in the bib file.

            • modName : Lean.Name

              The name of the module.

            • funName : String

              The name of the function, as a string. It is empty if the backref is in modstring.

            • index : Nat

              The index of the backref in that module, starting from zero.

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

                  The context used in the BaseHtmlM monad for HTML templating.

                  • buildDir : System.FilePath

                    The build directory (provided by lake).

                  • hierarchy : Hierarchy

                    The module hierarchy as a tree structure.

                  • depthToRoot : Nat

                    How far away we are from the page root, used for relative links to the root.

                  • currentName : Option Lean.Name

                    The name of the current module if there is one, there exist a few pages that don't have a module name.

                  • refs : Array BibItem

                    The list of references, as an array.

                  Instances For
                    @[reducible, inline]

                    Declaration decorator function type: given a module name, declaration name, and declaration kind, returns optional extra HTML to inject into the declaration's rendering. This enables external tools to add badges, links, or other decorations to declarations.

                    Equations
                    Instances For

                      The default declaration decorator that produces no extra HTML.

                      Equations
                      Instances For

                        The read-only context used in the HtmlM monad for HTML templating.

                        Instances For

                          The writable state used in the HtmlM monad for HTML templating.

                          • backrefs : Array BackrefItem

                            The list of back references, as an array.

                          • errors : String

                            The errors occurred during the process.

                          Instances For
                            Equations
                            Instances For
                              @[reducible, inline]
                              abbrev DocGen4.Output.BaseHtmlT (m : TypeType u_1) (α : Type) :
                              Type u_1
                              Equations
                              Instances For
                                @[reducible, inline]
                                Equations
                                Instances For
                                  @[reducible, inline]
                                  Equations
                                  Instances For
                                    def DocGen4.Output.HtmlT.run {m : TypeType u_1} {α : Type} (x : HtmlT m α) (state : SiteState) (ctx : SiteContext) (baseCtx : SiteBaseContext) :
                                    m (α × SiteState)
                                    Equations
                                    Instances For
                                      def DocGen4.Output.HtmlM.run {α : Type} (x : HtmlM α) (state : SiteState) (ctx : SiteContext) (baseCtx : SiteBaseContext) :
                                      Equations
                                      Instances For
                                        @[implicit_reducible]
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        @[implicit_reducible]
                                        Equations
                                        • One or more equations did not get rendered due to their size.

                                        Add a backref of the given citekey and funName to current document, and returns it.

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

                                          Add an error message to errors of current document.

                                          Equations
                                          Instances For

                                            Obtains the root URL as a relative one to the current depth.

                                            Equations
                                            Instances For
                                              Equations
                                              Instances For
                                                Equations
                                                Instances For
                                                  Equations
                                                  Instances For
                                                    def DocGen4.Output.templateExtends {α β : Type u_1} {m : Type u_1 → Type u_2} [Bind m] (base : αm β) (new : m α) :
                                                    m β

                                                    If a template is meant to be extended because it for example only provides the header but no real content this is the way to fill the template with content. This is untyped so HtmlM and BaseHtmlM can be mixed.

                                                    Equations
                                                    Instances For
                                                      def DocGen4.Output.templateLiftExtends {α β : Type u_1} {m : Type u_1 → Type u_2} {n : Type u_1 → Type u_3} [Bind m] [MonadLiftT n m] (base : αn β) (new : m α) :
                                                      m β
                                                      Equations
                                                      Instances For

                                                        Returns the path to the HTML file that contains information about a module.

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

                                                          The following section contains all the statically included files that are used in documentation generation, notably JS and CSS ones.

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

                                                                                    Returns a name splitted into parts. Together with "break_within" CSS class this helps browser to break a name nicely.

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

                                                                                        Converts RenderedCode to HTML with declaration links.

                                                                                        Returns (hasAnchor, html) where hasAnchor indicates if the result contains an <a> tag. This is tracked to avoid creating nested anchors (which is invalid HTML).

                                                                                        For .const name tags, it first checks whether the name is a valid link target (that is, a non-private name in name2ModIdx). If so, it links directly to that name. If not, it applies Lean.privateToUserName? to convert internal private names to user-facing names (e.g., _private.Init.Prelude.0.Foo.helperFoo.helper) and then tries:

                                                                                        1. Auxiliary name removal (findLinkableParent): Strip trailing components that start with _ or are numeric (e.g., Foo.bar._proof_2Foo.bar). This handles auto-generated auxiliary names like match discriminant functions (Foo.bar.match_1Foo.bar).
                                                                                        2. Module link: For private names where no declaration was found, extract the module name from the private prefix and link to the module page (e.g., _private.Init.Prelude.0.Foo → module Init.Prelude). moduleNameToLink itself decides local-vs-external.
                                                                                        3. External fallback: Emit <a href={externalDeclLink nameToSearch}> — the external Mathlib find redirect resolves the owning module client-side. The user-facing name (post privateToUserName?) is used so private internal names are not leaked into the URL. See DocGen4.Output.External for the URL form, and docs/dev/design/external-linking.md for the rationale.

                                                                                        Convert RenderedCode to HTML with declaration links.

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