What is HPP?
HPP stands for ‘HTML Pre-Processing’, is a command line tool for HTML Pre-Processing, especially for UI prototyping.
How to Use It?
Requirements
Ruby 1.9.3-p194
Installation
gem install hpp
Usage
Go to the directory where the original HTML file folder sits.
project |-src |-x.html |-_y.html |-css |-main.css |-js |-site.js
Assume x.html includes y.html, such as the directive <!—#include file=’y.html’—>
Invoking the command under project directory, just like bellow
project> hpp process src target
It will create another folder ‘target’, and ‘tree target’ will return:
project |-src |-x.html |-_y.html |-css |-main.css |-js |-site.js |-target |-x.html |-css |-main.css |-js |-site.js
Note: the content of _y.html will be included into x.html at the place where the above directive is.
Command Options
hpp process [source folder] [target folder] [—daemon]
- If [source folder] not specified, the ‘src’ folder will be assumed by default. If there doesn’t exist the expected [source folder], RuntimeError will be raised.
- If [target folder] not specified, the ‘target’ folder will be assumed by default. If there doesn’t exist the expected [target folder], the folder will be created.
- If [—daemon] specified, it will invoke a process listening to the changes in [source folder], and process the whole [source folder] immediately once the changes detected, so that you don’t need to invoke the command again and again. This is available since version 0.1.2