Checkin experimental 'easy-help' into extra
parent
b66ec7aa73
commit
016c225a18
|
@ -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
|
Loading…
Reference in New Issue