arrays io.files ;
IN: webapps.help
+! : string>topic ( string -- topic )
+ ! " " split dup length 1 = [ first ] when ;
+
: show-help ( topic -- )
serving-html
dup article-title [
[ help ] with-html-stream
] simple-html-document ;
-: string>topic ( string -- topic )
- " " split dup length 1 = [ first ] when ;
-
\ show-help {
- { "topic" "handbook" v-default string>topic }
+ { "topic" }
} define-action
+\ show-help { { "topic" "handbook" } } default-values
M: link browser-link-href
link-name
lookup show-help ;
\ show-word {
- { "word" "call" v-default }
- { "vocab" "kernel" v-default }
+ { "word" }
+ { "vocab" }
} define-action
+\ show-word { { "word" "call" } { "vocab" "kernel" } } default-values
M: f browser-link-href
drop \ f browser-link-href ;
f >vocab-link show-help ;
\ show-vocab {
- { "vocab" "kernel" v-default }
+ { "vocab" }
} define-action
+\ show-vocab { { "vocab" "kernel" } } default-values
+
M: vocab-spec browser-link-href
vocab-name [ show-vocab ] curry quot-link ;