Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 863 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 863 Bytes

simplehtml

DepShield Badge

A java html library inspired by preact's h function, jsx and hyperscript.

The only public class is "Html" and it contains static methods which allows us to write java code like this:

h("div", Map.of("id", "foo"),
  h("p", "Look, a simple html element!"),
  h("ul",
    h("li", h("p", "hello")),
    h("li", h("p", "there")),
    h("li", h("p", "people"))
  )
).getOuterHTML();

To generate this html:

<div id="foo">
  <p>Look, a simple html element!</p>
  <ul>
    <li><p>hello</p></li>
    <li><p>there</p></li>
    <li><p>people</p></li>
  </ul>
</div>