gf-Soks 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE.txt +66 -0
- data/README.txt +64 -0
- data/bin/soks-create-wiki.rb +193 -0
- data/contrib/diff/lcs.rb +1105 -0
- data/contrib/diff/lcs/array.rb +21 -0
- data/contrib/diff/lcs/block.rb +51 -0
- data/contrib/diff/lcs/callbacks.rb +322 -0
- data/contrib/diff/lcs/change.rb +169 -0
- data/contrib/diff/lcs/hunk.rb +257 -0
- data/contrib/diff/lcs/ldiff.rb +226 -0
- data/contrib/diff/lcs/string.rb +19 -0
- data/contrib/diff_licence.txt +76 -0
- data/contrib/easyprompt.rb +58 -0
- data/contrib/easyprompt_licence.txt +504 -0
- data/contrib/redcloth-3.0.3.rb +1113 -0
- data/contrib/redcloth_license.txt +27 -0
- data/lib/authenticators.rb +121 -0
- data/lib/helpers/counter-helpers.rb +132 -0
- data/lib/helpers/default-helpers.rb +416 -0
- data/lib/helpers/mail2wiki-helper.rb +105 -0
- data/lib/helpers/maintenance-helpers.rb +149 -0
- data/lib/helpers/rss2wiki-helper.rb +47 -0
- data/lib/helpers/wiki2html.rb +60 -0
- data/lib/soks-model.rb +271 -0
- data/lib/soks-servlet.rb +177 -0
- data/lib/soks-storage.rb +187 -0
- data/lib/soks-upgrade-0.0.2.rb +70 -0
- data/lib/soks-utils.rb +327 -0
- data/lib/soks-view.rb +399 -0
- data/lib/soks.rb +27 -0
- data/rakefile +109 -0
- data/templates/default/attachment/favicon.ico +0 -0
- data/templates/default/attachment/logo.jpg +0 -0
- data/templates/default/attachment/logo.png +0 -0
- data/templates/default/attachment/logo.tiff +0 -0
- data/templates/default/attachment/newpage.js +41 -0
- data/templates/default/attachment/print_stylesheet.css +2 -0
- data/templates/default/attachment/robots.txt +6 -0
- data/templates/default/attachment/rss.png +0 -0
- data/templates/default/attachment/stylesheet.css +219 -0
- data/templates/default/banned_titles.txt +67 -0
- data/templates/default/caches/readme.txt +1 -0
- data/templates/default/content/Api%20for%20classes%20to%20modify%20the%20wiki.textile +30 -0
- data/templates/default/content/Author.textile +16 -0
- data/templates/default/content/Automatic%20Summaries.textile +40 -0
- data/templates/default/content/Automatic%20counters.textile +22 -0
- data/templates/default/content/Automatic%20exporters.textile +23 -0
- data/templates/default/content/Automatic%20importers.textile +59 -0
- data/templates/default/content/Automatic%20linking.textile +7 -0
- data/templates/default/content/Automatic%20maintenance%20helpers.textile +39 -0
- data/templates/default/content/Bug%3A%20Competing%20edits.textile +22 -0
- data/templates/default/content/Bug%3A%20Does%20not%20make%20use%20of%20if%2Dmodified%2Dsince%20r.textile +3 -0
- data/templates/default/content/Bug%3A%20Email%20adresses%20in%20page%20titles%20cause%20incorrec.textile +3 -0
- data/templates/default/content/Bug%3A%20GEM%20limits%20title%20lengths.textile +3 -0
- data/templates/default/content/Bug%3A%20Memory%20leak.textile +13 -0
- data/templates/default/content/Bug%3A%20Page%2Einserted%5Finto%20is%20never%20purged.textile +17 -0
- data/templates/default/content/Bug%3A%20Pages%20that%20link%20here%20may%20not%20appear%20on%20r.textile +13 -0
- data/templates/default/content/Bug%3A%20Textile%20mishandles%20paragraphs.textile +37 -0
- data/templates/default/content/Bug%3A%20Unanticipated%20Rollbacks.textile +23 -0
- data/templates/default/content/Bug%3A%20notextile%20does%20not%20prevent%20page%20inserts.textile +3 -0
- data/templates/default/content/Home%20Page.textile +22 -0
- data/templates/default/content/How%20to%20administrate%20this%20wiki.textile +57 -0
- data/templates/default/content/How%20to%20change%20the%20way%20this%20wiki%20looks.textile +32 -0
- data/templates/default/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +82 -0
- data/templates/default/content/How%20to%20get%20the%20latest%20Soks%20from%20cvs.textile +45 -0
- data/templates/default/content/How%20to%20hack%20soks.textile +66 -0
- data/templates/default/content/How%20to%20import%20a%20site%20from%20instiki.textile +15 -0
- data/templates/default/content/How%20to%20import%20data.textile +41 -0
- data/templates/default/content/How%20to%20install%20Soks.textile +33 -0
- data/templates/default/content/How%20to%20password%20protect%20your%20wiki.textile +53 -0
- data/templates/default/content/How%20to%20re%2Dbuild%20the%20page%20cache.textile +71 -0
- data/templates/default/content/How%20to%20report%20a%20bug.textile +9 -0
- data/templates/default/content/How%20to%20upgrade%20soks.textile +32 -0
- data/templates/default/content/How%20to%20use%20the%20Automatic%20Helper%20classes.textile +12 -0
- data/templates/default/content/How%20to%20use%20this%20wiki.textile +30 -0
- data/templates/default/content/List%20of%20changes.textile +10 -0
- data/templates/default/content/News%3A%20Version%201%2D0%2D0%20released.textile +19 -0
- data/templates/default/content/News%3A%20Version%201%2D0%2D1%20released.textile +12 -0
- data/templates/default/content/Pages%20to%20include%20in%20the%20distribution.textile +55 -0
- data/templates/default/content/Per%20Wiki%20Templates.textile +37 -0
- data/templates/default/content/Picture%20of%20a%20pair%20of%20soks.textile +1 -0
- data/templates/default/content/Planned%20Features.textile +74 -0
- data/templates/default/content/README.textile +64 -0
- data/templates/default/content/RSS%20feed.textile +9 -0
- data/templates/default/content/Recent%20changes%20to%20this%20site.textile +352 -0
- data/templates/default/content/SOKS%20features.textile +19 -0
- data/templates/default/content/Sidebar%20Page.textile +6 -0
- data/templates/default/content/Site%20Index.textile +241 -0
- data/templates/default/content/Soks%27s%20Licence.textile +66 -0
- data/templates/default/content/Tag%3A%20Include%20this%20page%20in%20the%20distribution.textile +6 -0
- data/templates/default/start.rb +90 -0
- data/templates/default/version.txt +1 -0
- data/templates/default/views/Page_content.rhtml +1 -0
- data/templates/default/views/Page_edit.rhtml +79 -0
- data/templates/default/views/Page_find.rhtml +35 -0
- data/templates/default/views/Page_linksfromrss.rhtml +24 -0
- data/templates/default/views/Page_listrss.rhtml +46 -0
- data/templates/default/views/Page_meta.rhtml +44 -0
- data/templates/default/views/Page_print.rhtml +6 -0
- data/templates/default/views/Page_revision.rhtml +39 -0
- data/templates/default/views/Page_revisions.rhtml +36 -0
- data/templates/default/views/Page_rss.rhtml +57 -0
- data/templates/default/views/Page_view.rhtml +8 -0
- data/templates/default/views/UploadPage_edit.rhtml +63 -0
- data/templates/default/views/frame.rhtml +63 -0
- data/templates/default/views/messages.yaml +7 -0
- data/test/html/2006Mar.html +66 -0
- data/test/html/poignant.html +36 -0
- data/test/html/poignant.textile +36 -0
- data/test/mock-objects.rb +69 -0
- data/test/test_counter-helper.rb +162 -0
- data/test/test_soks-helper-maintenance.rb +106 -0
- data/test/test_soks-helpers.rb +145 -0
- data/test/test_soks-model.rb +144 -0
- data/test/test_soks-servlet.rb +240 -0
- data/test/test_soks-storage.rb +108 -0
- data/test/test_soks-utils.rb +226 -0
- data/test/test_soks-view.rb +193 -0
- data/test/test_soks.rb +9 -0
- metadata +182 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
h1. Automatic Exporters
|
|
2
|
+
|
|
3
|
+
There is currently a single class that can keep a static html mirror of a wiki. See how to export a site from this wiki for more occasional exports.
|
|
4
|
+
|
|
5
|
+
h2. Wiki 2 Html
|
|
6
|
+
|
|
7
|
+
This class watches for changes to the wiki, and when they occur, writes an html version of the page into a specificed directory.
|
|
8
|
+
|
|
9
|
+
To use put the following in your start.rb file:
|
|
10
|
+
<pre>
|
|
11
|
+
<code>
|
|
12
|
+
require 'wiki2html'
|
|
13
|
+
Wiki2Html.new(wiki,view,
|
|
14
|
+
:views_to_copy => ['view','meta','rss'], # This is what views of the page to copy accross
|
|
15
|
+
:extension => '.html', # this is the extension to put on the files
|
|
16
|
+
:destination_dir => '/Users/tamc2/Sites', # This is the folder where the html is put
|
|
17
|
+
:destination_url => 'http://localhost/~tamc2') # Where relevant, urls will be rewritten to start with this
|
|
18
|
+
</code>
|
|
19
|
+
</pre>
|
|
20
|
+
|
|
21
|
+
Note, this doesn't copy accross uploads or other static files. You will need to point whatever server you are using to view these files to the attachment directory in the wiki as well.
|
|
22
|
+
|
|
23
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
h1. Automatic Importers
|
|
2
|
+
|
|
3
|
+
There are currently two automatic importers. (You can also manually import data, see how to import data).
|
|
4
|
+
|
|
5
|
+
h2. Mail2WikiHelper
|
|
6
|
+
|
|
7
|
+
The mail to wiki helper periodically scans an email folder on an imap server, and copies messages across to the wiki. Each message is appended to a page with the same name as the email subject and uses the email from address as the author name.
|
|
8
|
+
|
|
9
|
+
p(. What about a pop server? --Bil. Should be a pretty easy rewrite to use NET::POP rather than NET::IMAP, but I unfortunately don't have any POP servers to test with. --tamc
|
|
10
|
+
|
|
11
|
+
*NOTE* This helper ignores the contents of the authenticators array in your start.rb file.
|
|
12
|
+
|
|
13
|
+
To use, put the following in your start.rb file:
|
|
14
|
+
|
|
15
|
+
# @require 'mail2wiki-helper'@
|
|
16
|
+
# @Mail2WikiHelper.new( wiki, :server => 'imap.server', :username => 'user', :password => 'password', :mailbox => 'test')@
|
|
17
|
+
|
|
18
|
+
This will by default scan the mailbox every hour. Once a message has been imported into the wiki it is tagged with a 'PutInWiki' keyword that prevents subsequent re-insertions. To get the message to be re-inserted you must either change the keyword that soks looks for (see below) or unset the keyword using your email program.
|
|
19
|
+
|
|
20
|
+
There are a few other settings you can change:
|
|
21
|
+
<pre>
|
|
22
|
+
<code>
|
|
23
|
+
DEFAULT_SETTINGS = {
|
|
24
|
+
:server => 'imap.hermes.cam.ac.uk',
|
|
25
|
+
:username => 'tamc2',
|
|
26
|
+
:password => 'missing_a_password',
|
|
27
|
+
:mailbox => 'test',
|
|
28
|
+
:check_event => :hour,
|
|
29
|
+
:subject_regexp => /.*/,
|
|
30
|
+
:keyword => 'PutInWiki'
|
|
31
|
+
}
|
|
32
|
+
</code>
|
|
33
|
+
</pre>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
h2. RSS2WikiHelper
|
|
37
|
+
|
|
38
|
+
The rss to wiki helper periodically downloads an rss feed and copies it onto a specified page as a series of links.
|
|
39
|
+
|
|
40
|
+
To use, put the following in your start.rb file:
|
|
41
|
+
|
|
42
|
+
# @require 'rss2wiki-helper'@
|
|
43
|
+
# @RSS2WikiHelper.new( wiki, :url => 'url of rss feed' )@
|
|
44
|
+
|
|
45
|
+
By default it will check once an hour, and write the feed to a page with the same name as the feed title.
|
|
46
|
+
|
|
47
|
+
There are a few other settings you can change:
|
|
48
|
+
<pre>
|
|
49
|
+
<code>
|
|
50
|
+
DEFAULT_SETTINGS = {
|
|
51
|
+
:url => 'http://localhost:8000/rss/recent%20changes%20to%20this%20site',
|
|
52
|
+
:pagename => nil, # If nil, uses channel title,
|
|
53
|
+
:update_on_event => :hour,
|
|
54
|
+
:author => 'AutomaticRSS2Wiki',
|
|
55
|
+
}
|
|
56
|
+
</code>
|
|
57
|
+
</pre>
|
|
58
|
+
|
|
59
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
h1. Automatic linking
|
|
2
|
+
|
|
3
|
+
Any reference to the title of another page in the wiki will be automatically linked. e.g. home page is linked to the home page. The longest possible links are made first.
|
|
4
|
+
|
|
5
|
+
The easiest way to create a new page (if your browser supports it - I can only positively say that Safari does) is to highlight the text you want to link from and press ctrl-n.
|
|
6
|
+
|
|
7
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
h1. Automatic Maintenance Helpers
|
|
2
|
+
|
|
3
|
+
These help with some basic wiki maintenance tasks:
|
|
4
|
+
|
|
5
|
+
h2. Delete Old Pages Helper
|
|
6
|
+
|
|
7
|
+
This permanently deletes deleted pages.
|
|
8
|
+
|
|
9
|
+
To use, put the following in your start.rb file:
|
|
10
|
+
# @require 'maintenance-helpers'@
|
|
11
|
+
# @DeleteOldPagesHelper.new(wiki)@
|
|
12
|
+
|
|
13
|
+
This will by default scan the wiki once per day and permanently delete pages that have been marked for deletiob for more than 100 days.
|
|
14
|
+
|
|
15
|
+
It has two optional parameters: @DeleteOldPagesHelper( event_to_check_on, age_to_wipe_at)@, the first can be :min, :hour, :day, ;month, :year and the age is in seconds.
|
|
16
|
+
|
|
17
|
+
h2. Delete Old Revisions Helper
|
|
18
|
+
|
|
19
|
+
This permanently deletes old revisions.
|
|
20
|
+
|
|
21
|
+
To use, put the following in your start.rb file:
|
|
22
|
+
# @require 'maintenance-helpers'@
|
|
23
|
+
# @DeleteOldRevisionsHelper.new(wiki)@
|
|
24
|
+
|
|
25
|
+
This will by default scan the wiki once per day and permanenty delete revisions that are more than a hundred days old, being sure to leave at least 20 revisions on a page.
|
|
26
|
+
|
|
27
|
+
It has three optional parameters @DeleteOldRevisionsHelper(( wiki, event_to_check_on = :day, age_to_wipe_at = 60*60*24*365, minimum_revisions = 20 )@ the first can be :min, :hour, :day, ;month, :year and the age is in seconds.
|
|
28
|
+
|
|
29
|
+
h2. Merge Old Revisions Helper
|
|
30
|
+
|
|
31
|
+
By default this wakes up each hour and merges all revisions more than 24 hours old, by the same author, and that are created within an hour of each other.
|
|
32
|
+
|
|
33
|
+
To use, put the following in your start.rb file:
|
|
34
|
+
# @require 'maintenance-helpers'@
|
|
35
|
+
# @MergeOldRevisionsHelper.new(wiki)@
|
|
36
|
+
|
|
37
|
+
It has three optional parameters @DeleteOldRevisionsHelper(( wiki, eevent_to_check_on = :day, minimum_age_to_merge = 60*60*24*365, maximum_time_between_revisions_for_merge = 60*60 )@ the first can be :min, :hour, :day, ;month, :year and the age and time are in seconds.
|
|
38
|
+
|
|
39
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
h1. Bug competing edits
|
|
2
|
+
|
|
3
|
+
I had a case today where I was evidently editing a page at the same time someone else was. He won and my edits were trashed upon save. (Or at least this is what I surmise happened.)
|
|
4
|
+
|
|
5
|
+
Is this possible? --Bil
|
|
6
|
+
|
|
7
|
+
Umm, trashed on save? I hope not. I hope that if you look at the 'show all changes' for the page it will show both edits in the history? I *seriously* want to know if they are not.
|
|
8
|
+
|
|
9
|
+
p(. I was paying more attention this time. Two of us were editing the same page.
|
|
10
|
+
I saved my changes, and they showed up on the page.
|
|
11
|
+
Next, he saved his changes, and my changes were removed (but still available
|
|
12
|
+
via the "show all changes"). --Bil
|
|
13
|
+
|
|
14
|
+
As for a solution. There seem to be two routes:
|
|
15
|
+
# Put a 'lock' on the page, so that only one person can see the edit view at once.
|
|
16
|
+
# Try and merge competing edits.
|
|
17
|
+
|
|
18
|
+
I would prefer to merge, but don't know how to implement...
|
|
19
|
+
|
|
20
|
+
--tamc2
|
|
21
|
+
|
|
22
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
There appears to be a memory leak.
|
|
2
|
+
|
|
3
|
+
Not sure what triggers it, and whether it occurs in any versions appart from the one in the CVS.
|
|
4
|
+
|
|
5
|
+
Spotted on this site (www.soks.org) where over a period of a couple of weeks, memory use grew from 47M to 102M. This is a problem for this site as only 64M of virtual memory is available, and so the larger size causes a slow down through swapping.
|
|
6
|
+
|
|
7
|
+
Will investiagate, and would appreciate other reports if anyone has a similar experience.
|
|
8
|
+
|
|
9
|
+
--tamc2
|
|
10
|
+
|
|
11
|
+
This hasn't repeated after that first time. It may have just ben a temporary blip. I'd appreciate any other reports --tamc2
|
|
12
|
+
|
|
13
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
h1. Page.inserted_into is never purged
|
|
2
|
+
|
|
3
|
+
* Your name: tamc
|
|
4
|
+
* Soks version: v1.0.0
|
|
5
|
+
* Your operating system:
|
|
6
|
+
* Your version of ruby:
|
|
7
|
+
* Your browser:
|
|
8
|
+
|
|
9
|
+
h2. And please describe the problem below:
|
|
10
|
+
|
|
11
|
+
If one page is inserted into another, then it is recorded in an array in the Page class. If a page is updated, this allows all the other pages that insert it to be refreshed to be up to date. Unfortunately there is no mechanism to remove this record should the page no longer be inserted. This isn't a big deal, but will result in unncessary refreshes.
|
|
12
|
+
|
|
13
|
+
h2. And if you have any suggestions for the cause or a fix, please put it below:
|
|
14
|
+
|
|
15
|
+
Working on it... (but low priority)
|
|
16
|
+
|
|
17
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
The pages that link here sidebar may not appear if you:
|
|
2
|
+
# Run a soks wiki
|
|
3
|
+
# Shutdown the wiki gracefully so that it saves its caches
|
|
4
|
+
# Modify a wiki page off-line (everything is ok if you add a page)
|
|
5
|
+
# Restart the wiki and it succesfully reloads its caches
|
|
6
|
+
|
|
7
|
+
There are two workarounds:
|
|
8
|
+
# Either delete the caches before restarting in step 4 above
|
|
9
|
+
# Or edit any page in the wiki after restart. The pages that link here sidebar will then reappear.
|
|
10
|
+
|
|
11
|
+
Not sure yet as to the cause of this bug, but it doesn't seem to be a showstopper so I'm going to release v1-0-0 anyway. --tamc
|
|
12
|
+
|
|
13
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
The "paragraph not kept separate" below should appear on a separate line from "A paragraph" but does not.
|
|
2
|
+
|
|
3
|
+
<pre>
|
|
4
|
+
Something
|
|
5
|
+
</pre>
|
|
6
|
+
A paragraph
|
|
7
|
+
|
|
8
|
+
A paragraph not kept separate
|
|
9
|
+
# Blah
|
|
10
|
+
|
|
11
|
+
The cause seems to be some interaction between the pre block and the following list block. Putting a blank line after the pre or before the list makes it function as expected:
|
|
12
|
+
|
|
13
|
+
e.g.
|
|
14
|
+
|
|
15
|
+
<pre>
|
|
16
|
+
Something
|
|
17
|
+
</pre>
|
|
18
|
+
|
|
19
|
+
A paragraph
|
|
20
|
+
|
|
21
|
+
A paragraph not kept separate
|
|
22
|
+
# Blah
|
|
23
|
+
|
|
24
|
+
or
|
|
25
|
+
|
|
26
|
+
<pre>
|
|
27
|
+
Something
|
|
28
|
+
</pre>
|
|
29
|
+
A paragraph
|
|
30
|
+
|
|
31
|
+
A paragraph not kept separate
|
|
32
|
+
|
|
33
|
+
# Blah
|
|
34
|
+
|
|
35
|
+
This is possibly a bug with Redcloth rather than soks.
|
|
36
|
+
|
|
37
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Bil Kleb reports:
|
|
2
|
+
|
|
3
|
+
bq. Unfortunately, I don't have any diagnostic data at
|
|
4
|
+
this point, but I have noticed on 3 occasions
|
|
5
|
+
that my home page has been rolled back to the previous
|
|
6
|
+
version when I restart WEBbrick (or when I moved the
|
|
7
|
+
Wiki to a new location/machine?).
|
|
8
|
+
|
|
9
|
+
I haven't seen this happen, but data loss is a very bad thing, so I would really appreciate any reports anyone has.
|
|
10
|
+
|
|
11
|
+
If it happens, could you let me know:
|
|
12
|
+
|
|
13
|
+
# Is it only ever the home page?
|
|
14
|
+
# If you look at the the revisions (edit, show all changes) does it show that the page has been rolled back, or just that the most recent edit never happened at all?
|
|
15
|
+
# If you look at the content/Home%20Page.yaml file, does it show that the most recent edit ever happened?
|
|
16
|
+
# Which version of the page does the content/Home%20Page.textile file contain?
|
|
17
|
+
# Are the timestamps of the Home%20Page.textile and Home%20Page.yaml files wildly different?
|
|
18
|
+
|
|
19
|
+
Thanks
|
|
20
|
+
|
|
21
|
+
tamc2
|
|
22
|
+
|
|
23
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
h1. Congratulations, you have installed SOKS
|
|
2
|
+
|
|
3
|
+
Soks is a wiki engine, written in the Ruby programming language. Soks's licence is the free and liberal Ruby licence, so please feel free to use and modify it (though the author would appreciate donations, to be used for a new mac).
|
|
4
|
+
|
|
5
|
+
p{background:yellow;padding:10px;}. A limited selection of help and bug reports are included here. For more information, and to share experiences, please visit http://www.soks.org.
|
|
6
|
+
|
|
7
|
+
[[insert SOKS features]]
|
|
8
|
+
|
|
9
|
+
[[insert Instructions and Howtos]]
|
|
10
|
+
|
|
11
|
+
[[insert known bugs]]
|
|
12
|
+
|
|
13
|
+
Be sure to check http://www.soks.org/wiki/KnownBugs for the latest bug reports.
|
|
14
|
+
|
|
15
|
+
h2. Feedback
|
|
16
|
+
|
|
17
|
+
* Please send me your feedback. tamc@rubyforge.com.
|
|
18
|
+
* To keep track of developments, you may wish to subscribe to the mailing list at http://rubyforge.org/projects/soks.
|
|
19
|
+
|
|
20
|
+
[[insert picture of a pair of soks]]
|
|
21
|
+
|
|
22
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
h1. Adjusting the settings
|
|
2
|
+
|
|
3
|
+
Take a look at the start.rb file in your wiki folder. This can be used to change the settings such as port and url of this site, and to enable more advanced features such as calendars and automatic summaries.
|
|
4
|
+
|
|
5
|
+
h2. To start your wiki
|
|
6
|
+
|
|
7
|
+
The soks-create-wiki.rb script will have created a folder in the directory in which you ran it (by default the folder is 'soks-wiki'). In that folder is a script 'start.rb' run it.
|
|
8
|
+
<code>
|
|
9
|
+
cd soks-wiki
|
|
10
|
+
ruby start.rb
|
|
11
|
+
</code>
|
|
12
|
+
|
|
13
|
+
h2. To stop your wiki
|
|
14
|
+
|
|
15
|
+
If you've started the wiki as above, then hold down the ctrl key and press c.
|
|
16
|
+
|
|
17
|
+
If you have run the wiki as a daemon, or using nohup, then you will need to find the process id of the wiki. This can be found by @top@ or @ps -e | grep ruby@. In the first instance, try @kill -INT 123@ where 123 is the number found from top or ps. That will try and make the wiki gracefully shut down. If that doesn't work @kill -KILL 123@ will force the wiki to halt immediately.
|
|
18
|
+
|
|
19
|
+
h2. To make your site accessible beyond localhost
|
|
20
|
+
|
|
21
|
+
Open start.rb in your directory. Find the line:
|
|
22
|
+
|
|
23
|
+
<code>
|
|
24
|
+
view = View.new( wiki, "http://localhost:8000", "#{root_directory}/views" )
|
|
25
|
+
</code>
|
|
26
|
+
|
|
27
|
+
and replace the url with the url and port you wish the wiki to run on.
|
|
28
|
+
|
|
29
|
+
Then replace
|
|
30
|
+
<code>
|
|
31
|
+
server = WEBrick::HTTPServer.new(:Port => 8000 )
|
|
32
|
+
</code>
|
|
33
|
+
|
|
34
|
+
with the port you wish the wiki to run on.
|
|
35
|
+
|
|
36
|
+
h2. To password protect your wiki.
|
|
37
|
+
|
|
38
|
+
See how to password protect your wiki.
|
|
39
|
+
|
|
40
|
+
h2. To edit the default site settings used by soks-create-wiki.rb
|
|
41
|
+
|
|
42
|
+
Edit template/start.rb in the directory where soks was installed.
|
|
43
|
+
|
|
44
|
+
h2. To change how often the wiki checks the content directory for any changes.
|
|
45
|
+
|
|
46
|
+
Open start.rb and change this line:
|
|
47
|
+
<code>
|
|
48
|
+
wiki.check_files_every = :min
|
|
49
|
+
</code>
|
|
50
|
+
|
|
51
|
+
Acceptable values are nil (never), :sec, :min, :hour, :day
|
|
52
|
+
|
|
53
|
+
h2. To add a page that summarises other pages:
|
|
54
|
+
|
|
55
|
+
See Automatic summaries
|
|
56
|
+
|
|
57
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
h1. Improving the style of this wiki
|
|
2
|
+
|
|
3
|
+
If you develop any improvements to the layout and style of this wiki, and are willing to share, please send copies to me tamc@rubyforge.com (a zip of the view and attachment directory is probably the best method).
|
|
4
|
+
|
|
5
|
+
h2. Changing the logo on the right
|
|
6
|
+
|
|
7
|
+
The logo can be changed by replacing logo.jpg in the in the attachment folder of the wiki you have created ( soks-wiki/attachment/logo.tif by default)
|
|
8
|
+
|
|
9
|
+
h2. Changing the color scheme
|
|
10
|
+
|
|
11
|
+
The stylesheet is stored in the attachment folder of the wiki you have created (soks-wiki/attachment/stylesheet.css by default).
|
|
12
|
+
|
|
13
|
+
h2. Changing the html and layout
|
|
14
|
+
|
|
15
|
+
The formatting of the wiki is stored in the views subdirectory of the folder in which the wiki was created (soks-wiki/views by default). These pages are all erb ( www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html ).
|
|
16
|
+
|
|
17
|
+
The folder contains:
|
|
18
|
+
* frame.rhtml - This is the bulk of the html and is used to wrap all pages except those ending in 'print' or 'rss'
|
|
19
|
+
* Page_view.rhtml - This is the 'standard' viewing page
|
|
20
|
+
* Page_edit.rhtml - This is the 'standard' editing page
|
|
21
|
+
* Page_revisions.rhtml - This is the 'standard' revisions page
|
|
22
|
+
* Page_rss.rhtml - This attempts to create a rss feed for changes to the page
|
|
23
|
+
|
|
24
|
+
You can add a new type of view by creating a new file here ending in rthml, starting with Page and with _viewname in the middle. E.g. for a new sort of 'doublesize' view you could create Page_doublesize.rhtml. This would then be accessed by typing /doublesize/pagename as the url.
|
|
25
|
+
|
|
26
|
+
Note that you must restart soks for changes to the template to take effect.
|
|
27
|
+
|
|
28
|
+
h2. Changing the default styles for NEW wikis
|
|
29
|
+
|
|
30
|
+
To change the style and layout of new wikis created using the soks-create-wiki.rb command, then edit the 'template' directory of wherever you installed soks.
|
|
31
|
+
|
|
32
|
+
Tag: Include this page in the distribution
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
h1. How to export a site from this wiki
|
|
2
|
+
|
|
3
|
+
h2. How to export as html
|
|
4
|
+
|
|
5
|
+
Modify your start.rb file to include:
|
|
6
|
+
<pre>
|
|
7
|
+
<code>
|
|
8
|
+
require 'helpers/wiki2html'
|
|
9
|
+
Wiki2Html.new( wiki, view,
|
|
10
|
+
:views_to_copy => ['view','meta','rss'],
|
|
11
|
+
:extension => '.html',
|
|
12
|
+
:destination_dir => '/Users/tamc2/Sites',
|
|
13
|
+
:destination_url => 'http://localhost/~tamc2')
|
|
14
|
+
</code>
|
|
15
|
+
</pre>
|
|
16
|
+
|
|
17
|
+
Where desitination_dir should be the directory you wish to export the html to, and destination_url should be the base_url you wish to use in the exported pages (could be just '/').
|
|
18
|
+
|
|
19
|
+
When you restart the wiki it will then maintain an html copy of the wiki in that directory.
|
|
20
|
+
|
|
21
|
+
h2. How to export the raw data
|
|
22
|
+
|
|
23
|
+
The contents of this site are stored in flat files in the 'contents' folder of this wiki (soks-wiki/contents by default). They are the ones with the .textile ending. Should be pretty easy to transfer them to wherever you need.
|
|
24
|
+
|
|
25
|
+
The authors, and change history of each page are stored in the same folder with a yaml extension. These are yaml'd files that contain many documents. Each document contains a single revision. Each revision is an array of [ revision number, changes, author, creation time ]. The changes is an array of change groups. Each change group is an array of changed lines. There may be several documents with the same revision number. The last document with a particular revision number is the 'definative' one.
|
|
26
|
+
|
|
27
|
+
E.g. The saved copy of a page titled Hello World would be two files:
|
|
28
|
+
# Hello%20World.textile
|
|
29
|
+
# Hello%20World.yaml
|
|
30
|
+
|
|
31
|
+
Hello%20World.textile might contain:
|
|
32
|
+
<pre>
|
|
33
|
+
h1. Hello world
|
|
34
|
+
|
|
35
|
+
What a beautiful world
|
|
36
|
+
</pre>
|
|
37
|
+
|
|
38
|
+
Hello%20World.yaml might contain
|
|
39
|
+
<pre>
|
|
40
|
+
--- # Start of document
|
|
41
|
+
- 0 # Revision number
|
|
42
|
+
- tamc # Revision author
|
|
43
|
+
- 2005-01-23 22:53:11.081896 +00:00 # Revision time
|
|
44
|
+
- # Array of change groups
|
|
45
|
+
- # Array of changes
|
|
46
|
+
- # Each change is an array
|
|
47
|
+
- "+" # Add or delete
|
|
48
|
+
- 0 # Line number
|
|
49
|
+
- h1. Hello george # What the line is
|
|
50
|
+
---
|
|
51
|
+
- 0 # If a new revision is made by the same author within 30 minutes the revision number is not increased. This is the definitive revision 0, the previous one should be ignored.
|
|
52
|
+
- tamc
|
|
53
|
+
- 2005-01-23 22:55:11.081896 +00:00
|
|
54
|
+
-
|
|
55
|
+
-
|
|
56
|
+
-
|
|
57
|
+
- "-"
|
|
58
|
+
- 0
|
|
59
|
+
- h1. Hello george
|
|
60
|
+
-
|
|
61
|
+
- "+"
|
|
62
|
+
- 0
|
|
63
|
+
- h1. Hello world
|
|
64
|
+
-
|
|
65
|
+
---
|
|
66
|
+
- 0
|
|
67
|
+
- tamc
|
|
68
|
+
- 2005-01-23 22:55:11.081896 +00:00
|
|
69
|
+
-
|
|
70
|
+
-
|
|
71
|
+
-
|
|
72
|
+
- "+"
|
|
73
|
+
- 1
|
|
74
|
+
- ""
|
|
75
|
+
-
|
|
76
|
+
- "+"
|
|
77
|
+
- 2
|
|
78
|
+
- What a beautiful world
|
|
79
|
+
-
|
|
80
|
+
</pre>
|
|
81
|
+
|
|
82
|
+
Tag: Include this page in the distribution
|