Documentation

Lean.DocString.Markdown

@[reducible, inline]

A monad for accumulating footnotes while rendering Markdown. Footnote labels are paired with their already-rendered bodies, in order of first reference. MarkdownM.run' flushes them at the end of the document.

Equations
Instances For

    Tracks which inline delimiters are already open so that nested * / ** / […](…) don't emit redundant openers and closers.

    • inEmph : Bool

      The current code is inside emphasis (*…*).

    • inBold : Bool

      The current code is inside strong emphasis (**…**).

    Instances For

      Renders an action that produces an array of lines into a single Markdown string, appending any accumulated footnotes after the main body.

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

        Applies a uniform prefix to every line. Empty lines receive the trimmed prefix to avoid trailing whitespace (which denotes a hard line break).

        Equations
        Instances For

          Applies one prefix to the first line and a different prefix to subsequent lines. Used for list items, where the first line gets "* " / "1. " and the continuation lines get " " / " ".

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

            Concatenates an array of "block" line arrays into one line array, with a single empty separator line between adjacent non-empty blocks. Empty input blocks are skipped.

            Equations
            Instances For

              Concatenates a array of lines, where each line is an array of rendered inlines. The last line of one piece is glued onto the first line of the next via glueInlineBoundary (so .text "a" followed by .text "b" yields one line "ab", but two adjacent .code spans get a U+200B between them).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                class Lean.Doc.ToMarkdown (α : Type u) :

                A means of transforming values into Markdown lines.

                • toMarkdown : αMarkdownM (Array String)

                  Render an α to its Markdown lines. The lines should not contain literal \n characters; line breaks are encoded by the array structure.

                Instances

                  A way to transform inline elements extended with i into Markdown lines.

                  Instances
                    @[implicit_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.
                    class Lean.Doc.MarkdownBlock (i : Type u) (b : Type v) :
                    Type (max u v)

                    A way to transform block elements extended with b (containing inline elements extended with i) into Markdown lines.

                    Instances
                      @[implicit_reducible]
                      Equations
                      • One or more equations did not get rendered due to their size.
                      partial def Lean.Doc.partMarkdown {i : Type u_1} {b : Type u_2} {p : Type u_3} [MarkdownInline i] [MarkdownBlock i b] (level : Nat) (part : Part i b p) :

                      Renders a Part (a logical document section) at the given heading level. Headings use ATX-style (#, ##, …) with level 0 rendering as #.

                      @[implicit_reducible]
                      Equations