Skip to content

Compiling CHTML Files

Damian Heaton edited this page Jan 16, 2017 · 3 revisions

About

Compound provides a simple compiler to do the actual task of transcluding the files, and to convert CHTML files to HTML. This compiler is run from the command line with Python 3.x (tested 3.5.2+).

Basic Syntax

The basic syntax of the compiler is
/Compound$ python(3) main.py <CHTML input file> [optional flags]
This will create a HTML file from the CHTML file, with the name based off the CHTML file (input of test.c.html will, by default, output to test.html).

The CHTML input file may also be replaced with a directory containing .c.html files. Be warned that this isn't really tested yet against folders containing other file types, and may screw things up in such a scenario. See Advanced Compiling.

Flag options

The following flags can be set on the compiler, which will affect the end result of the compilation.

--minify, -m

This will minify the output HTML, reducing the whitespace in the file. Note that script and style tags will not be minified, and this may mess up the file's HTML.

--no-comments, -c

This flag requires that the minify flag be set, else this flag will have no effect.

This flag will remove all HTML comments from the file (potentially further reducing the output file size)

--output <HTML output file name (including extension)>, -o <HTML output file name (including extension)>

This flag will set the output path and file name of the compiled HTML file.