Last active
January 28, 2023 22:40
-
-
Save mttjohnson/c1d5e52d1b900d764711b32e5702c9f1 to your computer and use it in GitHub Desktop.
Colorize code files on shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Pygments (https://pygments.org/) | |
pip install Pygments | |
brew install pygments | |
# XML | |
cat myfile.xml | xmllint --format - | pygmentize -l xml | |
# JSON | |
cat myfile.json | jq . | pygmentize -l json | |
# YAML | |
cat myfile.yml | yq e '.' - | pygmentize -l yaml | |
# PHP | |
cat myfile.php | pygmentize -l php | |
# Markdown | |
cat myfile.md | pygmentize -l markdown | |
# JS | |
cat myfile.js | pygmentize -l js | |
# CSS | |
cat critical.css | pygmentize -l css | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment