### Optional
-- [glow](https://repology.org/project/glow/packages) for rendering markdown in the terminal
+- [glow](https://repology.org/project/glow/packages) or [bat](https://repology.org/project/bat-cat/packages) for rendering markdown in the terminal
- [cabal](https://repology.org/project/cabal/packages) for compiling the helper program for creating configurations
## Configuration
#!/usr/bin/env sh
# shellcheck disable=SC2016
-USE_GLOW=true
-if ! command -v glow >/dev/null 2>/dev/null; then
- printf "Glow not found, markdown rendering not available.\n"
+USE_GLOW=false
+USE_BAT=false
+if command -v glow >/dev/null 2>/dev/null; then
+ USE_GLOW=true
+elif command -v bat >/dev/null 2>/dev/null; then
+ USE_BAT=true
+else
+ printf "Glow or bat not found, markdown rendering not available.\n"
printf "Output will be raw markdown and might look weird.\n"
- printf "Install glow for easier reading & copy-paste.\n"
- USE_GLOW=false
+ printf "Install glow or bat for easier reading & copy-paste.\n"
fi
unalias -a
HELP)
if $USE_GLOW; then
printf "%s" "$HELP" | glow -
+ elif $USE_BAT; then
+ printf "%s" "$HELP" | bat -pp -f --language markdown
else
printf "%s" "$HELP"
fi