diff --git a/extra/easy-help/easy-help.factor b/extra/easy-help/easy-help.factor new file mode 100644 index 0000000000..692a029b97 --- /dev/null +++ b/extra/easy-help/easy-help.factor @@ -0,0 +1,48 @@ + +USING: kernel multiline parser sequences splitting help.markup ; + +IN: easy-help + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: Description: + + ".." parse-multiline-string + string-lines + 1 tail + [ dup " " head? [ 4 tail ] [ ] if ] map + [ dup "" = [ drop { $nl } ] [ ] if ] map + \ $description prefix + parsed + + ; parsing + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: Example: + + { $heading "Example" } parsed + + ".." parse-multiline-string + string-lines + [ dup " " head? [ 4 tail ] [ ] if ] map + [ "" = not ] filter + ! \ $example prefix + \ $code prefix + parsed + + ; parsing + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: Summary: + + ".." parse-multiline-string + string-lines + 1 tail + [ dup " " head? [ 4 tail ] [ ] if ] map + [ dup "" = [ drop { $nl } ] [ ] if ] map + { $heading "Summary" } prefix + parsed + + ; parsing