kittkat.xyz

HTCompile

About Install Manual Github PyPi

About

HTCompile has compile-time imports to prevent the need to rewrite a page header every on every single page. Instead, just import it at compile-time! For an example, look at the source code for this website.

Install

Requirements

Manual

PIP - Recommended

User Manual

Basics

Once the program is installed, the program can be run with htcompile SOURCER DESTINATION to compile your website. SOURCE is the source folder of the HTML and DESTINATION is the folder to output the compiled HTML.
The recommended file structure is:


|--projectdir/
|  |--src/
|  |  |--index.html
|  |  |--page-a/
|  |  |  |--index.html
|  |  |  |--another.html
|  |  |--page-b/
|  |     |--index.html
|  |--dst/
|  |  |--(this is where the compiled files will go)
				
Then running the the program inside projectdir would look like this:
$ htcompile ./src ./dst
The generated files will be placed in ./dst
To utilize htcompile in your HTML, add a <htcompile src="/PATH/TO/FILE/> Make note that starting the path with "/" starts at the path provided as SOURCE to htcompile. IE in the file structure above using htcompile ./src ./dst "/" would represent "src/". To import page-b into page-a you would use <htcompile src="/page-b/index.html">. On the other hand, "./" is treated as relative to the files location, so to import another.html into page-a/index.html you could either use <htcompile src="/page-a/another.html"> or <htcompile src="./another.html"> If you wanted to inport another.html into page-b/index.html you would use <htcompile src="/page-a/another.html">