.TH "BATPIPE" 1 .SH NAME batpipe - A \fR\fIless\fR (and \fR\fIbat\fR) preprocessor for viewing more types of files in the terminal. .SH DESCRIPTION .SH "USAGE" .P Like lesspipe, \fR\fIbatpipe\fR is designed to work with programs that support preprocessing with the \fR\fILESSOPEN\fR environment variable. Setting up \fR\fIbatpipe\fR will depend on your shell: .P \fR\fBBash:\fR .P eval "$(batpipe)" .P \fR\fBFish:\fR .P eval (batpipe) .SH "ENVIRONMENT" .TS tab(|) box; | cB | cB | | _ | _ | | l0 |1 l |. Variable | Description | .SP \fR\fIBATPIPE_TERM_WIDTH\fR | Sets the terminal width provided to \fR\fIbat\fR. If this variable starts with a hyphen (\fR\fI-\fR), the number provided will be relative to the detected terminal size. .TE .SH "BUILT-IN VIEWERS" .TS tab(|) box; | cB | cB | | _ | _ | | l0 |1 l |. Files | Program | .SP Directories | \fR\fIeza\fR, \fR\fIls\fR \fR\fI\fR\fI\fI.tar\fR\fI, \fR\fI\fI\fR\fI.tar.gz\fR | \fR\fItar\fR \fR\fI\fR\fI\fI.zip\fR\fI, \fR\fI\fI\fR\fI.jar\fR | \fR\fIunzip\fR \fR\fI\fR\fI\fI.gz\fR\fI | \fR\fI\fIgunzip\fR\fI \fR\fI\fR\fI\fI.xz\fR\fI | \fR\fI\fIxz\fR\fI .TE .SH "EXTERNAL VIEWERS" .P For file formats that aren't supported by default, an external file viewer can be added to \fR\fIbatpipe\fR through the external viewer API. .P External viewers are be added to batpipe by creating bash scripts inside the \fR\fI~/.config/batpipe/viewers.d/\fR directory. .SS "Creating Viewers" .P Viewers must define two functions and append the viewer's name to the \fR\fI$BATPIPE_VIEWERS\fR array. .P - \fR\fIviewer_${viewer}_supports [file_basename] [file_path] [inner_file_path]\fR .br - \fR\fIviewer_${viewer}_process [file_path] [inner_file_path]\fR .P The \fR\fIviewer_${viewer}_supports\fR function is called to determine if the external viewer is capable of viewing the provided file. If this function returns successfully, the corresponding \fR\fIprocess\fR function will be called. .SS "API" .P $BATPIPE_VIEWERS -- An array of loaded file viewers. .br $BATPIPE_ENABLE_COLOR -- Whether color is supported. (\fR\fItrue\fR|\fR\fIfalse\fR) .br $BATPIPE_INSIDE_LESS -- Whether batpipe is inside less. (\fR\fItrue\fR|\fR\fIfalse\fR) .P batpipe_header [pattern] [...] -- Print a viewer header line. .br batpipe_subheader [pattern] [...] -- Print a viewer subheader line. .P strip_trailing_slashes [path] -- Strips trailing slashes from a path. .SH "CAVEATS" .P - By default, \fR\fIbatpipe\fR will not use colors when previewed inside \fR\fIless\fR. .br Colors must be explicitly enabled with \fR\fIBATPIPE=color\fR.