terminal_table/themes

Built-in and custom terminal table border themes.

Types

BorderSet = object
  topLeft*, topJoin*, topRight*: string
  middleLeft*, middleJoin*, middleRight*: string
  bottomLeft*, bottomJoin*, bottomRight*: string
  horizontal*, vertical*: string
Glyphs used for the corners, joins, rules, and vertical borders.
TableTheme = object
  borders*: BorderSet
  showTop*, showBottom*: bool
  showOuterVertical*, showColumnSeparators*: bool
  showHeaderSeparator*, showRowSeparators*: bool
Border glyphs and visibility rules for a table.

Consts

asciiTheme = (borders: (topLeft: "+", topJoin: "+", topRight: "+",
                        middleLeft: "+", middleJoin: "+", middleRight: "+",
                        bottomLeft: "+", bottomJoin: "+", bottomRight: "+",
                        horizontal: "-", vertical: "|"), showTop: true,
              showBottom: true, showOuterVertical: true,
              showColumnSeparators: true, showHeaderSeparator: true,
              showRowSeparators: true)
Portable borders using only ASCII characters.
borderlessTheme = (borders: (topLeft: "", topJoin: "", topRight: "",
                             middleLeft: "", middleJoin: "", middleRight: "",
                             bottomLeft: "", bottomJoin: "", bottomRight: "",
                             horizontal: "", vertical: ""), showTop: false,
                   showBottom: false, showOuterVertical: false,
                   showColumnSeparators: false, showHeaderSeparator: false,
                   showRowSeparators: false)
Removes every border; cell padding still separates content.
markdownTheme = (borders: (topLeft: "|", topJoin: "|", topRight: "|",
                           middleLeft: "|", middleJoin: "|", middleRight: "|",
                           bottomLeft: "|", bottomJoin: "|", bottomRight: "|",
                           horizontal: "-", vertical: "|"), showTop: false,
                 showBottom: false, showOuterVertical: true,
                 showColumnSeparators: true, showHeaderSeparator: true,
                 showRowSeparators: false)
Markdown-compatible pipes and a header delimiter.
modernTheme = (borders: (topLeft: "┌", topJoin: "┬", topRight: "┐",
                         middleLeft: "├", middleJoin: "┼",
                         middleRight: "┤", bottomLeft: "└",
                         bottomJoin: "┴", bottomRight: "┘",
                         horizontal: "─", vertical: "│"), showTop: true,
               showBottom: true, showOuterVertical: true,
               showColumnSeparators: true, showHeaderSeparator: true,
               showRowSeparators: true)
Square Unicode box-drawing borders.
psqlTheme = (borders: (topLeft: "", topJoin: "+", topRight: "", middleLeft: "",
                       middleJoin: "+", middleRight: "", bottomLeft: "",
                       bottomJoin: "+", bottomRight: "", horizontal: "-",
                       vertical: "|"), showTop: false, showBottom: false,
             showOuterVertical: false, showColumnSeparators: true,
             showHeaderSeparator: true, showRowSeparators: false)
PostgreSQL-style output with a header rule and no outer border.
roundedTheme = (borders: (topLeft: "╭", topJoin: "┬", topRight: "╮",
                          middleLeft: "├", middleJoin: "┼",
                          middleRight: "┤", bottomLeft: "╰",
                          bottomJoin: "┴", bottomRight: "╯",
                          horizontal: "─", vertical: "│"), showTop: true,
                showBottom: true, showOuterVertical: true,
                showColumnSeparators: true, showHeaderSeparator: true,
                showRowSeparators: true)
Rounded Unicode outer corners.

Procs

proc customTheme(borders: BorderSet; showTop = true; showBottom = true;
                 showOuterVertical = true; showColumnSeparators = true;
                 showHeaderSeparator = true; showRowSeparators = false): TableTheme {.
    ...raises: [], tags: [], forbids: [].}
Creates a theme from caller-provided border glyphs.