diff --git a/basis/furnace/alloy/alloy.factor b/basis/furnace/alloy/alloy.factor index f27c7d67c0..684c4aef4c 100644 --- a/basis/furnace/alloy/alloy.factor +++ b/basis/furnace/alloy/alloy.factor @@ -20,10 +20,11 @@ IN: furnace.alloy ] call ; -: state-classes { session aside conversation permit user } ; inline +: state-classes { session aside conversation permit } ; inline : init-furnace-tables ( -- ) - state-classes ensure-tables ; + state-classes ensure-tables + user ensure-table ; : start-expiring ( db params -- ) '[ diff --git a/basis/html/components/components.factor b/basis/html/components/components.factor index 6965cb582a..9ade669157 100644 --- a/basis/html/components/components.factor +++ b/basis/html/components/components.factor @@ -144,7 +144,7 @@ M: code render* [ string-lines ] [ drop ] [ mode>> value ] tri* htmlize-lines ; ! Farkup component -TUPLE: farkup no-follow disable-images ; +TUPLE: farkup no-follow disable-images parsed ; : string>boolean ( string -- boolean ) { @@ -154,9 +154,11 @@ TUPLE: farkup no-follow disable-images ; M: farkup render* [ + nip [ no-follow>> [ string>boolean link-no-follow? set ] when* ] - [ disable-images>> [ string>boolean disable-images? set ] when* ] bi - drop string-lines "\n" join write-farkup + [ disable-images>> [ string>boolean disable-images? set ] when* ] + [ parsed>> string>boolean [ (write-farkup) ] [ write-farkup ] if ] + tri ] with-scope ; ! Inspector component diff --git a/extra/webapps/wiki/view.xml b/extra/webapps/wiki/view.xml index 5136e4945d..e3774bbe0b 100644 --- a/extra/webapps/wiki/view.xml +++ b/extra/webapps/wiki/view.xml @@ -5,7 +5,7 @@
- +

diff --git a/extra/webapps/wiki/wiki-common.xml b/extra/webapps/wiki/wiki-common.xml index 6a90f0d0de..628485955e 100644 --- a/extra/webapps/wiki/wiki-common.xml +++ b/extra/webapps/wiki/wiki-common.xml @@ -20,7 +20,7 @@ - + @@ -59,7 +59,7 @@ - + diff --git a/extra/webapps/wiki/wiki.factor b/extra/webapps/wiki/wiki.factor index 7165f169c5..420d71d26b 100644 --- a/extra/webapps/wiki/wiki.factor +++ b/extra/webapps/wiki/wiki.factor @@ -47,7 +47,7 @@ article "ARTICLES" { :

( title -- article ) article new swap >>title ; -TUPLE: revision id title author date content html description ; +TUPLE: revision id title author date content parsed description ; revision "REVISIONS" { { "id" "ID" INTEGER +db-assigned-id+ } @@ -55,7 +55,7 @@ revision "REVISIONS" { { "author" "AUTHOR" { VARCHAR 256 } +not-null+ } ! uid { "date" "DATE" TIMESTAMP +not-null+ } { "content" "CONTENT" TEXT +not-null+ } - { "html" "HTML" TEXT +not-null+ } ! Farkup converted to HTML + { "parsed" "PARSED" FACTOR-BLOB +not-null+ } ! Farkup AST { "description" "DESCRIPTION" TEXT } } define-persistent @@ -73,7 +73,7 @@ M: revision feed-entry-url id>> revision-url ; revision new swap >>id ; : compute-html ( revision -- ) - dup content>> convert-farkup >>html drop ; + dup content>> parse-farkup >>parsed drop ; : validate-title ( -- ) { { "title" [ v-one-line ] } } validate-params ; @@ -348,6 +348,9 @@ M: revision feed-entry-url id>> revision-url ; "Contents" latest-revision [ "contents" [ from-object ] nest-form ] when* "Footer" latest-revision [ "footer" [ from-object ] nest-form ] when* ; +: init-relative-link-prefix ( -- ) + URL" $wiki/view/" adjust-url present relative-link-prefix set ; + : ( -- dispatcher ) wiki new-dispatcher "" add-responder @@ -367,7 +370,7 @@ M: revision feed-entry-url id>> revision-url ; "changes.atom" add-responder "delete" add-responder - [ init-sidebars ] >>init + [ init-sidebars init-relative-link-prefix ] >>init { wiki "wiki-common" } >>template ; : init-wiki ( -- )