]> gitweb.factorcode.org Git - factor.git/commitdiff
Update help webapp to work with the overhauled furnace
authorDoug Coleman <doug.coleman@gmail.com>
Tue, 18 Dec 2007 08:24:41 +0000 (02:24 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 18 Dec 2007 08:24:41 +0000 (02:24 -0600)
extra/webapps/help/help.factor

index 145df4119a131329dd69b05d6a5ab87499618acb..28d73607bac3132a935e00eabb9f7d73c94f2562 100644 (file)
@@ -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 ;