Skip to content

Console Provider

Hooks that print things to the console like tables and markdown via [rich] or print.

Hooks

Type Description Return
markdown Hook for printing markdown and returning the output. None
markdown_frontmatter Hook for reading frontmatter from a Markdown file. Optional[dict]
pprint Wraps python pprint builtin.Link NoneType
print Hook for printing an input and returning the output.Link NoneType
table Hook for creating tables with rich - github.com/willmcgugan/rich. None

Requirements

  • rich

Examples

print

Print to console

compact->: print stuff and things

Print to console

stuff:
  and: things
compact->: pprint "{{ stuff }}"

markdown

Print markdown to console

compact->: |
  markdown "# A title"
  Section with things
expanded:
  ->: markdown
  text: |
    # Another title
    More sections with things
╔══════════════════════════════════════════════════════════════════════╗ ║ A title ║ ╚══════════════════════════════════════════════════════════════════════╝ Section with things ╔══════════════════════════════════════════════════════════════════════╗ ║ Another title ║ ╚══════════════════════════════════════════════════════════════════════╝ More sections with things

table

Print a table to the console

column_names:
  - stuff
  - things

data:
  - [ 'foo', 'bar' ]
  - [ 'here', 1 ]

table:
  ->: table
  column_names: "{{ column_names }}"
  contents: "{{ data }}"
┏━━━━━━━┳━━━━━━━━┓ ┃ stuff ┃ things ┃ ┡━━━━━━━╇━━━━━━━━┩ │ foo │ bar │ │ here │ 1 │ └───────┴────────┘