import { render } from "@mjstahl/hats";
const template = `
<html>
<body>
<h1 data-show-if="showHeader">HATS<h1>
First Name:
<span data-content="firstName" data-content-format="uppercase"></span>
Last Name:
<span data-content="lastName" data-content-format="lowercase explode"></span>
</body>
</html>
`;
const env = {
formats: {
explode: (v) => v.split("").join(" "),
lowercase: (v) => v.toLowerCase(),
uppercase: (v) => v.toUpperCase(),
},
};
render(
template,
{ firstName: "Mark", lastName: "Stahl", showHeader: false },
env,
);
// <html>
// <body>
// First Name:
// <span data-content="firstName" data-content-format="uppercase">MARK</span>
// Last Name:
// <span data-content="lastName" data-content-format="lowercase explode">s t a h l</span>
// </body>
// </html>
-
Notifications
You must be signed in to change notification settings - Fork 0
HTML Attribute Templates
License
mjstahl/hats
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
HTML Attribute Templates
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published