better testing experience
This commit is contained in:
parent
4f28cbfda7
commit
9421a0a910
10 changed files with 96 additions and 49 deletions
|
@ -69,25 +69,31 @@ in rec {
|
|||
matchThen "(```)(.*)(```)" block (m: elems.code (builtins.elemAt m 1));
|
||||
|
||||
list = block:
|
||||
matchThen (
|
||||
''
|
||||
matchThen (''
|
||||
(- .+
|
||||
)*(- .+
|
||||
?)'') block (m:
|
||||
elems.List ( splitList block ));
|
||||
?)'') block (m: elems.List (splitList block));
|
||||
|
||||
splitList = block: map (listItem) (builtins.filter
|
||||
(s: builtins.isString s && s != "")
|
||||
(builtins.split "\n" block));
|
||||
splitList = block:
|
||||
map (listItem) (builtins.filter (s: builtins.isString s && s != "")
|
||||
(builtins.split "\n" block));
|
||||
|
||||
listItem = str:
|
||||
listItem = str:
|
||||
let
|
||||
li = builtins.match "- (.*)" str;
|
||||
checkbox = builtins.match "- \\[(.)] (.*)" str;
|
||||
checked = builtins.elemAt checkbox 0;
|
||||
content = builtins.elemAt checkbox 1;
|
||||
in if checkbox == null then li else
|
||||
[(elems.input {type = "checkbox"; checked = checked != " "; disabled = true;}) content];
|
||||
li = builtins.match "- (.*)" str;
|
||||
checkbox = builtins.match "- \\[(.)] (.*)" str;
|
||||
checked = builtins.elemAt checkbox 0;
|
||||
content = builtins.elemAt checkbox 1;
|
||||
in if checkbox == null then
|
||||
li
|
||||
else [
|
||||
(elems.input {
|
||||
type = "checkbox";
|
||||
checked = checked != " ";
|
||||
disabled = true;
|
||||
})
|
||||
content
|
||||
];
|
||||
|
||||
replace = matcher: apply: block:
|
||||
(let
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue