This plugin allows you easy compile Pug files to HTML with options.
Atom Package: https://atom.io/packages/pug-autocompile
From Atom: Settings ➔ Install ➔ Search for pug-autocompile
You can also install this plugin via command line:
$ apm install pug-autocompile
Compile from Selection
Options Line
Plugin Settings
Windows / Linux
Ctrl+ Shift+ C
then D
to compile from current selectionCtrl+ Shift+ C
then F
to compile current filemacOS
Cmd+ Shift+ C
then D
to compile from current selectionCmd+ Shift+ C
then F
to compile current fileAdd the parameters on the first line of your Pug file.
Your output file will be minified (default behaviour).
Always start line with comment //
and separate options by comma ,
.
out: path/to/output.html
— path to your rendered HTML-filemain: path/to/main.pug
— path to your main / parent Pug-file to be compiledpretty: true
— make your HTML prettycompress: false
— make your HTML prettyindex.pug
// out: build/index.html, pretty: true
doctype html
html
include includes/head.pug
body
h1 Hello from Pug :)
includes/head.pug
// main: ../index.pug
head
title Pug Autocompile plugin for Atom
link(href='/assets/css/main.css')
build/index.html
<!DOCTYPE html><html><head><title>Pug Autocompile plugin for Atom</title><link href="/assets/css/main.css"></head><body><h1>Hello from Pug :)</h1></body></html>
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.