Skip to content

hexlet-components/js-html-builder

Repository files navigation

js-html-builder

github action status

Install

npm install @hexlet/html-builder

Usage example

import parse from '@hexlet/html-builder';

const data = ['html', [
  ['head', [
    ['title', 'hello, hexlet!'],
  ]],
  ['body', [
    ['div', { class: 'separator' }],
    ['h1', { class: 'header' }, 'html builder example'],
    ['div', [
      ['img', { class: 'image', href: '#' }],
      ['span', 'span text2'],
    ]],
  ]],
]];

const ast = parse(data);
ast.toString();

// '<html>
// <head><title>hello, hexlet!</title></head>
// <body><div class="separator"></div>
// <h1 class="header">html builder example</h1>
// <div><img class="image" href="#"><span>span text2</span>
// </div></body></html>'

For more information, see the Full Documentation


Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet.

See most active contributors on hexlet-friends.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 6