Writing criteria for this guide
Every "for Mere Mortals" guide is written to the same nine-point standard, so a reader who trusts one can trust the rest. Here it is, with the verification notes for this particular guide below.
- Fix it first. Reader outcomes lead, not action items: each chapter opens by naming the outcome it delivers, shows a check the reader can run to confirm they got it, and a reasonable reader finishes able to state what was done, what it means, and what to try next.
- Plain language. Short sentences, everyday vocabulary, technical terms defined on first use. No slang, and no idioms that only make sense in one country — the reader may be translating as they go.
- No dead ends. A guide never tells the reader to do something it cannot show them how to verify. Every claim a reader relies on — an install, a command, an output — is something this guide demonstrates or clearly labels documented-only below.
- Live-verified where it matters. Procedures are run for real in the guide's lab wherever the build machine allows it, and the transcripts kept in the repository are the evidence. What could not be run is listed honestly below, never presented as if it had been.
- General audiences. Nothing in this guide — examples, fixtures, names, addresses — is modelled on any particular reader or author's real life, network, or organisations. The lab's traffic is the lab talking to itself.
- Standalone. A reader needs this guide, its lab, and nothing else. Where another guide would genuinely help, it is pointed to once, by name, and the chapter still completes without it.
- Honest about limits. Chapter 13 names what the tool cannot do: detection that guesses from a name, an extension and a first line, and can be wrong in both directions; colours that are a theme's opinion and never evidence of meaning; highlighting that matches patterns without understanding, so unparseable code is coloured without complaint; binaries the decorated view labels but will not show; a change view blind to staged work, untracked files and deleted lines; and the decorated picture itself, which contaminates any file it is carelessly pasted into.
- The one rule is in the text, early. Chapter 1 and the README state the rule plainly — the decorated view is a picture of the file, not the file — before any procedure depends on it, and later chapters point back to it where the picture could be mistaken for the thing itself: copied off the screen into an editor, trusted as proof of what a file is, or screenshotted as if it were the bytes.
- Builds clean. The site builds with MkDocs in strict mode with no warnings, and a fresh reader following the chapters in order reaches the stated outcome of each.
Verification notes for this guide
The build machine is a 2-CPU, 7.7 GB Ubuntu 24.04 sandbox.
bat 0.26.1 was the project's official release binary for
Linux (bat-v0.26.1-x86_64-unknown-linux-gnu.tar.gz from the
sharkdp/bat GitHub releases), run from a scratch folder rather
than installed system-wide; less 590 and git 2.43.0 were the
companions. The fixtures are the lab's own, in
bat-lab/fixtures/; three small shell helpers —
render.sh (strips escape codes so decorated output can be
printed), pager-spy.sh (a pretend pager that records being
called and saves what it is handed), and pty-run.sh (runs a
command under a real terminal via script(1)) — are in
bat-lab/. All transcripts live in bat-lab/transcripts/.
To keep the machine's own settings out of the experiments,
every run except chapter 11's own was made with
XDG_CONFIG_HOME pointed at an empty folder in the lab; the
configuration chapter's transcripts show the lab paths that
result, and the chapter text says why.
Run for real, with transcripts as evidence:
- Version and the head of
--help; thelessandgitversions the lab relied on (t00). - The pipe rule: piped output byte-for-byte identical to the
file under
cmp, with matching byte counts (t01). The decorated view of a Python file, rendered and then taken apart escape by escape — the grey frame at colour 246, the header's bold name, the keyword/string colours on one code line (t01). Two files printed together, each with its own frame (t01). A missing file: the[bat error]message and exit code 1 (t01). - The pager, proved by substitution under a real terminal
(
script(1)): the pager spy was called and received 2,944 bytes of decorated output for a 271-byte file; in a pipe the spy never ran and plain text came out; on the terminal with--paging=neverthe spy never ran either (t02). The default pager beinglessis quoted from--helpin the same transcript. - Styles: plain, numbers, grid, header, header+grid and full
run one at a time on the same Rust file at a pinned width,
plus
-nproducing the numbers run exactly,bat -p, and the hand-built numbers+grid compared with full (t03). - One line range, two line ranges with the snip line between
them, and
--highlight-linewith its48;5;236background read out of the escapes (t04). Tabs: passed through as tabs in the plain style, expanded by--tabs=4, and already expanded in the framed view;--show-alldrawing tab guides and line-end marks (t04). - Languages: the full list counted (183) and the mapping
lines read for Python, Rust, TOML, Markdown, Separated
Values and Bourne Again Shell (t05); colour evidence that
detection landed for JavaScript, TOML, Markdown, and for a
shebang-only shell script (t05); standard input read with
--language python(frame labelled STDIN) and detected from a--file-nameinstead (t05). - The trap, at the byte level: a Python program with no
extension and no shebang, and CSV data with no extension,
both auto-detected as plain text — one solid colour run per
line — against the same lines fully coloured with
--languageforced; the rename fix (greetcopied togreet.py) restoring detection (t90). - Themes: all 28 listed; one line of code escape-read under
the default theme (identified as Monokai Extended by its
colour numbers matching the named run in t08), under
GitHub, and under
ansi, whose basic codes are visibly a different kind;BAT_THEME=GitHubreproducing the GitHub run without a flag (t06). - Git: a fixture repository built, committed, and edited by
a shipped script;
git diffas the baseline;bat --difffiltering to changed lines plus two lines of context,--diff-context=1tightening it; the~mark read as yellow (33) and the+mark as green (32) in the escapes; the snip line between change groups; then the two blind spots — the same edits staged withgit add, after which--diffprints nothing and exits 0, and an untracked file skipped in the same silence (t07). - Configuration:
--config-fileand--config-dir;--generate-config-fileand its all-comments skeleton; a two-line configuration (GitHub theme, numbers style) obeyed by the next run;BAT_STYLEoverriding the file's style for one run;--themeon the command line overriding the file's theme; and a--map-syntaxline in the configuration fixing the trap's stocktake file permanently (t08). - The limits exhibits: a syntactically broken Python file
highlighted without complaint, and a copied program binary
shown by the decorated view as
<BINARY>with no contents while its bytes pass through a pipe untouched (t91).
Documented only — described from the project's documentation
or --help text, not run, and the text does not claim
otherwise:
- The interactive
lesssession itself: a real pager session is driven by hand and leaves no record to check, so chapter 5 proves the handover by the pager spy's footprints instead. - The built-in
minuspager (--pager=builtin) and--paging=always, both named from the--helptext. - Automatic light/dark theme switching (
--theme-light,--theme-dark): the lab's terminal did not report a background for bat to switch on. - The package installation routes (apt — including the
batcatname on Debian and Ubuntu — dnf, Homebrew, winget and friends): the lab ran the release binary, and the project documents the wrappings. - Adding your own syntaxes and themes and rebuilding the
cache with
bat cache --build. --tabs=0passing tabs through directly, quoted from the--helptext; the neighbouring settings were run.- The comparison tools in chapter 12 are characterised, not benchmarked.
Fixtures are this guide's own and deliberately generic: a farewell script, two greeters, a settings file for an imaginary workshop app, packing notes, a stationery price list, and a shelf stocktake — plus the two disguised files that chapter 8 catches the detector on. No example is modelled on any real person, network, service or organisation.