initial commit
This commit is contained in:
commit
74670edee1
9 changed files with 141 additions and 0 deletions
26
nixite/md.nix
Normal file
26
nixite/md.nix
Normal 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>
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue