Prettify Code

Maizzle can pretty print your HTML email code.

Need to send HTML to a human? Enable prettify in your config:

// config.staging.js
module.exports = {
  prettify: {
    enabled: true,
  },
  // ...
}

By default, code will be indented with 2 spaces.

JS Beautify

pretty is used to format your code.

Under the hood, js-beautify is used, which means that you can use any of its CSS and HTML Beautifier options in your Maizzle pretty {} config object.

Maybe you prefer tabs for indentation?

// config.js
module.exports = {
  prettify: {
    enabled: true,
    indent_with_tabs: true,
    // ...
  },
  // ...
}

Checkout the full list of HTML & CSS beautifier options ↗

OCD

This option applies several formatting actions and is enabled by default in the Starter.

Specifically, it:

  • condenses multiple newlines to a single newline
  • trims leading and trailing whitespace
  • ensures that a trailing newline is inserted
  • normalizes whitespace before code comments