diff --git a/extra/websites/concatenative/concatenative.factor b/extra/websites/concatenative/concatenative.factor index 61b4f7d887..379ba32a57 100644 --- a/extra/websites/concatenative/concatenative.factor +++ b/extra/websites/concatenative/concatenative.factor @@ -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" ; @@ -44,11 +45,11 @@ IN: websites.concatenative } ensure-tables ] with-db ; -TUPLE: factor-website < dispatcher ; +TUPLE: concatenative-website < dispatcher ; : ( responder -- responder' ) - { factor-website "page" } >>template ; + { concatenative-website "page" } >>template ; : ( responder -- responder' ) "Factor website" @@ -64,8 +65,8 @@ TUPLE: factor-website < dispatcher ; "6LeJWQgAAAAAAFlYV7SuBClE9uSpGtV_ZS-qVON7" >>public-key "6LeJWQgAAAAAALh-XJgSSQ6xKygRgJ8-029Ip2Xv" >>private-key ; -: ( -- responder ) - factor-website new-dispatcher +: ( -- responder ) + concatenative-website new-dispatcher URL" /wiki/view/Front Page" "" 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 - + "wiki" add-responder "user-admin" add-responder "pastebin" add-responder @@ -102,7 +103,7 @@ SYMBOL: dh-file : init-production ( -- ) common-configuration - + "wiki" add-responder "user-admin" add-responder test-db "concatenative.org" add-responder @@ -111,6 +112,7 @@ SYMBOL: dh-file test-db "builds.factorcode.org" add-responder home "docs" append-path "docs.factorcode.org" add-responder home "cgi" append-path "gitweb.factorcode.org" add-responder + "new.factorcode.org" add-responder main-responder set-global ; : ( -- config ) @@ -119,7 +121,7 @@ SYMBOL: dh-file dh-file get >>dh-file key-password get >>password ; -: ( -- threaded-server ) +: ( -- threaded-server ) >>secure-config 8080 >>insecure @@ -129,4 +131,4 @@ SYMBOL: dh-file test-db start-expiring test-db start-update-task http-insomniac - start-server ; + start-server ; diff --git a/extra/websites/factorcode/bg_header.jpg b/extra/websites/factorcode/bg_header.jpg new file mode 100644 index 0000000000..10dbd74e8a Binary files /dev/null and b/extra/websites/factorcode/bg_header.jpg differ diff --git a/extra/websites/factorcode/factorcode.factor b/extra/websites/factorcode/factorcode.factor new file mode 100644 index 0000000000..edf2468024 --- /dev/null +++ b/extra/websites/factorcode/factorcode.factor @@ -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 + +: ( -- website ) + + "resource:extra/websites/factorcode/" >>default + users get [ + [ "/home/" "/www/" surround ] keep add-responder + ] each ; + +: init-testing ( -- ) + main-responder set-global ; diff --git a/extra/websites/factorcode/index.fhtml b/extra/websites/factorcode/index.fhtml new file mode 100644 index 0000000000..5a565bba84 --- /dev/null +++ b/extra/websites/factorcode/index.fhtml @@ -0,0 +1,80 @@ +<% USING: namespaces http.client kernel io.files splitting random io io.encodings.utf8 sequences ; %> + + + + + + + + Factor programming language + + + + + +
Factor programming language
+ + + + + + + + + +
+ +

Why Factor?

+ +

The Factor programming language combines powerful language features with a full-featured library. The implementation is fully compiled for performance, while still supporting interactive development. Factor applications are portable between all common platforms. Factor can deploy stand-alone applications on all platforms. Full source code for the Factor project is available under a BSD license.

+ + + +

Most of the above links point to pages on the concatenative.org wiki.

+
+ +

Show me some code!

+ +

Factor belongs to the family of concatenative languages: 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.

+ +
+<%
+"/var/www/factorcode.org/newsite/examples.txt" utf8 file-lines
+{ "----" } split random "\n" join write
+%>
+
+ +

See the example programs page on the wiki for more.

+ +
+ +

Downloads

+ +

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.

+ +<% +"http://builds.factorcode.org/downloads" http-get nip write +%> + +

Source code is stored in our GIT repository. Source can can be browsed online via github or gitweb.

+ +

More

+ + + + + diff --git a/extra/websites/factorcode/logo.png b/extra/websites/factorcode/logo.png new file mode 100644 index 0000000000..9907d2c727 Binary files /dev/null and b/extra/websites/factorcode/logo.png differ diff --git a/extra/websites/factorcode/master.css b/extra/websites/factorcode/master.css new file mode 100644 index 0000000000..72088b72ab --- /dev/null +++ b/extra/websites/factorcode/master.css @@ -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; +}