Skip to content

Instantly share code, notes, and snippets.

@trescenzi
Last active March 14, 2019 20:48
Show Gist options
  • Save trescenzi/5a4ff903165488e4b06a968ce2bf1ed8 to your computer and use it in GitHub Desktop.
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.
# 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
@trescenzi
Copy link
Author

EX: ./jade_to_html.sh app/components/sign-in/sign-in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment