Crates.io | htmli |
lib.rs | htmli |
version | 0.1.3 |
source | src |
created_at | 2017-04-19 03:29:38.909112 |
updated_at | 2017-08-02 14:52:22.704919 |
description | Statically resolved include directives for HTML. |
homepage | |
repository | https://github.com/nathansizemore/htmli |
max_upload_size | |
id | 11138 |
size | 25,232 |
Statically resolved include directives for HTML.
htmli allows you to break up your HTML pages into smaller modules. You simply place a special include element:
<include src="dir/file.html" />
where you'd like the contents of dir/file.html
to live, give htmli the path
of the HTML page, and file to write, and you're done.
Include elements are resolved relative to the entry file. So if you have the following directory structure:
www/
include/
btn-menu.html
nav.html
main.html
And the following HTML
<!-- main.html -->
<!doctype html>
<html>
<head></head>
<body>
<include src="include/nav.html" />
</body>
</html>
<!-- include/btn-menu.html -->
<div id="btn-menu" class="btn">Push Me</div>
<!-- include/nav.html -->
<div class="nav">
<include src="include/menu-btn.html" />
</div>
htmli will first grab main.html
, insert include/nav.html
, and when it comes
across the include directive for include/btn-menu.html
, it will resolve the
path from the directory main.html
is currently in.
htmli - Utility to statically resolve html-include directives.
Usage:
htmli <file> [--minify] [--output=<f>]
htmli (-h | --help)
htmli --version
Options:
-m --minify Minifies output.
-o --output=<f> Direct output to file.
-h --help Show this screen.
--version Show version.
First, install Rust.
$ cargo install htmli
$ git clone https://github.com/nathansizemore/htmli
$ cd htmli
$ cargo install
Nathan Sizemore, nathanrsizemore@gmail.com
htmli is available under the MPL-2.0 license. See the LICENSE file for more info.