From 0965d9be41ad29d71f58e03121046daf45833473 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 13 Oct 2011 22:09:30 -0700 Subject: [PATCH] webapps.help: remove frames. Fixes #242. --- basis/help/html/html.factor | 20 ++- basis/help/html/stylesheet.css | 8 ++ extra/webapps/help/help.factor | 42 +++--- extra/webapps/help/help.xml | 20 --- extra/webapps/help/search.xml | 132 ++++++++++-------- .../concatenative/concatenative.factor | 4 +- 6 files changed, 118 insertions(+), 108 deletions(-) delete mode 100644 extra/webapps/help/help.xml diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor index 7e8be77d4d..29174b6127 100644 --- a/basis/help/html/html.factor +++ b/basis/help/html/html.factor @@ -60,14 +60,28 @@ M: f topic>filename* drop \ f topic>filename* ; M: topic url-of topic>filename ; -: help-stylesheet ( -- string ) +: help-stylesheet ( -- xml ) "vocab:help/html/stylesheet.css" ascii file-contents [XML XML] ; +: help-navbar ( -- xml ) + [XML + + XML] ; + : help>html ( topic -- xml ) - [ article-title ] + [ article-title " - Factor Documentation" append ] [ drop help-stylesheet ] - [ [ print-topic ] with-html-writer ] + [ [ print-topic ] with-html-writer help-navbar prepend ] tri simple-page ; : generate-help-file ( topic -- ) diff --git a/basis/help/html/stylesheet.css b/basis/help/html/stylesheet.css index c56a19bc9a..b0ae275b7f 100644 --- a/basis/help/html/stylesheet.css +++ b/basis/help/html/stylesheet.css @@ -2,3 +2,11 @@ a:link { text-decoration: none; color: #104e8b; } a:visited { text-decoration: none; color: #104e8b; } a:active { text-decoration: none; color: #104e8b; } a:hover { text-decoration: underline; color: #104e8b; } + +.navbar { + background-color: #eeeee0; + padding: 5px; + border: 1px solid #ccc; + font:9pt "Lucida Grande", "Lucida Sans Unicode", verdana, geneva, sans-serif; + margin-bottom: 10px; +} diff --git a/extra/webapps/help/help.factor b/extra/webapps/help/help.factor index 17d3d361c6..af53af5c10 100644 --- a/extra/webapps/help/help.factor +++ b/extra/webapps/help/help.factor @@ -1,9 +1,11 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors db.sqlite furnace.actions furnace.alloy kernel -http.server.dispatchers http.server.static furnace.redirection -urls validators locals io.files io.directories help.html -html.forms html.components http.server namespaces ; +USING: accessors db.sqlite furnace.actions furnace.alloy +furnace.redirection help.html help.topics html.components +html.forms html.templates.chloe http.server +http.server.dispatchers http.server.static io.directories +io.files kernel locals namespaces sequences unicode.categories +urls ; IN: webapps.help TUPLE: help-webapp < dispatcher ; @@ -15,36 +17,34 @@ M: result link-href href>> ; :: ( help-dir -- action ) { help-webapp "search" } >>template - [ - { - { "search" [ 1 v-min-length 50 v-max-length v-one-line ] } - } validate-params - - help-dir [ - "search" value article-apropos "articles" set-value - "search" value word-apropos "words" set-value - "search" value vocab-apropos "vocabs" set-value - ] with-directory + "search" param [ blank? ] trim [ + help-dir [ + [ article-apropos "articles" set-value ] + [ word-apropos "words" set-value ] + [ vocab-apropos "vocabs" set-value ] tri + ] with-directory + ] unless-empty { help-webapp "search" } ] >>submit ; +: help-url ( topic -- url ) + topic>filename "$help-webapp/content/" prepend >url ; + : ( -- action ) - - { help-webapp "help" } >>template ; + + [ "handbook" >link help-url ] >>display ; -:: ( help-dir help-db -- webapp ) +:: ( help-dir -- webapp ) help-webapp new-dispatcher "" add-responder - help-dir help-db [ ] when* "search" add-responder + help-dir "search" add-responder help-dir "content" add-responder "resource:basis/definitions/icons/" "icons" add-responder ; : run-help-webapp ( -- ) - "resource:temp/docs" - "resource:help.db" - + "resource:temp/docs" main-responder set-global 8080 httpd drop ; diff --git a/extra/webapps/help/help.xml b/extra/webapps/help/help.xml deleted file mode 100644 index 7718b10a22..0000000000 --- a/extra/webapps/help/help.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - Factor Documentation - - - - - - - - - - diff --git a/extra/webapps/help/search.xml b/extra/webapps/help/search.xml index 97b096c3be..fa26147617 100644 --- a/extra/webapps/help/search.xml +++ b/extra/webapps/help/search.xml @@ -5,72 +5,80 @@ - - + - - + + Search - Factor Documentation + + + + + + + +

Articles

+
    + +
  • +
    +
+
+ + +

Vocabularies

+
    + +
  • +
    +
+
+ + +

Words

+
    + +
  • +
    +
+
+ +
+

This is the Factor + documentation, generated offline from a + load-all image. If you want, you can also browse the + documentation from within the Factor UI.

+ +
diff --git a/extra/websites/concatenative/concatenative.factor b/extra/websites/concatenative/concatenative.factor index 792dee293f..8e7c40ae72 100644 --- a/extra/websites/concatenative/concatenative.factor +++ b/extra/websites/concatenative/concatenative.factor @@ -89,7 +89,7 @@ SYMBOLS: key-password key-file dh-file ; "pastebin" add-responder "planet" add-responder "mason" add-responder - "/tmp/docs/" f "docs" add-responder + "/tmp/docs/" "docs" add-responder website-db main-responder set-global ; @@ -108,7 +108,7 @@ SYMBOLS: key-password key-file dh-file ; website-db "paste.factorcode.org" add-responder website-db "planet.factorcode.org" add-responder website-db "builds.factorcode.org" add-responder - home "docs" append-path website-db "docs.factorcode.org" add-responder + home "docs" append-path "docs.factorcode.org" add-responder home "cgi" append-path "gitweb.factorcode.org" add-responder main-responder set-global ; -- 2.34.1