Skip to content

Commit

Permalink
✨ feat: bat as fallback for HTML and JSON preview
Browse files Browse the repository at this point in the history
  • Loading branch information
j-lakeman committed Nov 4, 2024
1 parent eacdb68 commit 763ecd6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/preview_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,20 @@ handle_extension() {
lynx -dump -- "${FILE_PATH}" && exit 0
elinks -dump "${FILE_PATH}" && exit 0
pandoc -s -t markdown -- "${FILE_PATH}" && exit 0
bat --color=always --paging=never \
--style=plain \
--terminal-width="${PREVIEW_WIDTH}" \
"${FILE_PATH}" && exit 0
;;

## JSON
json | ipynb)
jq --color-output . "${FILE_PATH}" && exit 0
python -m json.tool -- "${FILE_PATH}" && exit 0
bat --color=always --paging=never \
--style=plain \
--terminal-width="${PREVIEW_WIDTH}" \
"${FILE_PATH}" && exit 0
;;

## Direct Stream Digital/Transfer (DSDIFF) and wavpack aren't detected
Expand Down

0 comments on commit 763ecd6

Please sign in to comment.