recursive markdown rendering
This commit is contained in:
parent
5e8bb998db
commit
234c629e66
6 changed files with 90 additions and 15 deletions
3
testing/blog/dir/index.md
Normal file
3
testing/blog/dir/index.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# this is a file
|
||||
|
||||
wowo
|
9
testing/blog/index.md
Normal file
9
testing/blog/index.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# yeee
|
||||
|
||||
ye
|
||||
|
||||
&
|
||||
|
||||
<a href="dir">dir</a>
|
||||
<a href="/">home</a>
|
||||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
})
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue