initial commit

This commit is contained in:
tristan 2023-12-30 18:27:23 +00:00
commit 74670edee1
9 changed files with 141 additions and 0 deletions

26
nixite/md.nix Normal file
View file

@ -0,0 +1,26 @@
rec {
readMd = path: processMd (builtins.readFile path);
processMd = md: {
title = "idk";
content = toString (map (c:
if builtins.typeOf c == "string"
then processMdBlock c
else null) (builtins.split "\n\n" md));
};
processMdBlock = block: p block;
isHeading = block: builtins.match "#+ .*" block;
h = content: ''
<h1>
${toString content}
</h1>
'';
p = content: ''
<p>
${toString content}
</p>
'';
}