1.0.2 • Published 5 years ago

@sharyn/util.html v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

🌹 html

html is a template string tag that does almost nothing. It's a normal template string, but your code editor or its plugins might support syntax highlighting for HTML when they are marked with an html tag. The only thing it does is to .trim() your string so that you can put your template string on multiple lines without getting unwanted whitespace before the doctype or after the final html tag.

import html from '@sharyn/util/html'
// or import { html } from '@sharyn/util'

const createHtml = ({ title }: { title: string }) =>
  html`
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <title>${title}</title>
      </head>
      <body>
        <h1>${title}</h1>
      </body>
    </html>
  ` // This HTML code has syntax highlighting

html is part of @sharyn/util