Documentation

ImportGraph.Util.TableMessage

Formatting tables #

This module provides basic utilities for formatting tables with aligned columns. For now, we only supports tables of strings.

Future work #

@[inline]
def ImportGraph.String.rightPad (n : Nat) (s : String) (char : Char := ' ') :

Pad a string on the right with c : Char (by default ' '), until it reaches length n. Does not trim strings already over length n down to length n.

Equations
Instances For
    @[inline]
    def ImportGraph.String.leftPad (n : Nat) (s : String) (char : Char := ' ') :

    Pad a string on the left with c : Char (by default ' '), until it reaches length n. Does not trim strings already over length n down to length n.

    Equations
    Instances For
      @[reducible, inline]

      A row with a fixed number of elements in a table such as Array (Table.Row 5). (The Strings in a Row are allowed to have any length.)

      Equations
      Instances For

        Given an array of table rows, arranges them in a table. Each cell is left-aligned, and separated from the next cell in the row by a space. Spaces at the end of each row are trimmed.

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

          An empty row in a table.

          Equations
          Instances For
            def ImportGraph.Table.Row.rightPad {n m : Nat} (row : Table.Row n) (h : n ≤ m := by grind) :

            Increase the size of a row by padding it on the right with empty cells.

            Equations
            Instances For