Documentation

Lean.DocString.View

This module defines views of the concrete syntax of Verso documents.

The syntax declarations in Lean.DocString.Syntax specify the shapes of the trees that the Verso parser and quotations produce. Views expose one level of this structure at a time as ordinary Lean datatypes. Each view node records the syntax it represents, the delimiter atoms that tooling such as semantic highlighting needs, and decoded values for literal content. Using views allows clients to avoid needing to check for things like optional brackets at all sites.

An of function returns none when the syntax does not have the specified shape. The parser and quotations produce only well-formed trees, so a none result indicates a bug. Callers report it as an error at the syntax in question.

A view of the value of an argument to a role, directive, command, or code block.

Instances For
    def Lean.Doc.ArgValView.of (stx : TSyntax `Lean.Doc.Parser.argVal) :

    A view of stx, if it is an argument value.

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

      A view of an argument to a role, directive, command, or code block.

      • anon (stx : TSyntax `Lean.Doc.Parser.arg) (val : TSyntax `Lean.Doc.Parser.argVal) : ArgView

        An anonymous positional argument.

      • named (stx : TSyntax `Lean.Doc.Parser.arg) (parens : Option (Syntax × Syntax)) (name : Ident) (assign : Syntax) (val : TSyntax `Lean.Doc.Parser.argVal) : ArgView

        A named argument. parens is the pair of parenthesis atoms when the argument is written in parentheses, and assign is the := atom.

      • flag (stx : TSyntax `Lean.Doc.Parser.arg) (sign : Syntax) (name : Ident) (isOn : Bool) : ArgView

        A flag. sign is the + or - atom, and isOn indicates which one it is.

      Instances For
        def Lean.Doc.ArgView.stx :
        ArgView → TSyntax `Lean.Doc.Parser.arg

        Returns the syntax underlying an argument view.

        Equations
        Instances For
          def Lean.Doc.ArgView.of (stx : TSyntax `Lean.Doc.Parser.arg) :

          A view of stx, if it is an argument.

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

            A view of a link target, which is either a URL or a reference to a URL defined elsewhere.

            Instances For
              def Lean.Doc.mkVersoTextFrom (src : Syntax) (value : String) (canonical : Bool := false) :

              Builds a text content token containing value, with its position taken from src.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def Lean.Doc.mkVersoRefNameFrom (src : Syntax) (value : String) (canonical : Bool := false) :

                Builds the name of a footnote or link reference containing value, with its position taken from src.

                Equations
                Instances For
                  def Lean.Doc.mkVersoLinkUrlFrom (src : Syntax) (value : String) (canonical : Bool := false) :

                  Builds a link URL token containing value, with its position taken from src.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Lean.Doc.mkVersoImageAltFrom (src : Syntax) (value : String) (canonical : Bool := false) :

                    Builds an image's alternate text containing value, with its position taken from src.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Lean.Doc.mkVersoLinkRefUrlFrom (src : Syntax) (value : String) (canonical : Bool := false) :

                      Builds the URL of a link reference definition containing value, with its position taken from src.

                      Equations
                      Instances For
                        def Lean.Doc.mkVersoCodeFrom (src : Syntax) (value : String) (canonical : Bool := false) :

                        Builds inline code content containing value, with one line token per line and its position taken from src.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Lean.Doc.mkVersoCodeBlockFrom (src : Syntax) (value : String) (canonical : Bool := false) :

                          Builds a code block's content containing value, with one line token per line and its position taken from src.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Lean.Doc.mkVersoLinebreakFrom (src : Syntax) (canonical : Bool := false) :
                            TSyntax `Lean.Doc.Parser.Inline.linebreak

                            Builds a line break, with its position taken from src.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              def Lean.Doc.mkVersoLinebreakFromRef {m : Type → Type} [Monad m] [MonadRef m] (canonical : Bool := false) :
                              m (TSyntax `Lean.Doc.Parser.Inline.linebreak)

                              Builds a line break, positioned at the current reference.

                              Equations
                              Instances For
                                def Lean.Doc.mkVersoTextFromRef {m : Type → Type} [Monad m] [MonadRef m] (value : String) (canonical : Bool := false) :

                                Builds a text content token containing value, positioned at the current reference.

                                Equations
                                Instances For
                                  def Lean.Doc.mkVersoRefNameFromRef {m : Type → Type} [Monad m] [MonadRef m] (value : String) (canonical : Bool := false) :

                                  Builds a reference name containing value, positioned at the current reference.

                                  Equations
                                  Instances For
                                    def Lean.Doc.mkVersoLinkUrlFromRef {m : Type → Type} [Monad m] [MonadRef m] (value : String) (canonical : Bool := false) :

                                    Builds a link URL containing value, positioned at the current reference.

                                    Equations
                                    Instances For
                                      def Lean.Doc.mkVersoImageAltFromRef {m : Type → Type} [Monad m] [MonadRef m] (value : String) (canonical : Bool := false) :

                                      Builds an image's alternate text containing value, positioned at the current reference.

                                      Equations
                                      Instances For
                                        def Lean.Doc.mkVersoLinkRefUrlFromRef {m : Type → Type} [Monad m] [MonadRef m] (value : String) (canonical : Bool := false) :

                                        Builds the URL of a link reference definition containing value, positioned at the syntax getRef returns.

                                        Equations
                                        Instances For
                                          def Lean.Doc.mkVersoCodeFromRef {m : Type → Type} [Monad m] [MonadRef m] (value : String) (canonical : Bool := false) :

                                          Builds inline code content containing value, positioned at the current reference.

                                          Equations
                                          Instances For
                                            def Lean.Doc.mkVersoCodeBlockFromRef {m : Type → Type} [Monad m] [MonadRef m] (value : String) (canonical : Bool := false) :

                                            Builds a code block's content containing value, positioned at the current reference.

                                            Equations
                                            Instances For
                                              def Lean.Doc.LinkTargetView.of (stx : TSyntax `Lean.Doc.Parser.linkTarget) :

                                              A view of stx, if it is a link target.

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

                                                A view of ordinary text.

                                                • stx : TSyntax `Lean.Doc.Parser.inline

                                                  The original syntax.

                                                • content : VersoText

                                                  The text.

                                                Instances For

                                                  Decodes the Verso text contained in the view, interpreting escape sequences.

                                                  Equations
                                                  Instances For

                                                    Returns the literal representation of the text in the view, without interpreting escape sequences.

                                                    Equations
                                                    Instances For
                                                      def Lean.Doc.TextView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                      A view of stx, if it is ordinary text.

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

                                                        A view of emphasized content.

                                                        • stx : TSyntax `Lean.Doc.Parser.inline

                                                          The original syntax.

                                                        • opener : TSyntax `Lean.Doc.Parser.emphDelimiter

                                                          The opening run of _.

                                                        • content : TSyntaxArray `Lean.Doc.Parser.inline

                                                          The emphasized content.

                                                        • closer : TSyntax `Lean.Doc.Parser.emphDelimiter

                                                          The closing run of _.

                                                        Instances For
                                                          def Lean.Doc.EmphView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                          A view of stx, if it is emphasized content.

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

                                                            A view of bold content.

                                                            • stx : TSyntax `Lean.Doc.Parser.inline

                                                              The original syntax.

                                                            • opener : TSyntax `Lean.Doc.Parser.boldDelimiter

                                                              The opening run of *.

                                                            • content : TSyntaxArray `Lean.Doc.Parser.inline

                                                              The bold content.

                                                            • closer : TSyntax `Lean.Doc.Parser.boldDelimiter

                                                              The closing run of *.

                                                            Instances For
                                                              def Lean.Doc.BoldView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                              A view of stx, if it is bold content.

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

                                                                A view of literal code.

                                                                This view is used both for inline code elements and the body of math notation.

                                                                • stx : TSyntax `Lean.Doc.Parser.inline

                                                                  The original syntax.

                                                                • opener : TSyntax `Lean.Doc.Parser.codeDelimiter

                                                                  The opening run of backticks.

                                                                • content : VersoCode

                                                                  The code.

                                                                • closer : TSyntax `Lean.Doc.Parser.codeDelimiter

                                                                  The closing run of backticks.

                                                                Instances For

                                                                  The decoded code contents

                                                                  Equations
                                                                  Instances For
                                                                    def Lean.Doc.CodeView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                    A view of stx, if it is inline code.

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

                                                                      A view of math content.

                                                                      • stx : TSyntax `Lean.Doc.Parser.inline

                                                                        The original syntax.

                                                                      • mode : MathMode

                                                                        Whether the mathematics should be typeset in inline or display mode.

                                                                      • marker : TSyntax [`Lean.Doc.Parser.inlineMathMarker, `Lean.Doc.Parser.displayMathMarker]

                                                                        The $ or $$ marker.

                                                                      • code : CodeView

                                                                        The LaTeX-style math code.

                                                                      Instances For

                                                                        The decoded code contents.

                                                                        Equations
                                                                        Instances For
                                                                          def Lean.Doc.MathView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                          A view of stx, if it is math content.

                                                                          Math nests a code element, so the view contains the view of that element.

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

                                                                            A view of a link.

                                                                            • stx : TSyntax `Lean.Doc.Parser.inline

                                                                              The original syntax.

                                                                            • opener : Syntax

                                                                              The [ that opens the link text.

                                                                            • content : TSyntaxArray `Lean.Doc.Parser.inline

                                                                              The link text.

                                                                            • closer : Syntax

                                                                              The ] that closes the link text.

                                                                            • Where the link leads.

                                                                            Instances For
                                                                              def Lean.Doc.LinkView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                              A view of stx, if it is a link.

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

                                                                                A view of an image.

                                                                                • stx : TSyntax `Lean.Doc.Parser.inline

                                                                                  The original syntax.

                                                                                • opener : Syntax

                                                                                  The ![ that opens the alternate text.

                                                                                • The alternate text.

                                                                                • closer : Syntax

                                                                                  The ] that closes the alternate text.

                                                                                • Where the image is found.

                                                                                Instances For

                                                                                  The alternate text, with each escape replaced by the character it denotes.

                                                                                  Equations
                                                                                  Instances For
                                                                                    def Lean.Doc.ImageView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                                    A view of stx, if it is an image.

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

                                                                                      A view of a footnote use site.

                                                                                      • stx : TSyntax `Lean.Doc.Parser.inline

                                                                                        The original syntax.

                                                                                      • opener : Syntax

                                                                                        The [^ that opens the name.

                                                                                      • The name that refers to the footnote's definition.

                                                                                      • closer : Syntax

                                                                                        The ] that closes the name.

                                                                                      Instances For

                                                                                        The name that refers to the footnote's definition.

                                                                                        Equations
                                                                                        Instances For
                                                                                          def Lean.Doc.FootnoteView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                                          A view of stx, if it is a footnote use site.

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

                                                                                            A view of a line break.

                                                                                            • stx : TSyntax `Lean.Doc.Parser.inline

                                                                                              The original syntax.

                                                                                            • newline : Syntax

                                                                                              The newline atom.

                                                                                            Instances For
                                                                                              def Lean.Doc.LinebreakView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                                              A view of stx, if it is a line break.

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

                                                                                                A view of content with a role.

                                                                                                • stx : TSyntax `Lean.Doc.Parser.inline

                                                                                                  The original syntax.

                                                                                                • braceOpen : Syntax

                                                                                                  The { that opens the name and arguments.

                                                                                                • name : Ident

                                                                                                  The name that selects the role's expander.

                                                                                                • args : TSyntaxArray `Lean.Doc.Parser.arg

                                                                                                  The arguments to the role.

                                                                                                • braceClose : Syntax

                                                                                                  The } that closes the name and arguments.

                                                                                                • brackets : Option (Syntax × Syntax)

                                                                                                  The brackets around the content, if they are present.

                                                                                                • content : TSyntaxArray `Lean.Doc.Parser.inline

                                                                                                  The content that the role applies to.

                                                                                                Instances For
                                                                                                  def Lean.Doc.RoleView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                                                  A view of stx, if it is content with a role.

                                                                                                  An author may write content that has delimiters of its own without brackets, so the brackets are matched separately from the name and arguments.

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

                                                                                                    A view of an inline document element.

                                                                                                    Instances For
                                                                                                      def Lean.Doc.InlineView.of (stx : TSyntax `Lean.Doc.Parser.inline) :

                                                                                                      A view of stx, if it is an inline document element.

                                                                                                      Each production has a view of its own, and this tries them in turn. The productions have distinct syntax kinds, so at most one applies and the order does not matter.

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

                                                                                                        A view of an item of an unordered list.

                                                                                                        • stx : TSyntax `Lean.Doc.Parser.ListItem.item

                                                                                                          The original syntax.

                                                                                                        • marker : TSyntax `Lean.Doc.Parser.listMarker

                                                                                                          The marker, which is *, -, or +.

                                                                                                        • contents : TSyntaxArray `Lean.Doc.Parser.block

                                                                                                          The item's contents.

                                                                                                        Instances For
                                                                                                          def Lean.Doc.UnorderedListItemView.of (stx : TSyntax `Lean.Doc.Parser.ListItem.item) :

                                                                                                          A view of stx, if it is an unordered list's item. Its marker must be a bullet.

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

                                                                                                            A view of an item of an ordered list.

                                                                                                            • stx : TSyntax `Lean.Doc.Parser.ListItem.item

                                                                                                              The original syntax.

                                                                                                            • marker : TSyntax `Lean.Doc.Parser.listMarker

                                                                                                              The marker, which is a number followed by . or ).

                                                                                                            • contents : TSyntaxArray `Lean.Doc.Parser.block

                                                                                                              The item's contents.

                                                                                                            Instances For

                                                                                                              The number that the item's marker gives it.

                                                                                                              Equations
                                                                                                              • One or more equations did not get rendered due to their size.
                                                                                                              Instances For
                                                                                                                def Lean.Doc.OrderedListItemView.of (stx : TSyntax `Lean.Doc.Parser.ListItem.item) :

                                                                                                                A view of stx, if it is an ordered list's item. Its marker must be a number.

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

                                                                                                                  A view of an item description from a description list.

                                                                                                                  • stx : TSyntax `Lean.Doc.Parser.DescItem.item

                                                                                                                    The original syntax.

                                                                                                                  • marker : Syntax

                                                                                                                    The : that introduces the item.

                                                                                                                  • term : TSyntaxArray `Lean.Doc.Parser.inline

                                                                                                                    The term that the item describes.

                                                                                                                  • desc : TSyntaxArray `Lean.Doc.Parser.block

                                                                                                                    The description.

                                                                                                                  Instances For
                                                                                                                    def Lean.Doc.DescItemView.of (stx : TSyntax `Lean.Doc.Parser.DescItem.item) :

                                                                                                                    A view of stx, if it is a description list item.

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

                                                                                                                      A view of a paragraph.

                                                                                                                      • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                        The original syntax.

                                                                                                                      • content : TSyntaxArray `Lean.Doc.Parser.inline

                                                                                                                        The paragraph's contents.

                                                                                                                      Instances For
                                                                                                                        def Lean.Doc.ParaView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                        A view of stx, if it is a paragraph.

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

                                                                                                                          A view of an unordered list.

                                                                                                                          Instances For

                                                                                                                            A view of stx, if it is an unordered list.

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

                                                                                                                              A view of an ordered list.

                                                                                                                              • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                The original syntax.

                                                                                                                              • start : Nat

                                                                                                                                The number of the first item, which the first item's marker gives it.

                                                                                                                              • The list's items.

                                                                                                                              Instances For
                                                                                                                                def Lean.Doc.OrderedListView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                A view of stx, if it is an ordered list.

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

                                                                                                                                  A view of a description list.

                                                                                                                                  Instances For
                                                                                                                                    def Lean.Doc.DescListView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                    A view of stx, if it is a description list.

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

                                                                                                                                      A view of a block quotation.

                                                                                                                                      • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                        The original syntax.

                                                                                                                                      • marker : Syntax

                                                                                                                                        The > that introduces the quotation.

                                                                                                                                      • content : TSyntaxArray `Lean.Doc.Parser.block

                                                                                                                                        The quoted blocks.

                                                                                                                                      Instances For
                                                                                                                                        def Lean.Doc.BlockquoteView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                        A view of stx, if it is a block quotation.

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

                                                                                                                                          A view of a code block.

                                                                                                                                          • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                            The original syntax.

                                                                                                                                          • openFence : TSyntax `Lean.Doc.Parser.codeBlockFence

                                                                                                                                            The opening run of backticks.

                                                                                                                                          • name? : Option Ident

                                                                                                                                            The name that selects the code block's expander, where the code block invokes one.

                                                                                                                                          • args : TSyntaxArray `Lean.Doc.Parser.arg

                                                                                                                                            The arguments to the expander.

                                                                                                                                          • content : VersoCodeBlock

                                                                                                                                            The code.

                                                                                                                                          • closeFence : TSyntax `Lean.Doc.Parser.codeBlockFence

                                                                                                                                            The closing run of backticks.

                                                                                                                                          Instances For

                                                                                                                                            The code, which is the texts of its lines in order.

                                                                                                                                            Equations
                                                                                                                                            Instances For
                                                                                                                                              def Lean.Doc.CodeBlockView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                              A view of stx, if it is a code block.

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

                                                                                                                                                A view of a directive.

                                                                                                                                                • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                                  The original syntax.

                                                                                                                                                • opener : TSyntax `Lean.Doc.Parser.directiveDelimiter

                                                                                                                                                  The opening run of colons.

                                                                                                                                                • name : Ident

                                                                                                                                                  The name that selects the directive's expander.

                                                                                                                                                • args : TSyntaxArray `Lean.Doc.Parser.arg

                                                                                                                                                  The arguments to the directive.

                                                                                                                                                • content : TSyntaxArray `Lean.Doc.Parser.block

                                                                                                                                                  The blocks that the directive contains.

                                                                                                                                                • closer : TSyntax `Lean.Doc.Parser.directiveDelimiter

                                                                                                                                                  The closing run of colons.

                                                                                                                                                Instances For
                                                                                                                                                  def Lean.Doc.DirectiveView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                                  A view of stx, if it is a directive.

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

                                                                                                                                                    A view of a block-level command.

                                                                                                                                                    • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                                      The original syntax.

                                                                                                                                                    • braceOpen : Syntax

                                                                                                                                                      The { that opens the name and arguments.

                                                                                                                                                    • name : Ident

                                                                                                                                                      The name that selects the command's expander.

                                                                                                                                                    • args : TSyntaxArray `Lean.Doc.Parser.arg

                                                                                                                                                      The arguments to the command.

                                                                                                                                                    • braceClose : Syntax

                                                                                                                                                      The } that closes the name and arguments.

                                                                                                                                                    Instances For
                                                                                                                                                      def Lean.Doc.CommandView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                                      A view of stx, if it is a block-level command.

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

                                                                                                                                                        A view of a section header.

                                                                                                                                                        • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                                          The original syntax.

                                                                                                                                                        • marker : TSyntax `Lean.Doc.Parser.headerMarker

                                                                                                                                                          The run of # characters.

                                                                                                                                                        • level : Nat

                                                                                                                                                          The header's nesting depth, with 0 denoting a top-level header.

                                                                                                                                                        • content : TSyntaxArray `Lean.Doc.Parser.inline

                                                                                                                                                          The header's text.

                                                                                                                                                        Instances For
                                                                                                                                                          def Lean.Doc.HeaderView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                                          A view of stx, if it is a section header.

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

                                                                                                                                                            A view of a named URL that links and images can use.

                                                                                                                                                            • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                                              The original syntax.

                                                                                                                                                            • opener : Syntax

                                                                                                                                                              The [ that opens the name.

                                                                                                                                                            • The name that a link or image uses to reach the URL.

                                                                                                                                                            • closer : Syntax

                                                                                                                                                              The ]: that closes the name.

                                                                                                                                                            • The URL.

                                                                                                                                                            Instances For

                                                                                                                                                              The name that a link or image repeats to reach this URL.

                                                                                                                                                              Equations
                                                                                                                                                              Instances For

                                                                                                                                                                The URL that the reference provides.

                                                                                                                                                                Equations
                                                                                                                                                                Instances For
                                                                                                                                                                  def Lean.Doc.LinkRefView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                                                  A view of stx, if it is a named URL.

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

                                                                                                                                                                    A view of a footnote definition.

                                                                                                                                                                    • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                                                      The original syntax.

                                                                                                                                                                    • opener : Syntax

                                                                                                                                                                      The [^ that opens the name.

                                                                                                                                                                    • The name of the footnote.

                                                                                                                                                                    • closer : Syntax

                                                                                                                                                                      The ]: that closes the name.

                                                                                                                                                                    • content : TSyntaxArray `Lean.Doc.Parser.inline

                                                                                                                                                                      The footnote's text.

                                                                                                                                                                    Instances For

                                                                                                                                                                      The name of the footnote.

                                                                                                                                                                      Equations
                                                                                                                                                                      Instances For
                                                                                                                                                                        def Lean.Doc.FootnoteRefView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                                                        A view of stx, if it is a footnote definition.

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

                                                                                                                                                                          A view of a metadata block for the preceding header.

                                                                                                                                                                          • stx : TSyntax `Lean.Doc.Parser.block

                                                                                                                                                                            The original syntax.

                                                                                                                                                                          • opener : Syntax

                                                                                                                                                                            The opening %%%.

                                                                                                                                                                          • contents : TSyntax `Lean.Parser.Term.structInstFields

                                                                                                                                                                            The metadata, written as the fields of a Lean structure instance.

                                                                                                                                                                          • closer : Syntax

                                                                                                                                                                            The closing %%%.

                                                                                                                                                                          Instances For
                                                                                                                                                                            def Lean.Doc.MetadataView.fields (v : MetadataView) :
                                                                                                                                                                            TSyntaxArray `Lean.Parser.Term.structInstField

                                                                                                                                                                            The individual metadata fields, without their separators.

                                                                                                                                                                            Equations
                                                                                                                                                                            Instances For
                                                                                                                                                                              def Lean.Doc.MetadataView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                                                              A view of stx, if it is a metadata block.

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

                                                                                                                                                                                A view of a block-level document element.

                                                                                                                                                                                Each view records the syntax it is a view of, the delimiter atoms, and decoded values for literal content. Nested content stays as concrete syntax, for the consumer to view in turn.

                                                                                                                                                                                Instances For
                                                                                                                                                                                  def Lean.Doc.BlockView.of (stx : TSyntax `Lean.Doc.Parser.block) :

                                                                                                                                                                                  A view of stx, if it is a block-level document element.

                                                                                                                                                                                  Each production has a view of its own, and this tries them in turn. The productions have distinct syntax kinds, so at most one applies and the order does not matter.

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

                                                                                                                                                                                    Returns a view of an inline element of a Verso document.

                                                                                                                                                                                    Returns default if the syntax is malformed.

                                                                                                                                                                                    Equations
                                                                                                                                                                                    Instances For

                                                                                                                                                                                      Returns a view of a block-level element of a Verso document.

                                                                                                                                                                                      Returns default if the syntax is malformed.

                                                                                                                                                                                      Equations
                                                                                                                                                                                      Instances For