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.
-
-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.
+You can now click *Edit* below and begin editing the content of the [[Front Page]]. More information at [[Wiki Help]].
--- /dev/null
+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]].
<article> select-tuple
dup [ revision>> <revision> select-tuple ] when ;
+: init-relative-link-prefix ( -- )
+ URL" $wiki/view/" adjust-url present relative-link-prefix set ;
+
: <view-article-action> ( -- action )
<action>
[
validate-title
+ init-relative-link-prefix
] >>init
[
validate-integer-id
"id" value <revision>
select-tuple from-object
- URL" $wiki/view/" adjust-url present relative-link-prefix set
+ init-relative-link-prefix
] >>init
{ wiki "view" } >>template
: init-wiki ( -- )
"resource:extra/webapps/wiki/initial-content" directory* keys
[
- [ ascii file-contents ] [ file-name "." split1 drop ] bi
- f <revision>
- swap >>title
- swap >>content
- "slava" >>author
- now >>date
- add-revision
+ dup file-name ".txt" ?tail [
+ swap ascii file-contents
+ f <revision>
+ swap >>content
+ swap >>title
+ "slava" >>author
+ now >>date
+ add-revision
+ ] [ 2drop ] if
] each ;