Documentation

Lean.Data.Markdown.Block

A count of columns. Indentation is measured in columns (CommonMark §2.2). A space is one column, and a tab advances to the next tab stop, which is the next multiple of four.

  • count : Nat

    The number of columns.

Instances For
    Equations
    Instances For
      @[instance_reducible, inline]
      Equations
      @[instance_reducible]
      Equations
      @[instance_reducible]
      Equations
      @[instance_reducible, inline]
      Equations
      @[instance_reducible, inline]
      Equations
      @[instance_reducible, inline]
      Equations
      @[instance_reducible, inline]
      Equations
      @[inline]

      The columns after a space.

      Equations
      Instances For
        @[inline]

        The width of a tab at c, which is the number of columns up to the next tab stop.

        Equations
        Instances For
          @[inline]

          The columns after a tab at c, which is the next tab stop.

          Equations
          Instances For

            The marker character of a bullet list.

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

                The terminating delimiter of an ordered-list marker.

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

                    The kind of a list.

                    All items in a list must share the same kind. An unordered list cannot mix * with -, and an ordered list cannot mix 1. with 1).

                    • bullet (kind : BulletKind) : ListKind

                      A bullet list with the given marker character.

                    • ordered (start : Nat) (delim : OrderedDelim) : ListKind

                      An ordered list. start is the value of the first item; delim is the punctuation that follows the digits.

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

                        The fence character that a fenced code block uses.

                        • backtick : FenceChar

                          A backtick (`) fence. The info string may not contain backticks.

                        • tilde : FenceChar

                          A tilde (~) fence.

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

                            Information that is attached to a fenced code block at its opening fence.

                            • fenceChar : FenceChar

                              The fence character: ` or ~.

                            • fenceLen : Nat

                              The length of the opening fence (always 3 or more). The closing fence must be at least this long and use the same character.

                            • openIndent : Columns

                              The indentation of the opening fence's first character. The content lines exclude up to this much indentation.

                            • infoString? : Option s.Subslice

                              The info string, if there is one. This is usually a language tag.

                            Instances For

                              A line of a code block or HTML block, after the prefixes of the enclosing containers and the block's own indentation.

                              A tab spans the columns up to the next tab stop (CommonMark §2.2), so the indentation may end partway through a tab. Such a tab is not part of source, and its columns after the indentation are leadingSpaces.

                              • source : s.Subslice

                                The line's source, without its line ending.

                              • leadingSpaces : Nat

                                The number of columns of a tab that the indentation ends partway through.

                              Instances For

                                The line's text, which is leadingSpaces spaces followed by the source.

                                Equations
                                Instances For

                                  A block of the source string s after the first pass, which determines the type and extent of every block but does not parse inline content. The content of a paragraph or heading is an InlineSource.

                                  • paragraph {s : String.Slice} (content : InlineSource s) : Raw s

                                    A paragraph, which is a sequence of consecutive non-blank lines that don't start any other kind of block.

                                  • atxHeading {s : String.Slice} (level : Nat) (hashes : s.Subslice) (content : InlineSource s) (closeHashes? : Option s.Subslice) : Raw s

                                    An ATX heading (the usual kind). level is the number of opening # characters, hashes is that opening sequence, and closeHashes? an optional closing sequence.

                                  • setextHeading {s : String.Slice} (level : Nat) (content : InlineSource s) (underline : s.Subslice) : Raw s

                                    A setext heading (CommonMark §4.3), which is one or more lines of paragraph text that are followed by an underline (=== for level 1, --- for level 2).

                                  • fencedCode {s : String.Slice} (info : FenceInfo s) (openFence : s.Subslice) (closeFence? : Option s.Subslice) (lines : Array (VerbatimLine s)) : Raw s

                                    A fenced code block. openFence/closeFence? are the fences. The closing fence is optional because an unterminated fenced code block spans the rest of the input. The content lines exclude up to info.openIndent columns of indentation.

                                  • indentedCode {s : String.Slice} (lines : Array (VerbatimLine s)) : Raw s

                                    An indented code block, which is a sequence of lines that are indented four or more columns. The verbatim lines exclude the four column indentation.

                                  • html {s : String.Slice} (lines : Array (VerbatimLine s)) : Raw s

                                    An HTML block (CommonMark §4.6), which has at least one line.

                                  • blockquote {s : String.Slice} (markers : Array s.Subslice) (children : Array (Raw s)) : Raw s

                                    A blockquote container. markers contains every > marker, in source order, and children contains the contained blocks.

                                  • list {s : String.Slice} (kind : ListKind) (tight : Bool) (items : Array (Raw s)) : Raw s

                                    A list container. All items are listItem blocks. tight reflects CommonMark's tight/loose distinction (§5.3). A tight list doesn't have blank lines between its items or between blocks within an item.

                                  • listItem {s : String.Slice} (marker : s.Subslice) (children : Array (Raw s)) : Raw s

                                    A list item. marker is the bullet or ordered marker, and children are the blocks that the item contains.

                                  • linkRefDef {s : String.Slice} (m : RefDef s) : Raw s

                                    A link reference definition, which is written [label]: destination "title" (the title is optional).

                                  • thematicBreak {s : String.Slice} (line : s.Subslice) : Raw s

                                    A thematic break (***, ---, or ___, optionally with interior spaces or tabs). line is the line's content from its first marker to its last.

                                  Instances For

                                    Whether two list kinds belong to the same list (that is, they have matching marker styles).

                                    The starting number of an ordered list is irrelevant, so 1. and 5. are the same list kind. Bullets must use the exact same character, and ordered lists must use the same delimiter.

                                    Equations
                                    Instances For

                                      A block of the source string s, with its inline content parsed.

                                      • paragraph {s : String.Slice} (content : Array (Inline s)) : Block s

                                        A paragraph, which is a sequence of consecutive non-blank lines that don't start any other kind of block.

                                      • atxHeading {s : String.Slice} (level : Nat) (hashes : s.Subslice) (content : Array (Inline s)) (closeHashes? : Option s.Subslice) : Block s

                                        An ATX heading (the usual kind). level is the number of opening # characters, hashes is that opening sequence, and closeHashes? an optional closing sequence.

                                      • setextHeading {s : String.Slice} (level : Nat) (content : Array (Inline s)) (underline : s.Subslice) : Block s

                                        A setext heading (CommonMark §4.3), which is one or more lines of paragraph text that are followed by an underline (=== for level 1, --- for level 2).

                                      • fencedCode {s : String.Slice} (info : FenceInfo s) (openFence : s.Subslice) (closeFence? : Option s.Subslice) (lines : Array (VerbatimLine s)) : Block s

                                        A fenced code block. openFence/closeFence? are the fences. The closing fence is optional because an unterminated fenced code block spans the rest of the input. The content lines exclude up to info.openIndent columns of indentation.

                                      • indentedCode {s : String.Slice} (lines : Array (VerbatimLine s)) : Block s

                                        An indented code block, which is a sequence of lines that are indented four or more columns. The verbatim lines exclude the four column indentation.

                                      • html {s : String.Slice} (lines : Array (VerbatimLine s)) : Block s

                                        An HTML block (CommonMark §4.6), which has at least one line.

                                      • blockquote {s : String.Slice} (markers : Array s.Subslice) (children : Array (Block s)) : Block s

                                        A blockquote container. markers contains every > marker, in source order, and children contains the contained blocks.

                                      • list {s : String.Slice} (kind : ListKind) (tight : Bool) (items : Array (Block s)) : Block s

                                        A list container. All items are listItem blocks. tight reflects CommonMark's tight/loose distinction (§5.3). A tight list doesn't have blank lines between its items or between blocks within an item.

                                      • listItem {s : String.Slice} (marker : s.Subslice) (children : Array (Block s)) : Block s

                                        A list item. marker is the bullet or ordered marker, and children are the blocks that the item contains.

                                      • linkRefDef {s : String.Slice} (m : RefDef s) : Block s

                                        A link reference definition, which is written [label]: destination "title" (the title is optional).

                                      • thematicBreak {s : String.Slice} (line : s.Subslice) : Block s

                                        A thematic break (***, ---, or ___, optionally with interior spaces or tabs). line is the line's content from its first marker to its last.

                                      Instances For

                                        The whole block, from its first delimiter to the end of its last line.