Documentation

DocGen4.Output.DocString

@[specialize #[]]

Auxiliary function for splitAround.

Similar to String.split in Lean core, but keeps the separater. e.g. splitAround "a,b,c" (fun c => c = ',') = ["a", ",", "b", ",", "c"]

Equations
Instances For

    Resolve a docstring identifier reference (`Foo.bar or a .lean file path) to a URL.

    Resolution order:

    1. If the input looks like a source file path (*.lean with a /), construct the corresponding source HTML page URL.
    2. Otherwise try to decode it as a Lean.Name. If decoding succeeds: a. Local decl match — present in name2ModIdx and non-private: emit a relative decl link. Auto-generated eliminators (Foo.rec, Foo.casesOn, …) prefer their parent type when the parent is also available. b. Local module match — present in moduleNames: emit a relative module link. c. Similar local decl — fuzzy-match by trailing components against the current module. d. External fallback — emit externalDeclLink name, i.e. the Mathlib find/?pattern=…#doc redirect. Both branches that previously returned none now route here, so cross-references to dep / Lean-core decls in docstrings become clickable.
    3. If the input was not a decodable name and not a .lean path, return none (the caller can treat it as plain text).

    See docs/dev/design/external-linking.md for the external-link policy.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      Instances For
        def DocGen4.Output.findBibitem? (href : String) (thePrefix : String := "") :

        Find a bibitem if href starts with thePrefix.

        Equations
        Instances For

          Flattens an array of MD4Lean.AttrText to a plain String.

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

            Extract plain text from an array of MD4Lean.Text.

            Equations
            Instances For

              Generates an id attribute for heading elements, with the following rules:

              1. Characters in letter, mark, number and symbol Unicode categories are preserved.
              2. Any sequences of characters in punctuation, separator and other categories are replaced by a single dash.
              3. Cases (upper and lower) are preserved.
              Equations
              Instances For
                def DocGen4.Output.mdGetHeadingId.replaceCharSeq (pattern : CharBool) (replacement s : String) :
                Equations
                Instances For

                  Checks whether a fenced code block language allows auto-linking.

                  Equations
                  Instances For

                    Automatically adds intra-documentation links for code content.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      partial def DocGen4.Output.renderText (t : MD4Lean.Text) (funName : String) (inLink : Bool := false) :

                      Renders a single MD4Lean.Text inline element to HTML, while processing custom extensions such as bibliography items. inLink suppresses auto-linking inside <a> to avoid nested anchors.

                      partial def DocGen4.Output.renderTexts (texts : Array MD4Lean.Text) (funName : String) (inLink : Bool := false) :

                      Render an array of MD4Lean.Text inline elements to HTML.

                      partial def DocGen4.Output.renderBlock (block : MD4Lean.Block) (funName : String) (tight : Bool := false) :

                      Render a single MD4Lean.Block element to HTML.

                      partial def DocGen4.Output.renderLi (li : MD4Lean.Li MD4Lean.Block) (funName : String) (tight : Bool) :

                      Render a list item to HTML.

                      Find all references in a markdown text.

                      Convert docstring to Html.

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