A `less` (and `bat`) preprocessor for viewing more types of files in the terminal.
## Usage
Like [lesspipe](https://github.com/wofr06/lesspipe), `batpipe` is designed to work with programs that support preprocessing with the `LESSOPEN` environment variable. Setting up `batpipe` will depend on your shell:
| `BATPIPE_TERM_WIDTH` | Sets the terminal width provided to `bat`. If this variable starts with a hyphen (`-`), the number provided will be relative to the detected terminal size. |
The `viewer_${viewer}_supports` function is called to determine if the external viewer is capable of viewing the provided file. If this function returns successfully, the corresponding `process` function will be called.
### API
$BATPIPE_VIEWERS -- An array of loaded file viewers.
$BATPIPE_ENABLE_COLOR -- Whether color is supported. (`true`|`false`)
$BATPIPE_INSIDE_LESS -- Whether batpipe is inside less. (`true`|`false`)
batpipe_header [pattern] [...] -- Print a viewer header line.
batpipe_subheader [pattern] [...] -- Print a viewer subheader line.