This guide explains how to install and use Glow, a terminal-based markdown viewer, with Hataraku to enhance the readability of Hataraku's output.
Glow is a terminal-based markdown renderer that makes reading markdown files in the terminal a pleasant experience. It supports styling, code highlighting, and other markdown features, making it perfect for viewing Hataraku's markdown-formatted output.
Using Homebrew:
brew install glow
sudo apt-get update
sudo apt-get install glow
sudo pacman -S glow
sudo snap install glow
Using Scoop:
scoop install glow
Using Chocolatey:
choco install glow
If you have Go installed:
go install github.com/charmbracelet/glow@latest
Add the following to your shell configuration file (.bashrc
, .zshrc
, etc.):
# Simple alias to pipe hataraku output to glow
alias hg="hataraku | glow -"
A function provides more flexibility, allowing you to pass arguments to Hataraku:
# Function to pipe hataraku output to glow
hd() {
hataraku "$@" | glow -
}
This function is already set up in your .zshrc
file:
alias h="hataraku"
hd () (h "$@" | glow -)
# Using the alias
hg task run hello-world
# Using the function
hd task run hello-world
# Pass arguments to Hataraku
hd task run hello-world --input '{"name": "World"}'
If you want to customize Glow's behavior, you can modify the function:
# Function with custom Glow options
hd_custom() {
hataraku "$@" | glow -p -w 80 -
}
Options:
-p
: Enable paging-w 80
: Set width to 80 characters-s dark
: Use dark style (orlight
)
You can customize Glow's appearance by creating a config file:
mkdir -p ~/.config/glow
touch ~/.config/glow/glow.yml
Example configuration:
# ~/.config/glow/glow.yml
style: dark
pager: true
width: 80
If you get a "command not found" error:
- Make sure Glow is installed correctly
- Check that the installation directory is in your PATH
- Try reinstalling using one of the methods above
If the output doesn't look right:
- Make sure Hataraku is producing valid markdown
- Try different Glow styling options
- Check terminal compatibility (some terminals support more features than others)