pug-autocompile

Compile Pug files to HTML


Keywords
atom, atom-package, atom-plugin, autocompile, html, pug, template
License
MIT
Install
apm install pug-autocompile@0.1.0

Documentation

Pug Autocompile plugin for Atom

apm Deps Travis AppVeyor

GitHub tag GitHub stars GitHub issues

License

This plugin allows you easy compile Pug files to HTML with options.

Atom Package: https://atom.io/packages/pug-autocompile

Installation

From Atom: Settings ➔ Install ➔ Search for pug-autocompile

You can also install this plugin via command line:

$ apm install pug-autocompile

Usage

Compile from Selection

gif

Options Line

gif

Plugin Settings

gif

Keymaps

Windows / Linux

  • Push Ctrl+ Shift+ C then D to compile from current selection
  • Push Ctrl+ Shift+ C then F to compile current file

macOS

  • Push Cmd+ Shift+ C then D to compile from current selection
  • Push Cmd+ Shift+ C then F to compile current file

Options

Add 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-file
  • main: path/to/main.pug — path to your main / parent Pug-file to be compiled
  • pretty: true — make your HTML pretty
  • compress: false — make your HTML pretty

Examples

index.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>