0.0.0 • Published 9 years ago

wrap-html v0.0.0

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

wrap-html

A lightweight command line utility to wrap html files in a common layout.

Install

npm install wrap-html

Use

Use the cli by passing in a directory of html files to process. Optionally pass in an output directory, and a template to use.

Recommended to use with npm scripts like so:

  "scripts": {
	"wrap-html": "wrap-html sourceDir -o buildDir -t templateFile.html"
  }

Then you can use npm run wrap-html to build everything.

Wraps html in another html file.
Usage: wrap-html [source dir] [options]

Options:
  -o, --output    Output directory
  -t, --template  template html file
  -d, --debug     log all files built
  -h, --help      Show help

Examples:
  wrap-html source -t template.html -o        wrap all files in ./source inside
  build                                       template.html and save them in
                                              the build folder

Templates

The template html file (the one that will be wrapped around all of the other files) needs to have {{ content }} in the file. For example, to wrap all the html files in a basic html skeleton, you could use:

<!DOCTYPE html>
  <head>
    <title>Layers</title>
  </head>
  <body>
    {{ content }}
  </body>
</html>

Note: the layout is assumed to be inside your source directory.

Defaults

optiondefault
source'source'
output'build'
template'layout.html'
debugfalse