Validates all links to the Lean reference manual in docstring.
This is intended to be used before saving a docstring that is later subject to rewriting with
rewriteManualLinks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parses a docstring as Verso, returning the syntax if successful.
When not successful, parser errors are logged.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reports parse errors from a Verso docstring parse failure.
When Verso docstring parsing fails at parse time, a parseFailure node is created containing the
raw text, because emitting an error at that stage could lead to unwanted parser backtracking. This
function reports the actual error messages with proper source positions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The result of elaborating a Verso docstring, which consists of the docstring contents paired with a set of deferred checks.
- deferredChecks : Array Doc.DeferredCheck
Checks that cannot be carried out during elaboration, typically because they require information that is not yet available.
Instances For
Parses a Verso docstring from its text and elaborates it for the specified declaration. Because the text carries no source positions, interactive features are disabled and any messages are reported at the current reference.
binders should be the syntax of the parameters to the constant that is being documented, as a null
node that contains a sequence of bracketed binders, or an empty null node when none are available.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborates a Verso docstring for the specified declaration, which should already be present in the environment.
binders should be the syntax of the parameters to the constant that is being documented, as a null
node that contains a sequence of bracketed binders. It is used to allow interactive features such as
document highlights and “find references” to work for documented parameters. If no parameter binders
are available, pass Syntax.missing or an empty null node.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parses and elaborates a Verso module docstring.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a Verso docstring to the specified declaration, which should already be present in the environment. The docstring is added from a string value, rather than syntax, which means that the interactive features are disabled.
Equations
- Lean.versoDocStringFromString declName docComment = Lean.versoDocStringOfText declName (Lean.mkNullNode #[]) docComment
Instances For
Adds a Markdown docstring to the environment, validating documentation links.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds an elaborated Verso docstring to the environment, recording its deferred checks under this
declaration as their site.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds an elaborated Verso module docstring to the environment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a Verso docstring to the environment.
binders should be the syntax of the parameters to the constant that is being documented, as a null
node that contains a sequence of bracketed binders. It is used to allow interactive features such as
document highlights and “find references” to work for documented parameters. If no parameter binders
are available, pass Syntax.missing or an empty null node.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a Verso docstring to the environment from a string value, which disables the interactive features. This should be used for programs that add documentation when there is no syntax available.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a docstring to the environment. If isVerso is false, then the docstring is interpreted as
Markdown.
Equations
- Lean.addDocStringOf isVerso declName binders docComment = if isVerso = true then Lean.addVersoDocString declName binders docComment else Lean.addMarkdownDocString declName docComment
Instances For
Interprets a docstring that has been saved as a Markdown string as Verso, elaborating it. This is used during bootstrapping.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds a docstring to the environment.
Whether the docstring is processed as Verso or as Markdown is determined by the form of its syntax
tree. To explicitly control whether the docstring is in Verso format, use addDocStringOf instead.
Markdown docstrings have their documentation links validated.
For Verso docstrings, binders should be the syntax of the parameters to the constant that is being
documented, as a null node that contains a sequence of bracketed binders. It is used to allow
interactive features such as document highlights and “find references” to work for documented
parameters. If no parameter binders are available, pass Syntax.missing or an empty null node.
binders is not used for Markdown docstrings.
Equations
- Lean.addDocString declName binders docComment = Lean.addDocStringOf (Lean.isVersoDocComment docComment) declName binders docComment
Instances For
Adds a docstring to the environment, if it is provided. If no docstring is provided, nothing happens.
Whether the docstring is processed as Verso or as Markdown is determined by its syntax tree, which
reflects the doc.verso option at the docstring's parse site. To explicitly control whether the
docstring is in Verso format, use addDocStringOf instead.
Markdown docstrings have their documentation links validated.
For Verso docstrings, binders should be the syntax of the parameters to the constant that is being
documented, as a null node that contains a sequence of bracketed binders. It is used to allow
interactive features such as document highlights and “find references” to work for documented
parameters. If no parameter binders are available, pass Syntax.missing or an empty null node.
binders is not used for Markdown docstrings.
Equations
- Lean.addDocString' declName binders (some docString) = Lean.addDocString declName binders docString
- Lean.addDocString' declName binders none = pure ()
Instances For
Adds a Verso docstring to the environment.
binders should be the syntax of the parameters to the constant that is being documented, as a null
node that contains a sequence of bracketed binders. It is used to allow interactive features such as
document highlights and “find references” to work for documented parameters. If no parameter binders
are available, pass Syntax.missing or an empty null node.
Equations
- Lean.addVersoModDocString range docComment = do let __x ← Lean.versoModDocString range docComment match __x with | (snippet, deferred) => Lean.addVersoModDocStringCore snippet deferred