Skip to main content

Module bat

Module bat 

Source
Expand description

bat renderer — emits a base16 Sublime-Text .tmTheme (XML plist) that bat (the cat clone) consumes as a custom theme.

This is the FIRST per-app config-file renderer in ishou (every prior target emits a palette, a token dump, or a scheme YAML). It is the M0 proof that ishou can natively emit a per-app config file, toward ishou replacing stylix as the fleet theming engine: instead of stylix generating the bat theme from its base16 scheme, ishou renders the .tmTheme directly from the same typed TokenSet the base16 scheme comes from.

Output format: a Sublime-Text .tmTheme property list (the format programs.bat.themes.<name>.src / bat’s ~/.config/bat/themes/*.tmTheme consume). bat parses it with syntect; the format is a <plist> whose settings array holds one global-settings dict followed by one dict per scope-selector rule.

§base16 → .tmTheme mapping

The mapping follows the canonical base16 .tmTheme template used by tinted-theming/base16-textmate (the same slot roles the base16 bat/base16-stylix theme uses), so this render displaces that generated theme byte-role-for-byte:

tmTheme settingbase16 slotishou colourrole
backgroundbase00polar_night_0default background
foreground/caretbase05snow_storm_1default foreground
invisiblesbase03polar_night_3comments
lineHighlightbase01polar_night_1line highlight
selectionbase02polar_night_2selection bg
gutterForegroundbase03polar_night_3gutter fg
Commentbase03polar_night_3
Variables / deletedbase08aurora_red
Integers / constantsbase09aurora_orange
Classes / boldbase0Aaurora_yellow
Strings / insertedbase0Baurora_green
Escapes / regexbase0Cfrost_1
Functions / headingsbase0Dfrost_2
Keywords / italicbase0Eaurora_purple
Embedded / deprecatedbase0Ffrost_3

Hex values are #RRGGBB (upper-case-insensitive; we emit lowercase), with a leading # — the tmTheme plist requires the # prefix (unlike stylix base16 YAML, which forbids it).

Functions§

render
Render the base16 .tmTheme bat consumes.