HTML to JadeJS/PugJS

Hello,

 

Is there a way to convert html files to pugjs?
I've got few html files which I want to edit in pug/jade.

Currently I am using an online tool to manually copy paste, but I'd like a built in way to do so(right click html file => create pugjs template or something around those lines)

 

Thanks in advance

0
3 comments

There is no such function in the IDE

You can install some offline converter (

npm i -g html-pug-converter

or

npm install -g html2pug

, for example) and then run it in terminal (https://github.com/izolate/html2pug#usage) or set it up as external tool in Settings | Tools | External Tools

 

1

Note that external tools don't support pipes/redirection (https://youtrack.jetbrains.com/issue/IDEABKL-6481), these are shell features.

So, if you like to set up the converter as an external tool, the easiest way to do this is creating a shell script that runs the command and then configure this script as external tool

1

Thanks for the reply, I will look into these :)

0

Please sign in to leave a comment.