1.0.8 • Published 4 years ago

html-creator-angular v1.0.8

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Installation

yarn add html-creator

Usage

const htmlCreator = require('html-creator');

const html = new htmlCreator([
  {
    type: 'head',
    content: [{ type: 'title', content: 'Generated HTML' }]
  },
  {
    type: 'body',
    attributes: { style: 'padding: 1rem' },
    content: [
      {
        type: 'div',
        content: [
          {
            type: 'span',
            content: 'A Button Span Deluxe',
            attributes: { className: 'button' },
          },
          {
            type: 'a',
            content: 'Click here',
            attributes: { href: '/path-to-infinity', target: '_blank' },
          },
        ],
      },
    ],
  },
]);

html.renderHTML();

The above code will result with the following HTML output:

<!DOCTYPE html>
<html>
  <head>
    <title>Generated HTML</title>
  </head>
  <body style="padding: 1rem">
    <div>
      <span class="button">A Button Span Deluxe</span>
      <a href="/path-to-infinity" target="_blank">Click here</a>
    </div>
  </body>
</html>

Documentation

Visit the wiki for more examples of usage, method reference and further reading.


Contribute

Do you believe that something is missing from this plugin or perhaps is not working as intended? Awesome-pants! Help is always appreciated. Just be sure to read through the Contributing Handbook (and remember to have a jolly good time).

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.3

4 years ago

0.4.4

4 years ago