Skip to content

Instantly share code, notes, and snippets.

@henrycunh
Last active March 1, 2019 23:05
Show Gist options
  • Save henrycunh/9a5fea124ff83186de3e427b9a9d37ea to your computer and use it in GitHub Desktop.
Save henrycunh/9a5fea124ff83186de3e427b9a9d37ea to your computer and use it in GitHub Desktop.
Converting from Pug to HTML in one line

Requirements

  • pug
  • xsel
  • clip
  • node

You can install on debian based distros by running sudo apt-get install xsel xclip; sudo npm i pug -g

Using

Select and copy the Pug code, run the script below

xsel -b > temp.pug; pug temp.pug --pretty; cat temp.html | xclip -sel clip; rm temp.html temp.pug;

Then paste, it will be in HTML.

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