htmli

Crates.iohtmli
lib.rshtmli
version0.1.3
sourcesrc
created_at2017-04-19 03:29:38.909112
updated_at2017-08-02 14:52:22.704919
descriptionStatically resolved include directives for HTML.
homepage
repositoryhttps://github.com/nathansizemore/htmli
max_upload_size
id11138
size25,232
Nathan Sizemore (nathansizemore)

documentation

README

htmli

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.

Usage

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.

Installation

First, install Rust.

Crates.io
$ cargo install htmli
Source
$ git clone https://github.com/nathansizemore/htmli
$ cd htmli
$ cargo install

Author

Nathan Sizemore, nathanrsizemore@gmail.com

License

htmli is available under the MPL-2.0 license. See the LICENSE file for more info.

Commit count: 16

cargo fmt