remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git] / extra / webapps / help / help.factor
blob1c17e3214f17536f3345fa906943d8c7ab1324e0
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 ;
7 IN: webapps.help
9 TUPLE: help-webapp < dispatcher ;
11 M: result link-title title>> ;
13 M: result link-href href>> ;
15 :: <search-action> ( help-dir -- action )
16     <page-action>
17         { help-webapp "search" } >>template
19         [
20             {
21                 { "search" [ 1 v-min-length 50 v-max-length v-one-line ] }
22             } validate-params
24             help-dir [
25                 "search" value article-apropos "articles" set-value
26                 "search" value word-apropos "words" set-value
27                 "search" value vocab-apropos "vocabs" set-value
28             ] with-directory
30             { help-webapp "search" } <chloe-content>
31         ] >>submit ;
33 : <main-action> ( -- action )
34     <page-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 ;