Documentation

Lean.DocString.Extension

Saved data that describes the contents. The name should determine both the type of the value and its interpretation; if in doubt, use the name of the elaborator that produces the data.

Instances For
    structure Lean.ElabBlock :

    Saved data that describes the contents. The name should determine both the type of the value and its interpretation; if in doubt, use the name of the elaborator that produces the data.

    Instances For
      def Lean.addBuiltinDocString (declName : Name) (docString : String) :

      Adds a builtin docstring to the compiler.

      Links to the Lean manual aren't validated.

      Equations
        Instances For

          Removes a builtin docstring from the compiler. This is used when translating between formats.

          Equations
            Instances For

              Retrieves all builtin Verso docstrings.

              Equations
                Instances For
                  def Lean.addDocStringCore {m : TypeType} [Monad m] [MonadError m] [MonadEnv m] [MonadLiftT BaseIO m] (declName : Name) (docString : String) :
                  Equations
                    Instances For
                      def Lean.removeDocStringCore {m : TypeType} [Monad m] [MonadError m] [MonadEnv m] [MonadLiftT BaseIO m] (declName : Name) :
                      Equations
                        Instances For
                          def Lean.addDocStringCore' {m : TypeType} [Monad m] [MonadError m] [MonadEnv m] [MonadLiftT BaseIO m] (declName : Name) (docString? : Option String) :
                          Equations
                            Instances For
                              def Lean.addInheritedDocString {m : TypeType} [Monad m] [MonadError m] [MonadEnv m] (declName target : Name) :
                              Equations
                                Instances For
                                  partial def Lean.findInternalDocString? (env : Environment) (declName : Name) (includeBuiltin : Bool := true) :

                                  Finds a docstring without performing any alias resolution or enrichment with extra metadata. For Markdown docstrings, the result is a string; for Verso docstrings, it's a VersoDocString.

                                  Docstrings to be shown to a user should be looked up with Lean.findDocString? instead.

                                  def Lean.findSimpleDocString? (env : Environment) (declName : Name) (includeBuiltin : Bool := true) :

                                  Finds a docstring without performing any alias resolution or enrichment with extra metadata. The result is rendered as Markdown.

                                  Docstrings to be shown to a user should be looked up with Lean.findDocString? instead.

                                  Equations
                                    Instances For
                                      structure Lean.ModuleDoc :
                                      Instances For
                                        Equations
                                          Instances For
                                            Equations
                                              Instances For
                                                def Lean.getDocStringText {m : TypeType} [Monad m] [MonadError m] (stx : TSyntax `Lean.Parser.Command.docComment) :
                                                Equations
                                                  Instances For

                                                    A snippet of a Verso module text.

                                                    A snippet consists of text followed by subsections. Because the sequence of snippets that occur in a source file are conceptually a single document, they have a consistent header nesting structure. This means that initial textual content of a snippet is a continuation of the text at the end of the prior snippet.

                                                    The actual hierarchical structure of the document is reconstructed from the sequence of snippets.

                                                    The terminal nesting of a sequence of snippets is 0 if there are no sections in the sequence. Otherwise, it is one greater than the nesting of the last snippet's last section. The module docstring elaborator maintains the invariant that each snippet's first section's level is at most the terminal nesting of the preceding snippets, and that the level of each section within a snippet is at most one greater than the preceding section's level.

                                                    Instances For
                                                      Equations
                                                        Instances For
                                                          Equations
                                                            Instances For
                                                              Instances For
                                                                Equations
                                                                  Instances For
                                                                    Equations
                                                                      Instances For
                                                                        Equations
                                                                          Instances For
                                                                            Equations
                                                                              Instances For

                                                                                Returns the Verso module docs for the current main module.

                                                                                During elaboration, this will return the modules docs that have been added thus far, rather than those for the entire module.

                                                                                Equations
                                                                                  Instances For
                                                                                    @[deprecated Lean.getMainVersoModuleDocs (since := "2026-01-21")]
                                                                                    Equations
                                                                                      Instances For

                                                                                        Returns all snippets of the Verso module docs from the indicated module, if they exist.

                                                                                        Equations
                                                                                          Instances For