<check-form-submissions>
] 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 -- )
'[
[ 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 )
{
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
: <article> ( 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+ }
{ "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
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 ;
"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 ;
+
: <wiki> ( -- dispatcher )
wiki new-dispatcher
<main-article-action> "" add-responder
<list-changes-feed-action> "changes.atom" add-responder
<delete-action> "delete" add-responder
<boilerplate>
- [ init-sidebars ] >>init
+ [ init-sidebars init-relative-link-prefix ] >>init
{ wiki "wiki-common" } >>template ;
: init-wiki ( -- )