websites.factorcode: new factorcode.org site, just like the old factorcode.org site

db4
Slava Pestov 2010-09-27 21:14:22 -07:00
parent 794d371444
commit acdcc9ac26
6 changed files with 252 additions and 9 deletions

View File

@ -26,7 +26,8 @@ webapps.wiki
webapps.user-admin
webapps.help
webapps.mason
webapps.mason.backend ;
webapps.mason.backend
websites.factorcode ;
IN: websites.concatenative
: test-db ( -- db ) "resource:test.db" <sqlite-db> ;
@ -44,11 +45,11 @@ IN: websites.concatenative
} ensure-tables
] with-db ;
TUPLE: factor-website < dispatcher ;
TUPLE: concatenative-website < dispatcher ;
: <factor-boilerplate> ( responder -- responder' )
<boilerplate>
{ factor-website "page" } >>template ;
{ concatenative-website "page" } >>template ;
: <login-config> ( responder -- responder' )
"Factor website" <login-realm>
@ -64,8 +65,8 @@ TUPLE: factor-website < dispatcher ;
"6LeJWQgAAAAAAFlYV7SuBClE9uSpGtV_ZS-qVON7" >>public-key
"6LeJWQgAAAAAALh-XJgSSQ6xKygRgJ8-029Ip2Xv" >>private-key ;
: <factor-website> ( -- responder )
factor-website new-dispatcher
: <concatenative-website> ( -- responder )
concatenative-website new-dispatcher
URL" /wiki/view/Front Page" <redirect-responder> "" add-responder ;
SYMBOL: key-password
@ -84,7 +85,7 @@ SYMBOL: dh-file
"vocab:openssl/test/server.pem" key-file set-global
"password" key-password set-global
common-configuration
<factor-website>
<concatenative-website>
<wiki> <login-config> <factor-boilerplate> "wiki" add-responder
<user-admin> <login-config> <factor-boilerplate> "user-admin" add-responder
<pastebin> <factor-recaptcha> <login-config> <factor-boilerplate> "pastebin" add-responder
@ -102,7 +103,7 @@ SYMBOL: dh-file
: init-production ( -- )
common-configuration
<vhost-dispatcher>
<factor-website>
<concatenative-website>
<wiki> "wiki" add-responder
<user-admin> "user-admin" add-responder
<login-config> <factor-boilerplate> test-db <alloy> "concatenative.org" add-responder
@ -111,6 +112,7 @@ SYMBOL: dh-file
<mason-app> <login-config> <factor-boilerplate> test-db <alloy> "builds.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
<factor-website> "new.factorcode.org" add-responder
main-responder set-global ;
: <factor-secure-config> ( -- config )
@ -119,7 +121,7 @@ SYMBOL: dh-file
dh-file get >>dh-file
key-password get >>password ;
: <factor-website-server> ( -- threaded-server )
: <concatenative-website-server> ( -- threaded-server )
<http-server>
<factor-secure-config> >>secure-config
8080 >>insecure
@ -129,4 +131,4 @@ SYMBOL: dh-file
test-db start-expiring
test-db start-update-task
http-insomniac
<factor-website-server> start-server ;
<concatenative-website-server> start-server ;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,17 @@
! Copyright (c) 2010 Slava Pestov
! See http://factorcode.org/license.txt for BSD license.
USING: accessors http.server http.server.dispatchers
http.server.static kernel namespaces sequences ;
IN: websites.factorcode
SYMBOL: users
: <factor-website> ( -- website )
<dispatcher>
"resource:extra/websites/factorcode/" <static> >>default
users get [
[ "/home/" "/www/" surround <static> ] keep add-responder
] each ;
: init-testing ( -- )
<factor-website> main-responder set-global ;

View File

@ -0,0 +1,80 @@
<% USING: namespaces http.client kernel io.files splitting random io io.encodings.utf8 sequences ; %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Factor programming language</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8" />
</head>
<body>
<div><img src="logo.png" alt="Factor programming language" /></div>
<table border="0" width="100%">
<tr>
<td width="50%" valign="top">
<h1>Why Factor?</h1>
<p>The <big>Factor programming language</big> combines <a href="http://concatenative.org/wiki/view/Factor/Features/The%20language">powerful language features</a> with a <a href="http://docs.factorcode.org/content/article-vocab-index.html">full-featured library</a>. The implementation is <a href="http://concatenative.org/wiki/view/Factor/Optimizing%20compiler">fully compiled</a> for performance, while still supporting <a href="http://concatenative.org/wiki/view/Factor/Interactive development">interactive development</a>. Factor applications are portable between all common platforms. Factor can <a href="http://concatenative.org/wiki/view/Factor/Deployment">deploy stand-alone applications</a> on all platforms. Full source code for the Factor project is available under a <a href="http://factorcode.org/license.txt">BSD license</a>.</p>
<ul>
<li>Screenshots: <a href="http://factorcode.org/factor-macosx.png">Mac OS X</a>, <a href="http://factorcode.org/factor-windows7.png">Windows</a></li>
<li><a href="http://concatenative.org/wiki/view/Factor">Learn more about Factor</a></li>
<li><a href="http://concatenative.org/wiki/view/Factor/Learning">Get started programming with Factor</a></li>
<li><a href="http://concatenative.org/wiki/view/Factor/FAQ">Get answers to frequently-asked questions</a></li>
<li><a href="http://docs.factorcode.org/">Read Factor reference documentation online</a></li>
<li><a href="http://concatenative.org/wiki/view/Concatenative%20language">Learn more about concatenative programming</a></li>
</ul>
<p>Most of the above links point to pages on the <a href="http://concatenative.org">concatenative.org wiki</a>.</p>
</td>
<td width="50%" valign="top">
<h1>Show me some code!</h1>
<p>Factor belongs to the family of <em><a href="http://concatenative.org/wiki/view/Concatenative%20language">concatenative languages</a></em>: this means that, at the lowest level, a Factor program is a series of words (functions) that manipulate a stack of references to dynamically-typed values. This gives the language a powerful foundation which allows many abstractions and paradigms to be built on top. Reload this page to see a random code example below.</p>
<pre>
<%
"/var/www/factorcode.org/newsite/examples.txt" utf8 file-lines
{ "----" } split random "\n" join write
%>
</pre>
<p>See the <a href="http://concatenative.org/wiki/view/Factor/Examples">example programs</a> page on the wiki for more.</p>
</td>
</tr>
</table>
<h1>Downloads</h1>
<p>To download a binary, follow the link corresponding to your computer's CPU/OS configuration. Binary packages are the recommended route for new users who wish to try Factor.</p>
<%
"http://builds.factorcode.org/downloads" http-get nip write
%>
<p><b>Source code</b> is stored in our <a href="http://concatenative.org/wiki/view/Factor/GIT repository">GIT repository</a>. Source can can be browsed online via <a href="http://github.com/slavapestov/factor/">github</a> or <a href="http://gitweb.factorcode.org/">gitweb</a>.</p>
<h1>More</h1>
<ul>
<li><a href="http://concatenative.org/wiki/view/Factor/Mailing list">Join the mailing list</a></li>
<li><a href="http://concatenative.org/wiki/view/Concatenative IRC channel">Join the IRC channel</a></li>
<li><a href="http://planet.factorcode.org/">planet.factorcode.org</a> - Factor community blogs</li>
<li><a href="http://concatenative.org/wiki/view/Concatenative%20language/Publications">Academic publications</a></li>
<li><a href="http://paste.factorcode.org/">Factor community pastebin</a> - if you're in an IRC channel and want to share some code</li>
</ul>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -0,0 +1,144 @@
body {
font:75%/1.6em "Lucida Grande", "Lucida Sans Unicode", verdana, geneva, sans-serif;
}
ul {
margin:10px 10px 10px 0;
padding:0 0 0 15px;
}
li {
margin:0 0 0 10px;
padding:5px;
}
a {
color:#222;
border-bottom:1px solid #aaa;
text-decoration:none;
}
a:hover {
border-bottom:1px solid #ccc;
}
ol.subnav {
margin:-10px -10px 0 -5px;
padding:0;
}
ol.subnav li {
font:85%/0.9em "Lucida Grande", "Lucida Sans Unicode", verdana, geneva, sans-serif;
float:left;
list-style:none;
margin:0;
padding:0;
}
ol.subnav a {
font-weight:bold;
color:#555;
border-top:2px solid #fff;
display:block;
padding:5px;
text-decoration:none;
margin:0 5px 0 0;
border-bottom:none;
}
ol.subnav a:hover {
border-top:2px solid #943329;
color:#121212;
border-bottom:none;
}
#downloads {
width: 520px;
padding: 0;
margin: 0;
}
caption {
padding: 0 0 5px 0;
width: 520px;
font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
text-align: right;
}
th {
font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #4f6b72;
border-right: 1px solid #C1DAD7;
border-bottom: 1px solid #C1DAD7;
border-top: 1px solid #C1DAD7;
letter-spacing: 2px;
text-transform: uppercase;
padding: 6px 6px 6px 6px;
background: #CAE8EA url(bg_header.jpg) no-repeat;
}
th.nobg {
border-top: 0;
border-left: 0;
border-right: 1px solid #C1DAD7;
background: none;
}
pre {
border: 1px dashed #ccc;
background-color: #f5f5f5;
font-size: 120%;
}
td.alt {
background: #F5FAFA;
color: #797268;
}
td.doesnotexist {
background: #E5EAEA;
}
td.unsupported {
background: #ffaaaa;
}
td.supported {
background: #aaffaa;
}
td.supported :hover { background-color: #88ff88; }
td.nobinary {
background: #eeee88;
}
div.bigdiv {
width: 100px;
text-align: center;
color: #050;
}
th.spec {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #fff;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
th.specalt {
border-left: 1px solid #C1DAD7;
border-top: 0;
background: #f5fafa;
font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
color: #797268;
}
th.allbg {
border-top: 0;
border-left: 0;
border-right: 0;
background: none;
}