Transform html to pug inside your Visual Studio Code, forget about using an external page anymore.
Powered by xhtml2pug
- Format selection.
- Multiple selections support.
- Keyboard shortcut: Ctrl + Alt + p / ⌘ Command + Alt + p
Install this extension from the VSCode Marketplace
- Select the html.
- Hit ⌘ Command + ⇧ Shift + p / Ctrl + ⇧ Shift + p
- Run
xHTML2Pug: Convert Vue to Pug
or Ctrl + Alt + p / ⌘ Command + Alt + p. - Run
xHTML2Pug: Convert HTML to Pug
.
Use the following to embed a shortcut in keybindings.json. Replace with your preferred key bindings.
{
"key": "ctrl+alt+p",
"command": "vscode-xhtml2pug.transformVue2Pug"
}
You can customize your shortcuts too under: File > Preferences > Keyboard Shortcuts. (Code > Preferences > Keyboard Shortcuts on macOS) Check key bindings docs.
This extension contributes the following settings:
xhtml2pug.indent
(default: 'spaces'): Indentxhtml2pug.numberOfSpaces
(default: 2): Number of spaces for indentsxhtml2pug.fragment
(default: true): Don't wrap into html > bodyxhtml2pug.commas
(default: false): Commas in attributesxhtml2pug.encode
(default: true): Encode html characters.xhtml2pug.doubleQuotes
(default: false): Use double quotes for attributesxhtml2pug.inlineCSS
(default: false): Place all classes in class attributexhtml2pug.classesAtEnd
(default: false): Place all classes after attributes