0.0.1 • Published 9 years ago

pc__replace_id_in_html v0.0.1

Weekly downloads
5
License
-
Repository
github
Last release
9 years ago

Replace id in HTML

This is plugin for nmp-package "Post-Compression".
He`s searching and replaces long attribute value "id" on short value, in the HTML code.

An example of using:

var replaceIdInHTML = require("pc__replace_id_in_html");

gulp.src("./*.html")
    .pipe(postCompression.replace([
        replaceIdInHTML()
    ], shortNames));  

Where:

  • shortNames - an object of type JSON with rules replace the long words to short words.

An example of the JSON object "shortNames":

{
    "id_in_html": {      // the name of the group names
        "someIdA": "a",     // long name: short name
        "someIdB": "b"
    }
}

An example of HTML code before:

<p id="someIdA"></p>
<p id="someIdB"></p>

An example of HTML code after:

<p id="a"></p>
<p id="b"></p>