Skip to main content

A static import compiler for HTML pages.

Project description

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

  • Python 3.9+

Manual

  • Make sure python 3.9+ is installed by running python --version
  • Clone the GitHub repo to a location on your system git clone https://github.com/KittKat7/htcompile.git
  • The program can now be run by using python PATH/TO/htcompile/main.py SOURCE DESTINATION
  • (Optional) Add an alias in your shell rc file (IE ~/.bashrc). alias 'htcompile'='python PATH/TO/htcompile/main.py This will allow simply running htcompile SOURCE DESTINATION

PIP - Recommended

  • Make sure python3 pip is installed for your system.
  • Run pip install htcompile
  • Make sure htcompile is installed by running htcompile --help

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">

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

htcompile-0.0.6.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

htcompile-0.0.6-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file htcompile-0.0.6.tar.gz.

File metadata

  • Download URL: htcompile-0.0.6.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for htcompile-0.0.6.tar.gz
Algorithm Hash digest
SHA256 83590dd1a13b6f9cc892b37df425189b79e3ecda05a249c3eeaa3981c7c1a564
MD5 705d13e6e8c5370c73faa66e0a5e27cb
BLAKE2b-256 d378c3a5cacbce9a30bf1b19045f11763100f2210c8a92868fc55ef310152f0c

See more details on using hashes here.

File details

Details for the file htcompile-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: htcompile-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for htcompile-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a0ad1c43c1f60d75c959572cdc83530359f94f4de8034be241d08c59744d8efe
MD5 dd0b9c4fd1b75a17171f8c6e244b0094
BLAKE2b-256 4545d155e5b3b2e5b1a9dc6010878edafff9fd36eaa5e47dfd8451ebaf01bac9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page