From: Doug Coleman Date: Tue, 18 Dec 2007 08:24:41 +0000 (-0600) Subject: Update help webapp to work with the overhauled furnace X-Git-Tag: 0.94~2763^2~165^2~14 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=2447a20ad55c00fa1646be029309f45f70b44073 Update help webapp to work with the overhauled furnace --- diff --git a/extra/webapps/help/help.factor b/extra/webapps/help/help.factor index 145df4119a..28d73607ba 100644 --- a/extra/webapps/help/help.factor +++ b/extra/webapps/help/help.factor @@ -6,18 +6,19 @@ USING: kernel furnace furnace.validator http.server.responders 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 @@ -32,9 +33,10 @@ M: link browser-link-href 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 ; @@ -47,9 +49,11 @@ M: word 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 ;