Documentation
¶
Overview ¶
Command rubric is a cat(1) clone with wings — a Go port of bat with syntax highlighting, git integration, line numbers, paging and more.
This root entry point exists so `go install goforge.dev/rubric@latest` works. The canonical project lives under projects/rubric (goforge Polylith layout); both share the same bases/cli entry point.
Directories
¶
| Path | Synopsis |
|---|---|
|
bases
|
|
|
cli
Package cli is rubric's entry-point layer.
|
Package cli is rubric's entry-point layer. |
|
components
|
|
|
assets
Package assets wraps the chroma syntax-highlighting engine to provide bat's asset layer: lexer (syntax) detection by language name, file name and content; theme (style) lookup with bat-compatible theme-name aliases; and the per-line styled-segment output the printer consumes.
|
Package assets wraps the chroma syntax-highlighting engine to provide bat's asset layer: lexer (syntax) detection by language name, file name and content; theme (style) lookup with bat-compatible theme-name aliases; and the per-line styled-segment output the printer consumes. |
|
config
Package config ports bat's config module: the central Config struct plus the option enums (paging, wrapping, non-printable notation, binary behavior, strip-ansi, visible lines) and the SyntaxMapping used to override language detection by glob.
|
Package config ports bat's config module: the central Config struct plus the option enums (paging, wrapping, non-printable notation, binary behavior, strip-ansi, visible lines) and the SyntaxMapping used to override language detection by glob. |
|
controller
Package controller ports bat's controller module: it drives the whole pipeline for each input — open and buffer it, detect the syntax (honoring language overrides, syntax mappings and ignored suffixes), highlight it, gather git changes, then walk the lines emitting headers, snip separators, highlighted content and footers through the printer.
|
Package controller ports bat's controller module: it drives the whole pipeline for each input — open and buffer it, detect the syntax (honoring language overrides, syntax mappings and ignored suffixes), highlight it, gather git changes, then walk the lines emitting headers, snip separators, highlighted content and footers through the printer. |
|
decorations
Package decorations ports bat's decorations module: the gutter elements drawn to the left of each line (line numbers, git change markers, grid border).
|
Package decorations ports bat's decorations module: the gutter elements drawn to the left of each line (line numbers, git change markers, grid border). |
|
gitdiff
Package gitdiff ports bat's diff module: it computes per-line modifications (added / removed / modified) between a file's working-tree state and the git index, so the printer can draw change markers in the gutter.
|
Package gitdiff ports bat's diff module: it computes per-line modifications (added / removed / modified) between a file's working-tree state and the git index, so the printer can draw change markers in the gutter. |
|
inputsrc
Package input ports bat's input module: the description of an input source (an ordinary file, standard input, or in-memory bytes), how it is opened for reading, and the display name / size metadata the printer needs for headers.
|
Package input ports bat's input module: the description of an input source (an ordinary file, standard input, or in-memory bytes), how it is opened for reading, and the display name / size metadata the printer needs for headers. |
|
linerange
Package linerange ports bat's line_range module: parsing of "N", "N:M", "N:", ":M", "N:+K", "N:-K", "N::C", "N:M:C" and end-relative ":-K"/"K:" offsets, plus the LineRanges / HighlightedLineRanges containers used to decide which lines are visible or highlighted.
|
Package linerange ports bat's line_range module: parsing of "N", "N:M", "N:", ":M", "N:+K", "N:-K", "N::C", "N:M:C" and end-relative ":-K"/"K:" offsets, plus the LineRanges / HighlightedLineRanges containers used to decide which lines are visible or highlighted. |
|
pager
Package output ports bat's output module: it decides whether to write to stdout directly or through a pager (less by default), builds the correct less arguments, and exposes a single io.Writer plus Close that waits for the pager to exit.
|
Package output ports bat's output module: it decides whether to write to stdout directly or through a pager (less by default), builds the correct less arguments, and exposes a single io.Writer plus Close that waits for the pager to exit. |
|
printer
Package printer ports bat's printer module.
|
Package printer ports bat's printer module. |
|
style
Package style ports bat's style module: the StyleComponent enum, the StyleComponents set queried by the printer, and the StyleComponentList parser that understands override / "+add" / "-remove" semantics.
|
Package style ports bat's style module: the StyleComponent enum, the StyleComponents set queried by the printer, and the StyleComponentList parser that understands override / "+add" / "-remove" semantics. |
|
termdetect
Package terminfo detects terminal properties bat relies on: whether stdout/ stdin are interactive ttys, the terminal width, true-color support and whether color output should be enabled at all.
|
Package terminfo detects terminal properties bat relies on: whether stdout/ stdin are interactive ttys, the terminal width, true-color support and whether color output should be enabled at all. |
|
Package development wires every brick into one place for IDE and REPL use.
|
Package development wires every brick into one place for IDE and REPL use. |
|
projects
|
|
|
rubric
command
Command rubric is a cat(1) clone with wings — a Go port of bat with syntax highlighting, git integration, line numbers, paging and more.
|
Command rubric is a cat(1) clone with wings — a Go port of bat with syntax highlighting, git integration, line numbers, paging and more. |
Click to show internal directories.
Click to hide internal directories.