Fix init-wiki
parent
a604a2f30b
commit
9f342ad697
|
@ -1,5 +1,3 @@
|
||||||
Congratulations, you are now running your very own Wiki.
|
Congratulations, you are now running your very own Wiki.
|
||||||
|
|
||||||
You can now click *Edit* below and begin editing the content of the [[Front Page]]. This Wiki uses [[Farkup]] to mark up text.
|
You can now click *Edit* below and begin editing the content of the [[Front Page]]. More information at [[Wiki Help]].
|
||||||
|
|
||||||
Two special article names are recognized by the Wiki: [[Sidebar]] and [[Footer]]. They do not exist by default, but if you create them, they will be visible on every page.
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
This Wiki uses [[Farkup]] to mark up text.
|
||||||
|
|
||||||
|
Two special article names are recognized by the Wiki: [[Sidebar]] and [[Footer]]. They do not exist by default, but if you create them, they will be visible on every page.
|
||||||
|
|
||||||
|
The Wiki supports hierarchical article organization. You can separate components in article names with slashes, and Wiki links only display the last component. An example: [[Factor/Features]].
|
|
@ -89,6 +89,9 @@ M: revision feed-entry-url id>> revision-url ;
|
||||||
<article> select-tuple
|
<article> select-tuple
|
||||||
dup [ revision>> <revision> select-tuple ] when ;
|
dup [ revision>> <revision> select-tuple ] when ;
|
||||||
|
|
||||||
|
: init-relative-link-prefix ( -- )
|
||||||
|
URL" $wiki/view/" adjust-url present relative-link-prefix set ;
|
||||||
|
|
||||||
: <view-article-action> ( -- action )
|
: <view-article-action> ( -- action )
|
||||||
<action>
|
<action>
|
||||||
|
|
||||||
|
@ -96,6 +99,7 @@ M: revision feed-entry-url id>> revision-url ;
|
||||||
|
|
||||||
[
|
[
|
||||||
validate-title
|
validate-title
|
||||||
|
init-relative-link-prefix
|
||||||
] >>init
|
] >>init
|
||||||
|
|
||||||
[
|
[
|
||||||
|
@ -118,7 +122,7 @@ M: revision feed-entry-url id>> revision-url ;
|
||||||
validate-integer-id
|
validate-integer-id
|
||||||
"id" value <revision>
|
"id" value <revision>
|
||||||
select-tuple from-object
|
select-tuple from-object
|
||||||
URL" $wiki/view/" adjust-url present relative-link-prefix set
|
init-relative-link-prefix
|
||||||
] >>init
|
] >>init
|
||||||
|
|
||||||
{ wiki "view" } >>template
|
{ wiki "view" } >>template
|
||||||
|
@ -370,11 +374,13 @@ M: revision feed-entry-url id>> revision-url ;
|
||||||
: init-wiki ( -- )
|
: init-wiki ( -- )
|
||||||
"resource:extra/webapps/wiki/initial-content" directory* keys
|
"resource:extra/webapps/wiki/initial-content" directory* keys
|
||||||
[
|
[
|
||||||
[ ascii file-contents ] [ file-name "." split1 drop ] bi
|
dup file-name ".txt" ?tail [
|
||||||
|
swap ascii file-contents
|
||||||
f <revision>
|
f <revision>
|
||||||
swap >>title
|
|
||||||
swap >>content
|
swap >>content
|
||||||
|
swap >>title
|
||||||
"slava" >>author
|
"slava" >>author
|
||||||
now >>date
|
now >>date
|
||||||
add-revision
|
add-revision
|
||||||
|
] [ 2drop ] if
|
||||||
] each ;
|
] each ;
|
||||||
|
|
Loading…
Reference in New Issue