recursive markdown rendering

This commit is contained in:
tristan 2023-12-31 10:33:05 +00:00
parent 5e8bb998db
commit 234c629e66
6 changed files with 90 additions and 15 deletions

View file

@ -0,0 +1,3 @@
# this is a file
wowo

9
testing/blog/index.md Normal file
View file

@ -0,0 +1,9 @@
# yeee
ye
&
<a href="dir">dir</a>
<a href="/">home</a>

View file

@ -24,4 +24,44 @@ in
(elems.p {} "lorem ipsum\n")
];
})
(it "can fix file appendixes" {
actual = fixAppendix "index.md";
expected = "index.html";
})
(it "recursively reads dir" {
actual = recReadMd ./blog;
expected = {
"index.md" = mdToPage ./blog/index.md;
"dir" = {
"index.md" = mdToPage ./blog/dir/index.md;
};
};
})
(it "recursively fixes filename" {
actual = recFixAppendix {
"index.md" = "something";
dir = {
"index.md" = "something else";
};
};
expected = {
"index.html" = "something";
dir = {
"index.html" = "something else";
};
};
})
(it "recursively translates md to html" {
actual = builtins.toJSON ( readDir ./blog );
expected = builtins.toJSON {
"index.html" = mdToPage ./blog/index.md;
"dir" = {
"index.html" = mdToPage ./blog/dir/index.md;
};
};
})
]