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.

Get Programming Social Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.