Paste: pretty links including colored stack effect
Author: | klazuka |
Mode: | factor |
Date: | Thu, 17 Sep 2009 19:16:51 |
Plain Text |
: write-link
link-style get [ write-object ] with-style ;
GENERIC# write-link* 1
M: object write-link* [ >link ] dip write-link* ;
M: topic write-link*
dupd [ article-title ] [ article-name ] if
swap write-link ;
M: word write-link*
not [ f call-next-method ] [
dup f call-next-method
stack-effect [ effect>string ] [ effect-style ] bi
[ bl write ] with-style
] if ;
: (($link))
[ dup string? [ >link ] when ] 2dip
[ over definition-icon 1array $image " " print-element ] when
[ write-link* ] ($span) ;
: ($link) f f (($link)) ;
: $link first ($link) ;
: ($long-link) t f (($link)) ;
: $long-link first ($long-link) ;
: ($pretty-link) f t (($link)) ;
: $pretty-link first ($pretty-link) ;
: ($long-pretty-link) t t (($link)) ;
: $long-pretty-link first ($long-pretty-link) ;
Author: | klazuka |
Mode: | factor |
Date: | Thu, 17 Sep 2009 20:06:40 |
Plain Text |
: write-link
link-style get [ write-object ] with-style ;
: link-icon
dup string? [ >link ] when
definition-icon 1array $image " " print-element ;
: link-text
[ article-name ] keep write-link ;
: link-effect
dup word? [
stack-effect [ effect>string ] [ effect-style ] bi
[ bl write ] with-style
] [ drop ] if ;
: (($link))
[ cleave ] ($span) ;
: ($link) { link-text } (($link)) ;
: $link first ($link) ;
: ($long-link) { link-text link-effect } (($link)) ;
: $long-link first ($long-link) ;
: ($pretty-link) { link-icon link-text } (($link)) ;
: $pretty-link first ($pretty-link) ;
: ($long-pretty-link) { link-icon link-text link-effect } (($link)) ;
: $long-pretty-link first ($long-pretty-link) ;
New Annotation