1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel accessors http.server.dispatchers
4 http.server.static furnace.actions furnace.redirection urls
5 validators locals io.files io.directories html.forms
6 html.components help.html ;
9 TUPLE: help-webapp < dispatcher ;
11 M: result link-title title>> ;
13 M: result link-href href>> ;
15 :: <search-action> ( help-dir -- action )
17 { help-webapp "search" } >>template
21 { "search" [ 1 v-min-length 50 v-max-length v-one-line ] }
25 "search" value article-apropos "articles" set-value
26 "search" value word-apropos "words" set-value
27 "search" value vocab-apropos "vocabs" set-value
30 { help-webapp "search" } <chloe-content>
33 : <main-action> ( -- action )
35 { help-webapp "help" } >>template ;
37 : <help-webapp> ( help-dir -- webapp )
38 help-webapp new-dispatcher
39 <main-action> "" add-responder
40 over <search-action> "search" add-responder
41 swap <static> "content" add-responder ;