0.1.3 • Published 8 years ago

html-importer v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

HTML-Importer

Build HTML-file out of different HTML-snippets.

travis build version coverage issues

Install

Run in your project directory.

npm install --save-dev html-importer

Usage

Create index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Test html-importer</title>
</head>
<body>
  <!-- import: html/header.html -->
  <!-- import: html/main.html -->
  <!-- import: html/footer.html -->
</body>
</html>

Create html/header.html

<header>
  This is the header!
</header>

Create html/main.html

<main>
  This is main!
</main>

Create html/footer.html

<footer>
  This is the footer.
</footer>

Make sure imported files exist. The path is relative to your project root-directory.

Create index.js

import htmlImporter from 'html-importer';

const parsedHtml = htmlImporter.parseHtml('index.html');

parsedHtml should now include

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Test html-importer</title>
</head>
<body>
  <header>
    This is the header!
  </header>
  <main>
    This is main!
  </main>
  <footer>
    This is the footer.
  </footer>
</body>
</html>

Notes

Since this is my first real live tool I would be really happy about any feedback. So please feel free to create an issue if you have any notes about features or code.
Thanks in advance.

License

HTML-Importer is released under the MIT License. See LICENSE file for details.

Links

tbd

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.0

8 years ago