Merge branch 'master' of git://factorcode.org/git/factor
commit
5bd1d73594
|
@ -327,7 +327,7 @@ HELP: $table
|
||||||
|
|
||||||
HELP: $values
|
HELP: $values
|
||||||
{ $values { "element" "an array of pairs of markup elements" } }
|
{ $values { "element" "an array of pairs of markup elements" } }
|
||||||
{ $description "Prints the description of arguments and values found on every word help page. The first element of a pair is the argument name and is output with " { $link $snippet } ". The remainder is either a single class word, or an element. If it is a class word " { $snippet "class" } ", it is intereted as if it were shorthand for " { $snippet "{ $instance class }" } "." }
|
{ $description "Prints the description of arguments and values found on every word help page. The first element of a pair is the argument name and is output with " { $link $snippet } ". The remainder is either a single class word, or an element. If it is a class word " { $snippet "class" } ", it is inserted as if it were shorthand for " { $snippet "{ $instance class }" } "." }
|
||||||
{ $see-also $maybe $instance $quotation } ;
|
{ $see-also $maybe $instance $quotation } ;
|
||||||
|
|
||||||
HELP: $instance
|
HELP: $instance
|
||||||
|
|
|
@ -8,47 +8,62 @@ IN: easy-help
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: Description:
|
: parse-text-block ( -- array )
|
||||||
|
|
||||||
".." parse-multiline-string
|
".." parse-multiline-string
|
||||||
string-lines
|
string-lines
|
||||||
1 tail
|
1 tail
|
||||||
[ dup " " head? [ 4 tail ] [ ] if ] map
|
[ dup " " head? [ 4 tail ] [ ] if ] map
|
||||||
[ dup "" = [ drop { $nl } ] [ ] if ] map
|
[ expand-markup ] map
|
||||||
\ $description prefix
|
concat
|
||||||
|
[ dup "" = [ drop { $nl } ] [ ] if ] map ;
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
: Text: parse-text-block parsed ; parsing
|
||||||
|
|
||||||
|
: Block: scan-word 1array parse-text-block append parsed ; parsing
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
: Notes: { $notes } parse-text-block append parsed ; parsing
|
||||||
|
: Description: { $description } parse-text-block append parsed ; parsing
|
||||||
|
: Contract: { $contract } parse-text-block append parsed ; parsing
|
||||||
|
: Checked-Example: { $example } parse-text-block append parsed ; parsing
|
||||||
|
|
||||||
|
: Class-Description:
|
||||||
|
{ $class-description } parse-text-block append parsed ; parsing
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
: Code:
|
||||||
|
|
||||||
|
{ $code }
|
||||||
|
parse-text-block [ dup array? [ drop "" ] [ ] if ] map
|
||||||
|
append
|
||||||
parsed
|
parsed
|
||||||
|
|
||||||
; parsing
|
; parsing
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
: Example:
|
: Example:
|
||||||
|
{ $heading "Example" }
|
||||||
|
{ $code }
|
||||||
|
parse-text-block
|
||||||
|
[ dup array? [ drop "" ] [ ] if ] map ! Each item in $code must be a string
|
||||||
|
append
|
||||||
|
2array parsed ; parsing
|
||||||
|
|
||||||
{ $heading "Example" } parsed
|
: Introduction:
|
||||||
|
|
||||||
".." parse-multiline-string
|
{ $heading "Introduction" }
|
||||||
string-lines
|
parse-text-block
|
||||||
[ dup " " head? [ 4 tail ] [ ] if ] map
|
2array parsed ; parsing
|
||||||
[ "" = not ] filter
|
|
||||||
! \ $example prefix
|
|
||||||
\ $code prefix
|
|
||||||
parsed
|
|
||||||
|
|
||||||
; parsing
|
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
: Summary:
|
: Summary:
|
||||||
|
|
||||||
".." parse-multiline-string
|
{ $heading "Summary" }
|
||||||
string-lines
|
parse-text-block
|
||||||
1 tail
|
2array parsed ; parsing
|
||||||
[ dup " " head? [ 4 tail ] [ ] if ] map
|
|
||||||
[ dup "" = [ drop { $nl } ] [ ] if ] map
|
|
||||||
{ $heading "Summary" } prefix
|
|
||||||
parsed
|
|
||||||
|
|
||||||
; parsing
|
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
@ -77,35 +92,20 @@ IN: easy-help
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: Contract:
|
: Heading: { $heading } ".." parse-multiline-string suffix parsed ; parsing
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
: List:
|
||||||
|
|
||||||
|
{ $list }
|
||||||
|
|
||||||
".." parse-multiline-string
|
".." parse-multiline-string
|
||||||
string-lines
|
string-lines
|
||||||
1 tail
|
1 tail
|
||||||
[ dup " " head? [ 4 tail ] [ ] if ] map
|
[ dup " " head? [ 4 tail ] [ ] if ] map
|
||||||
[ expand-markup ] map
|
[ expand-markup ] map
|
||||||
concat
|
|
||||||
[ dup "" = [ drop { $nl } ] [ ] if ] map
|
append parsed
|
||||||
\ $contract prefix
|
|
||||||
parsed
|
|
||||||
|
|
||||||
; parsing
|
; parsing
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
: Notes:
|
|
||||||
|
|
||||||
".." parse-multiline-string
|
|
||||||
string-lines
|
|
||||||
1 tail
|
|
||||||
[ dup " " head? [ 4 tail ] [ ] if ] map
|
|
||||||
[ expand-markup ] map
|
|
||||||
concat
|
|
||||||
[ dup "" = [ drop { $nl } ] [ ] if ] map
|
|
||||||
\ $notes prefix
|
|
||||||
parsed
|
|
||||||
|
|
||||||
; parsing
|
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue