update tix and add html document

This commit is contained in:
tristan 2024-01-03 13:19:41 +00:00
parent baa5b6854e
commit 93799cac12
9 changed files with 759 additions and 699 deletions

View file

@ -64,15 +64,24 @@ in rec {
|| builtins.isList tag
|| (tag ? __toString && builtins.isFunction tag.__toString));
addToHead = page: heads:
page
addToHead = doc: heads:
doc
// {
child =
map
(e:
if e.tag == "head"
then e // {child = e.child ++ heads;}
else e)
page.child;
head = doc.head ++ heads;
};
document = {
head ? [],
body ? [],
attrs ? {},
}: {
inherit head body attrs;
__toString = self: ''
<!DOCTYPE html>
${(tag "html" [
(tag "head" self.head)
(tag "body" self.body)
])}
'';
};
}