O'Reilly logo

Programming Social Applications by Jonathan LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying the Cajoler Rendering Format

The cajoling script gives us the option to alter the cajoling output through a few rendering methods. In the following command, besides the input and output files that we have already talked about, you’ll see an -r option at the end. This option allows us to specify the rendering method that we want to use during the cajoling process:

bin/cajole_html -i <htmlInputFile> -o <outputTarget> -r <rendererOption>

There are a number of attributes that we can set as our renderOption, as listed in Table 8-1.

Table 8-1. renderOption attributes

Attribute

Description

minify

Specifies whether to return the cajoled code as a minified file or not. It is best to output the cajoled code as a minified block if you are planning on displaying it in a production environment.

pretty

This option is the cajoler’s default output. It will display the cajoled output in a human-readable format.

sidebyside

Displays the original source code in comments above the cajoled code. This is extremely helpful for identifying where in the final cajoled code base your original content was rewritten to.

debugger

Displays a series of debugging output at the bottom of the cajoled JavaScript file.

These rendering options will help you read and understand the code produced by the cajoling process.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required