Skip to content

GlenBikes/json2html.js

 
 

Repository files navigation

json2html

This is a repository to build HTML based in json struct

Badges

Github

tag issues contributors license code-size top-languages languages

Social

forks stars watchers

Contributors

Others

BCH compliance

Base Struct

The json payload is as follow:

{
	"tag": "div",
	"attributes": {
		"id": "some-id",
		"class": "some-class"
	},
	"children": [
		//...components or "some-text-or-html"
	],
}

Restrictions

If the component tag is self closing, content and children will be ignored;

Usage

	var someJson = {};
	JSON2HTML.build(someJson);
	var someHtml = '<div></div>';
	JSON2HTML.unbuild(someHtml);

You can check the example in docs folder.

Contributions

Yes, please! Everybody is welcome.

About

This is a repository to build HTML based in json struct

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 58.3%
  • JavaScript 41.7%