Skip to content

Instantly share code, notes, and snippets.

@trescenzi
Created March 14, 2019 20:09
Show Gist options
  • Save trescenzi/0c1c35c359bea26025eacc21f2839ac9 to your computer and use it in GitHub Desktop.
Save trescenzi/0c1c35c359bea26025eacc21f2839ac9 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.
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 $1.html > $1.prettier.html
# move back to goal file
mv $1.prettier.html $1.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment