1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
---@diagnostic disable: undefined-global
return {
s(
'html:5',
fmt(
[[
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="dark light">
<title>{title}</title>
<link href="{style}" rel="stylesheet">
<script src="{script}"></script>
</head>
<body>
{body}
</body>
</html>
]],
{
title = i(1, 'my title'),
style = i(2, 'style.css'),
script = i(3, 'main.js'),
body = i(0),
}
)
),
s('anchor', fmt([[<a href="{}">{}</a>]], { i(1), i(2) })),
s(
'journal',
fmt(
[[
<article>
<h2>{}</h2>
<p>{}</p>
</article>
]],
{
i(1, os.date('%Y-%m-%d, %a')),
i(0),
}
)
),
}
|