templatr 0.1.2 templatr: ^0.1.2 copied to clipboard
HTML Templating
example/example.dart
import 'package:templatr/html.dart';
import 'package:templatr/shoelace.dart' as sl;
void main() {
var shoelaceVersion = 'shoelace@2.0.0-beta.19';
var page = html(lang: 'en', content: [
head([
title('Home - Sunshine'),
link(
rel: LinkRel.stylesheet,
href: 'https://cdn.jsdelivr.net/npm/@shoelace-style/$shoelaceVersion/dist/shoelace/shoelace.css',
),
script(
type: 'module',
src: 'https://cdn.jsdelivr.net/npm/@shoelace-style/$shoelaceVersion/dist/shoelace/shoelace.esm.js',
)
]),
body([
section([
article([
h1(''),
h2('The facts'),
ul([
li(a('', href: '')),
]),
h2('The fiction'),
ul([
li(a('', href: '')),
]),
sl.button('Suggest changes'),
])
])
])
]);
print(page);
}