html.streams: move icon src mapping to help.html.
parent
d2114e913c
commit
868d970784
|
@ -149,10 +149,17 @@ M: pathname url-of
|
||||||
seq>> [
|
seq>> [
|
||||||
T{ name { main "img" } } over tag-named? [
|
T{ name { main "img" } } over tag-named? [
|
||||||
dup "src" attr
|
dup "src" attr
|
||||||
dup "@2x.png" tail? [ 2drop ] [
|
|
||||||
|
! use @2x retina images
|
||||||
|
dup "@2x.png" tail? [
|
||||||
"." split1-last "@2x." glue
|
"." split1-last "@2x." glue
|
||||||
"src" set-attr
|
] unless
|
||||||
] if
|
|
||||||
|
! src mapping for webapps.help
|
||||||
|
"vocab:definitions/icons/" ?head
|
||||||
|
[ "/icons/" prepend ] when
|
||||||
|
|
||||||
|
"src" set-attr
|
||||||
] [ drop ] if
|
] [ drop ] if
|
||||||
] deep-each
|
] deep-each
|
||||||
] [ drop ] if
|
] [ drop ] if
|
||||||
|
|
|
@ -62,11 +62,3 @@ M: funky url-of "http://www.funky-town.com/" swap town>> append ;
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
{ } [ [ { 1 2 3 } describe ] with-html-writer drop ] unit-test
|
{ } [ [ { 1 2 3 } describe ] with-html-writer drop ] unit-test
|
||||||
|
|
||||||
{ "<img src=\"/icons/class-word.tiff\"/>" } [
|
|
||||||
[
|
|
||||||
"text"
|
|
||||||
{ { image-style "vocab:definitions/icons/class-word.tiff" } }
|
|
||||||
format
|
|
||||||
] make-html-string
|
|
||||||
] unit-test
|
|
||||||
|
|
|
@ -77,11 +77,8 @@ MACRO: make-css ( pairs -- str )
|
||||||
: emit-html ( stream quot -- )
|
: emit-html ( stream quot -- )
|
||||||
dip data>> push ; inline
|
dip data>> push ; inline
|
||||||
|
|
||||||
: icon-path ( path -- icons-path )
|
|
||||||
"vocab:definitions/icons/" ?head [ "/icons/" prepend ] when ;
|
|
||||||
|
|
||||||
: img-tag ( xml style -- xml )
|
: img-tag ( xml style -- xml )
|
||||||
image-style of [ nip icon-path simple-image ] when* ;
|
image-style of [ nip simple-image ] when* ;
|
||||||
|
|
||||||
: format-html-span ( string style stream -- )
|
: format-html-span ( string style stream -- )
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue