clean repo

This commit is contained in:
Emile Clark-Boman 2026-01-31 10:31:31 +10:00
parent e001182489
commit c0f53e00c1
18 changed files with 23 additions and 506 deletions

2
docs/hown/README.md Normal file
View file

@ -0,0 +1,2 @@
# Html With Nix (HOWN/hown)
Hown is a system for static html/css compilation with the NixExpr language.

6
docs/hown/default.nix Normal file
View file

@ -0,0 +1,6 @@
{mix, ...} @ inputs:
mix.newMixture inputs (mixture: {
includes.public = [
./tty.nix
];
})

8
docs/hown/index.html Normal file
View file

@ -0,0 +1,8 @@
<!-->
{Text, mkTypingEffect, ...}:
mkTypingEffect {
head = Text "$ Do butterflies cry when they're sad?";
body = Text "Segmentation fault (core dumped)";
}
<-->

100
docs/hown/tty.nix Normal file
View file

@ -0,0 +1,100 @@
# XXX: TODO: The howl.Div, howl.Text, ... types implement
# XXX: TODO: the HtmlTag' typeclass, which in turn implements
# XXX: TODO: a morphism to the nt.String type. This makes compiling
# XXX: TODO: to html super duper simple!!
{
nt,
howl,
...
}: let
inherit
(nt)
projectOnto
;
inherit
(howl)
# HTML
Div
Text
# CSS
StyleClass
StyleSheet
ContinuousAnimation
DiscreteAnimation
;
in {
typing = StyleSheet {
include = [./tty.css];
classes = {
typing-wrapper = null;
typing-prompt = promptLength: commandLength: duration: period:
StyleClass {
width = promptLength + commandLength; # ignore cursor
border.right = "TODO"; # cursor
# hide what the animation hasn't shown yet
whitespace = "nowrap";
overflow = "hidden";
# run typing animation then start cursor blink
animations = [
(DiscreteAnimation {
inherit duration;
keyframes = {
"0"
};
})
];
};
typing-result = typingDuration: delay:
StyleClass {
visibility = "hidden";
whitespace = "pre-wrap"; # preserve linebreaks
# show result once typing duration + delay is over
animations = [
(ContinuousAnimation {
name = "unhide-result";
duration = 1; # animation-duration
# timingFn = ; # animation-timing-function
delay = typingDuration + delay; # animation-delay
# animation-iteration-count
direction = "forwards"; # animation-direction
# animation-fill-mode
# animation-play-state
keyframes = {
"100" = {
visibility = "visible";
};
};
})
];
};
};
};
mkTypingEffect = decl': let
decl =
decl'
|> projectOnto
{
head = "";
body = "";
};
in
Div {
id = "typing-wrapper";
content = [
(Div {
id = "typing-prompt";
content = Text decl.head;
})
(Div {
id = "typing-result";
content = Text decl.body;
})
];
};
}