]> gitweb.factorcode.org Git - factor.git/commitdiff
Checkin experimental 'easy-help' into extra
authorEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Mon, 22 Dec 2008 21:43:01 +0000 (15:43 -0600)
committerEduardo Cavazos <dharmatech@finkelstein.stackeffects.info>
Mon, 22 Dec 2008 21:43:01 +0000 (15:43 -0600)
extra/easy-help/easy-help.factor [new file with mode: 0644]

diff --git a/extra/easy-help/easy-help.factor b/extra/easy-help/easy-help.factor
new file mode 100644 (file)
index 0000000..692a029
--- /dev/null
@@ -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