Update help webapp to work with the overhauled furnace
parent
1c3c7db0bc
commit
2447a20ad5
|
@ -6,18 +6,19 @@ USING: kernel furnace furnace.validator http.server.responders
|
||||||
arrays io.files ;
|
arrays io.files ;
|
||||||
IN: webapps.help
|
IN: webapps.help
|
||||||
|
|
||||||
|
! : string>topic ( string -- topic )
|
||||||
|
! " " split dup length 1 = [ first ] when ;
|
||||||
|
|
||||||
: show-help ( topic -- )
|
: show-help ( topic -- )
|
||||||
serving-html
|
serving-html
|
||||||
dup article-title [
|
dup article-title [
|
||||||
[ help ] with-html-stream
|
[ help ] with-html-stream
|
||||||
] simple-html-document ;
|
] simple-html-document ;
|
||||||
|
|
||||||
: string>topic ( string -- topic )
|
|
||||||
" " split dup length 1 = [ first ] when ;
|
|
||||||
|
|
||||||
\ show-help {
|
\ show-help {
|
||||||
{ "topic" "handbook" v-default string>topic }
|
{ "topic" }
|
||||||
} define-action
|
} define-action
|
||||||
|
\ show-help { { "topic" "handbook" } } default-values
|
||||||
|
|
||||||
M: link browser-link-href
|
M: link browser-link-href
|
||||||
link-name
|
link-name
|
||||||
|
@ -32,9 +33,10 @@ M: link browser-link-href
|
||||||
lookup show-help ;
|
lookup show-help ;
|
||||||
|
|
||||||
\ show-word {
|
\ show-word {
|
||||||
{ "word" "call" v-default }
|
{ "word" }
|
||||||
{ "vocab" "kernel" v-default }
|
{ "vocab" }
|
||||||
} define-action
|
} define-action
|
||||||
|
\ show-word { { "word" "call" } { "vocab" "kernel" } } default-values
|
||||||
|
|
||||||
M: f browser-link-href
|
M: f browser-link-href
|
||||||
drop \ f browser-link-href ;
|
drop \ f browser-link-href ;
|
||||||
|
@ -47,9 +49,11 @@ M: word browser-link-href
|
||||||
f >vocab-link show-help ;
|
f >vocab-link show-help ;
|
||||||
|
|
||||||
\ show-vocab {
|
\ show-vocab {
|
||||||
{ "vocab" "kernel" v-default }
|
{ "vocab" }
|
||||||
} define-action
|
} define-action
|
||||||
|
|
||||||
|
\ show-vocab { { "vocab" "kernel" } } default-values
|
||||||
|
|
||||||
M: vocab-spec browser-link-href
|
M: vocab-spec browser-link-href
|
||||||
vocab-name [ show-vocab ] curry quot-link ;
|
vocab-name [ show-vocab ] curry quot-link ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue