Skip to content

Simply include html partials via html (css, js) comments like this: <!-- partials/header.html -->

License

Notifications You must be signed in to change notification settings

badabam/html-include-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-include-comment

Simply include text partials via html (css/js) comments like this <!-- header.html -->

Install

$ npm install html-include-comment

Run

$ html-include-comment some/source.html some/dest.html

Usage

In your sourcefile add html, css or js comments to render the specified file content inline. The comments are getting replaced with the file contents.

<html>
  <head>
    <style>
      /* some/inline.css */
    </style>
  </head>
  <body>
    <!-- partials/header.html -->
    <!-- some/inline.svg -->
    <script>
      /* some/inline.js */
    </script>
  </body>
</html>

It works with both comment styles:

<!-- some/file.html -->

and

/* some/otherfile.css */

File type or extension does not matter (so it could be /* foo/bar.baz */ as well – as long as the file contains text content.

About

Simply include html partials via html (css, js) comments like this: <!-- partials/header.html -->

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published