Skip to content

Advanced Compiling

Damian Heaton edited this page Jan 16, 2017 · 1 revision

Compound is a fairly advanced compiler for its purposes, and supports the ability to separate the raw .c.html files from the compiled .html files.

Directory Structure

To do this particular compilation pattern, we advise a folder structure like so:

- Root Project Directory
| - raw
| - transcludes

With this structure, raw will contain your raw .c.html files, transcludes will contain the snippet documents that are to be transcluded into other HTML documents, and the compiled .html files would exist in the Root Project Directory. This particular setup works very well with GitHub Pages (and is similar to the setup used for scratso.github.io).

It's important to note that the transclude files are not placed into raw. This is because, in most cases, users will reference transclusions relatively as transcludes/file.html. Unfortunately, this format wouldn't work if nested within raw, as users would then need to reference raw/transcludes/file.html, as all relative paths operate from the folder from which the compile command was executed.

From this setup, to compile the raw folder (with no additional flags), we can simply run:
$ python(3) Compound.py ./raw -b .

(Remember to replace Compound.py with the path to your Compound compiler .py file.)

This command will compile the contents of the raw folder into the build directory of . - the current working directory.

Clone this wiki locally