examples/

directory
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: Apache-2.0

README

Example Index

Each runnable example directory in this tree has:

  • a focused main.go
  • tests for the runnable entrypoint
  • a local README.md
  • a matching VHS GIF under ../docs/vhs/

Aggregate

  • all: full guided walkthrough GIF: demo.gif Run: go run ./examples/all --format human --style always

Structured Primitives

  • section: document headings and section-owned indentation GIF: section.gif Run: go run ./examples/section --format human --style always
  • notice: semantic user-facing notices GIF: notice.gif Run: go run ./examples/notice --format human --style always
  • record: one object rendered as labeled facts GIF: record.gif Run: go run ./examples/record --format human --style always
  • kv: compact aligned key-value output GIF: kv.gif Run: go run ./examples/kv --format human --style always
  • list: grouped list items with optional badges and detail fields GIF: list.gif Run: go run ./examples/list --format human --style always
  • table: aligned comparison output plus width adaptation GIF: table.gif Run: go run ./examples/table --format human --style always
  • panel: framed callouts and rationale blocks GIF: panel.gif Run: go run ./examples/panel --format human --style always
  • paragraph: long-form explanatory text GIF: paragraph.gif Run: go run ./examples/paragraph --format human --style always
  • statusline: one compact semantic status row GIF: statusline.gif Run: go run ./examples/statusline --format human --style always
  • spinner: transient progress indicator with stable fallbacks GIF: spinner.gif Run: go run ./examples/spinner --format human --style always

Rich Text And Progress

  • markdown: terminal-rendered Markdown via Glamour GIF: markdown.gif Run: go run ./examples/markdown --format human --style always
  • codeblock: framed code snippets with width-aware rendering GIF: codeblock.gif Run: go run ./examples/codeblock --format human --style always
  • logblock: framed caller-provided log excerpts GIF: logblock.gif Run: go run ./examples/logblock --format human --style always

Specialized Packages

  • gotestout: focused go test -json rendering example GIF: gotestout.gif Run: go run ./examples/gotestout --format human --style always
  • magecheck: Mage-style task-runner integration with gotestout GIF: magecheck.gif Run: go run ./examples/magecheck --format human --style always

Width Inspection

These are the best commands for checking the framed primitives before regenerating VHS assets. The things to verify are:

  • default framed blocks shrink toward content width instead of forcing full width
  • the rendered block still respects the current terminal width
  • an explicit MaxWidth wins when it is set
  • never and truncate currently render the same way on purpose
COLUMNS=96 go run ./examples/table --format human --style always --content long --wrap-mode auto
COLUMNS=72 go run ./examples/table --format human --style always --content long --wrap-mode auto
COLUMNS=56 go run ./examples/table --format human --style always --content long --wrap-mode auto
COLUMNS=48 go run ./examples/table --format human --style always --content long --max-width 48 --wrap-mode truncate

COLUMNS=72 go run ./examples/panel --format human --style always --content long --max-width 48 --wrap-mode auto
COLUMNS=72 go run ./examples/codeblock --format human --style always --content long --max-width 48 --wrap-mode truncate
COLUMNS=72 go run ./examples/logblock --format human --style always --content long --max-width 48 --wrap-mode never

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL