CONTENTS

Introduction

Language definition files define the syntax of language elements. Colour themes define how these language elements should be formatted in the final highlighted document.

Highlight theme files are Lua files that can handle formatting for various output formats, including HTML. While Highlight themes support basic formatting (Colour, Bold, Italic, and Underline), when targeting HTML output you might desire finer control over styling, especially when working in a website, and thus opt to define your custom CSS themes — or use Sass, Less, Stylus, or some other language for compiling CSS.

Notes on Highlight HTML Output

Highlight’s default behaviour for HTML output is to enclose the code block within a preformatted block with class hl (<pre class="hl">), and then enclose all the various language elements within <span> tags with the hl class along the element’s corresponding class.

NOTE: Highlight doesn’t nest <span> tags in its output! Before a new tag is opened, the previous one is always closed.

These boilerplates are useful because they contain all the classes covering Highlight language elements, with comments remind their Lua counterparts names. By using a boilerplate, you’ll be reminded to cover all syntax elements, without the need to lookup any tables.

There is also an example HTML document showing how the CSS boilerplate looks like: