Last active
March 14, 2019 20:48
-
-
Save trescenzi/5a4ff903165488e4b06a968ce2bf1ed8 to your computer and use it in GitHub Desktop.
A quick and dirty jade to html conversion script that leaves the file rather pretty and without any `&`s.
This file contains 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
# Make sure to `npm install -g pug prettier` first. | |
# Usage: ./jade_to_html.sh path/to/file/without/extension | |
pug $1.jade | |
# remove && escapes | |
sed -i.bak "s/&&/\&\&/g" $1.html | |
# remove extra whitespace | |
sed -i.bak -E "s/[[:space:]]+/ /g" $1.html | |
# prettify | |
prettier --write $1.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EX:
./jade_to_html.sh app/components/sign-in/sign-in