webapps.help: remove frames. Fixes #242.
parent
f20e5df501
commit
0965d9be41
|
@ -60,14 +60,28 @@ M: f topic>filename* drop \ f topic>filename* ;
|
||||||
|
|
||||||
M: topic url-of topic>filename ;
|
M: topic url-of topic>filename ;
|
||||||
|
|
||||||
: help-stylesheet ( -- string )
|
: help-stylesheet ( -- xml )
|
||||||
"vocab:help/html/stylesheet.css" ascii file-contents
|
"vocab:help/html/stylesheet.css" ascii file-contents
|
||||||
[XML <style><-></style> XML] ;
|
[XML <style><-></style> XML] ;
|
||||||
|
|
||||||
|
: help-navbar ( -- xml )
|
||||||
|
[XML
|
||||||
|
<div class="navbar">
|
||||||
|
<b> Factor Documentation </b> |
|
||||||
|
<a href="/">Home</a> |
|
||||||
|
<a href="article-conventions.html">Glossary</a> |
|
||||||
|
<form method="post" action="/search" style="display:inline;">
|
||||||
|
<input name="search" type="text"/>
|
||||||
|
<button type="submit">Search</button>
|
||||||
|
</form>
|
||||||
|
<a href="http://factorcode.org" style="float:right; padding: 4px;">factorcode.org</a>
|
||||||
|
</div>
|
||||||
|
XML] ;
|
||||||
|
|
||||||
: help>html ( topic -- xml )
|
: help>html ( topic -- xml )
|
||||||
[ article-title ]
|
[ article-title " - Factor Documentation" append ]
|
||||||
[ drop help-stylesheet ]
|
[ drop help-stylesheet ]
|
||||||
[ [ print-topic ] with-html-writer ]
|
[ [ print-topic ] with-html-writer help-navbar prepend ]
|
||||||
tri simple-page ;
|
tri simple-page ;
|
||||||
|
|
||||||
: generate-help-file ( topic -- )
|
: generate-help-file ( topic -- )
|
||||||
|
|
|
@ -2,3 +2,11 @@ a:link { text-decoration: none; color: #104e8b; }
|
||||||
a:visited { text-decoration: none; color: #104e8b; }
|
a:visited { text-decoration: none; color: #104e8b; }
|
||||||
a:active { text-decoration: none; color: #104e8b; }
|
a:active { text-decoration: none; color: #104e8b; }
|
||||||
a:hover { text-decoration: underline; 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;
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors db.sqlite furnace.actions furnace.alloy kernel
|
USING: accessors db.sqlite furnace.actions furnace.alloy
|
||||||
http.server.dispatchers http.server.static furnace.redirection
|
furnace.redirection help.html help.topics html.components
|
||||||
urls validators locals io.files io.directories help.html
|
html.forms html.templates.chloe http.server
|
||||||
html.forms html.components http.server namespaces ;
|
http.server.dispatchers http.server.static io.directories
|
||||||
|
io.files kernel locals namespaces sequences unicode.categories
|
||||||
|
urls ;
|
||||||
IN: webapps.help
|
IN: webapps.help
|
||||||
|
|
||||||
TUPLE: help-webapp < dispatcher ;
|
TUPLE: help-webapp < dispatcher ;
|
||||||
|
@ -15,36 +17,34 @@ M: result link-href href>> ;
|
||||||
:: <search-action> ( help-dir -- action )
|
:: <search-action> ( help-dir -- action )
|
||||||
<page-action>
|
<page-action>
|
||||||
{ help-webapp "search" } >>template
|
{ help-webapp "search" } >>template
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
"search" param [ blank? ] trim [
|
||||||
{ "search" [ 1 v-min-length 50 v-max-length v-one-line ] }
|
help-dir [
|
||||||
} validate-params
|
[ article-apropos "articles" set-value ]
|
||||||
|
[ word-apropos "words" set-value ]
|
||||||
help-dir [
|
[ vocab-apropos "vocabs" set-value ] tri
|
||||||
"search" value article-apropos "articles" set-value
|
] with-directory
|
||||||
"search" value word-apropos "words" set-value
|
] unless-empty
|
||||||
"search" value vocab-apropos "vocabs" set-value
|
|
||||||
] with-directory
|
|
||||||
|
|
||||||
{ help-webapp "search" } <chloe-content>
|
{ help-webapp "search" } <chloe-content>
|
||||||
] >>submit ;
|
] >>submit ;
|
||||||
|
|
||||||
: <main-action> ( -- action )
|
: help-url ( topic -- url )
|
||||||
<page-action>
|
topic>filename "$help-webapp/content/" prepend >url ;
|
||||||
{ help-webapp "help" } >>template ;
|
|
||||||
|
|
||||||
:: <help-webapp> ( help-dir help-db -- webapp )
|
: <main-action> ( -- action )
|
||||||
|
<action>
|
||||||
|
[ "handbook" >link help-url <redirect> ] >>display ;
|
||||||
|
|
||||||
|
:: <help-webapp> ( help-dir -- webapp )
|
||||||
help-webapp new-dispatcher
|
help-webapp new-dispatcher
|
||||||
<main-action> "" add-responder
|
<main-action> "" add-responder
|
||||||
help-dir <search-action> help-db [ <alloy> ] when* "search" add-responder
|
help-dir <search-action> "search" add-responder
|
||||||
help-dir <static> "content" add-responder
|
help-dir <static> "content" add-responder
|
||||||
"resource:basis/definitions/icons/" <static> "icons" add-responder ;
|
"resource:basis/definitions/icons/" <static> "icons" add-responder ;
|
||||||
|
|
||||||
: run-help-webapp ( -- )
|
: run-help-webapp ( -- )
|
||||||
"resource:temp/docs"
|
"resource:temp/docs" <help-webapp>
|
||||||
"resource:help.db" <sqlite-db>
|
|
||||||
<help-webapp>
|
|
||||||
main-responder set-global
|
main-responder set-global
|
||||||
8080 httpd drop ;
|
8080 httpd drop ;
|
||||||
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
|
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<title>Factor Documentation</title>
|
|
||||||
<t:base t:href="$help-webapp" />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<frameset cols="30%, 70%">
|
|
||||||
<frame src="search" name="search" />
|
|
||||||
<frame src="content/article-handbook.html" name="content" />
|
|
||||||
</frameset>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
</t:chloe>
|
|
|
@ -5,72 +5,80 @@
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<t:base t:href="$help-webapp/content/" />
|
|
||||||
|
|
||||||
<style>
|
<t:base t:href="$help-webapp/content/" />
|
||||||
body { font-family: sans-serif; font-size: 85%; }
|
<title>Search - Factor Documentation</title>
|
||||||
a:link { text-decoration: none; color: #00004c; }
|
<style>
|
||||||
a:visited { text-decoration: none; color: #00004c; }
|
a:link { text-decoration: none; color: #104e8b; }
|
||||||
a:active { text-decoration: none; color: #00004c; }
|
a:visited { text-decoration: none; color: #104e8b; }
|
||||||
a:hover { text-decoration: underline; color: #00004c; }
|
a:active { text-decoration: none; color: #104e8b; }
|
||||||
span.error { display: block; color: red; }
|
a:hover { text-decoration: underline; color: #104e8b; }
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
body {
|
||||||
<h1><t:a t:href="$help-webapp/content/article-handbook.html"
|
font-family: sans-serif; font-style: normal
|
||||||
target="content">Factor documentation</t:a></h1>
|
font-size: 12pt;
|
||||||
|
}
|
||||||
|
|
||||||
<p>This is the <a href="http://factorcode.org" target="_top">Factor</a>
|
.navbar {
|
||||||
documentation, generated offline from a
|
background-color: #eeeee0;
|
||||||
<code>load-all</code> image. If you want, you can also browse the
|
padding: 5px;
|
||||||
documentation from within the <a href="http://factorcode.org" target="_top">Factor</a> UI.</p>
|
border: 1px solid #ccc;
|
||||||
|
font:9pt "Lucida Grande", "Lucida Sans Unicode", verdana, geneva, sans-serif;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
<p>You may search article titles below; for example, try searching for "HTTP".</p>
|
h2 { background-color: #f5f5f5; color: #222; }
|
||||||
|
hr { border: 0; background-color: #ccc; color: #ccc; height: 1px; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
<t:form t:action="$help-webapp/search">
|
<body>
|
||||||
<t:field t:name="search" />
|
<div class="navbar">
|
||||||
<button type="submit">Search</button>
|
<b> Factor Documentation </b> |
|
||||||
</t:form>
|
<a href="/">Home</a> |
|
||||||
|
<a href="article-conventions.html">Glossary</a> |
|
||||||
|
<t:form t:action="$help-webapp/search" style="display:inline;">
|
||||||
|
<t:field t:name="search" />
|
||||||
|
<button type="submit">Search</button>
|
||||||
|
</t:form>
|
||||||
|
<a href="http://factorcode.org" style="float:right; padding: 4px;" >factorcode.org</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<t:if t:value="articles">
|
<t:if t:value="articles">
|
||||||
<hr/>
|
<h2>Articles</h2>
|
||||||
|
<ul>
|
||||||
|
<t:each t:name="articles">
|
||||||
|
<li> <t:link t:name="value" /> </li>
|
||||||
|
</t:each>
|
||||||
|
</ul>
|
||||||
|
</t:if>
|
||||||
|
|
||||||
<h2>Articles</h2>
|
<t:if t:value="vocabs">
|
||||||
|
<h2>Vocabularies</h2>
|
||||||
|
<ul>
|
||||||
|
<t:each t:name="vocabs">
|
||||||
|
<li> <t:link t:name="value" /> </li>
|
||||||
|
</t:each>
|
||||||
|
</ul>
|
||||||
|
</t:if>
|
||||||
|
|
||||||
<ul>
|
<t:if t:value="words">
|
||||||
<t:each t:name="articles">
|
<h2>Words</h2>
|
||||||
<li> <t:link t:name="value" t:target="content" /> </li>
|
<ul>
|
||||||
</t:each>
|
<t:each t:name="words">
|
||||||
</ul>
|
<li> <t:link t:name="value" /> </li>
|
||||||
</t:if>
|
</t:each>
|
||||||
|
</ul>
|
||||||
|
</t:if>
|
||||||
|
|
||||||
<t:if t:value="vocabs">
|
<hr />
|
||||||
<hr/>
|
<p>This is the <a href="http://factorcode.org" target="_top">Factor</a>
|
||||||
|
documentation, generated offline from a
|
||||||
|
<code>load-all</code> image. If you want, you can also browse the
|
||||||
|
documentation from within the <a href="http://factorcode.org" target="_top">Factor</a> UI.</p>
|
||||||
|
|
||||||
<h2>Vocabularies</h2>
|
</body>
|
||||||
|
|
||||||
<ul>
|
|
||||||
<t:each t:name="vocabs">
|
|
||||||
<li> <t:link t:name="value" t:target="content" /> </li>
|
|
||||||
</t:each>
|
|
||||||
</ul>
|
|
||||||
</t:if>
|
|
||||||
|
|
||||||
<t:if t:value="words">
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<h2>Words</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<t:each t:name="words">
|
|
||||||
<li> <t:link t:name="value" t:target="content" /> </li>
|
|
||||||
</t:each>
|
|
||||||
</ul>
|
|
||||||
</t:if>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
</t:chloe>
|
</t:chloe>
|
||||||
|
|
|
@ -89,7 +89,7 @@ SYMBOLS: key-password key-file dh-file ;
|
||||||
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> "pastebin" add-responder
|
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> "pastebin" add-responder
|
||||||
<planet> <login-config> <factor-boilerplate> "planet" add-responder
|
<planet> <login-config> <factor-boilerplate> "planet" add-responder
|
||||||
<mason-app> <login-config> <factor-boilerplate> "mason" add-responder
|
<mason-app> <login-config> <factor-boilerplate> "mason" add-responder
|
||||||
"/tmp/docs/" f <help-webapp> "docs" add-responder
|
"/tmp/docs/" <help-webapp> "docs" add-responder
|
||||||
website-db <alloy>
|
website-db <alloy>
|
||||||
main-responder set-global ;
|
main-responder set-global ;
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ SYMBOLS: key-password key-file dh-file ;
|
||||||
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> website-db <alloy> "paste.factorcode.org" add-responder
|
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> website-db <alloy> "paste.factorcode.org" add-responder
|
||||||
<planet> <login-config> <factor-boilerplate> website-db <alloy> "planet.factorcode.org" add-responder
|
<planet> <login-config> <factor-boilerplate> website-db <alloy> "planet.factorcode.org" add-responder
|
||||||
<mason-app> <login-config> <factor-boilerplate> website-db <alloy> "builds.factorcode.org" add-responder
|
<mason-app> <login-config> <factor-boilerplate> website-db <alloy> "builds.factorcode.org" add-responder
|
||||||
home "docs" append-path website-db <help-webapp> "docs.factorcode.org" add-responder
|
home "docs" append-path <help-webapp> "docs.factorcode.org" add-responder
|
||||||
home "cgi" append-path <gitweb> "gitweb.factorcode.org" add-responder
|
home "cgi" append-path <gitweb> "gitweb.factorcode.org" add-responder
|
||||||
main-responder set-global ;
|
main-responder set-global ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue