Soks 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. data/README.txt +5 -4
  2. data/bin/soks-create-wiki.rb +153 -19
  3. data/contrib/easyprompt.rb +58 -0
  4. data/contrib/easyprompt_licence.txt +504 -0
  5. data/contrib/redcloth-2.0.11.rb +3 -1
  6. data/lib/authenticators.rb +18 -2
  7. data/lib/soks-helpers.rb +207 -157
  8. data/lib/soks-model.rb +131 -114
  9. data/lib/soks-servlet.rb +54 -35
  10. data/lib/soks-storage.rb +134 -0
  11. data/lib/soks-upgrade-0.0.2.rb +70 -0
  12. data/lib/soks-utils.rb +129 -19
  13. data/lib/soks-view.rb +136 -62
  14. data/lib/soks.rb +3 -1
  15. data/{template → templates/default}/attachment/logo.png +0 -0
  16. data/templates/default/attachment/logo.tiff +0 -0
  17. data/templates/default/attachment/newpage.js +41 -0
  18. data/templates/default/attachment/print_stylesheet.css +7 -0
  19. data/templates/default/attachment/rss.png +0 -0
  20. data/{template → templates/default}/attachment/stylesheet.css +44 -17
  21. data/templates/default/banned_titles.txt +31 -0
  22. data/templates/default/content/Bug%3A%20In%20a%20list%20of%20links%2C%20the%20last%20link%20is%20sometimes%20not%20linked.textile +10 -0
  23. data/templates/default/content/Bug%3A%20Symbols%20are%20not%20always%20correctly%20rendered%20in%20html.textile +3 -0
  24. data/templates/default/content/Bug%3A%20Uploads%20are%20not%20password%20protected.textile +3 -0
  25. data/templates/default/content/How%20to%20administrate%20this%20wiki.textile +62 -0
  26. data/templates/default/content/How%20to%20change%20the%20way%20this%20wiki%20looks.textile +30 -0
  27. data/templates/default/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +60 -0
  28. data/{template → templates/default}/content/How%20to%20hack%20soks.textile +3 -2
  29. data/{template → templates/default}/content/How%20to%20import%20a%20site%20from%20instiki.textile +1 -1
  30. data/templates/default/content/How%20to%20use%20this%20wiki.textile +27 -0
  31. data/templates/default/content/List%20of%20changes.textile +35 -0
  32. data/{template → templates/default}/content/Picture%20of%20a%20pair%20of%20soks.textile +0 -0
  33. data/{template → templates/default}/content/Soks%20Licence.textile +0 -0
  34. data/templates/default/content/home%20page.textile +17 -0
  35. data/templates/default/start.rb +94 -0
  36. data/templates/default/version.txt +1 -0
  37. data/{template → templates/default}/views/Page_content.rhtml +0 -0
  38. data/templates/default/views/Page_edit.rhtml +61 -0
  39. data/templates/default/views/Page_meta.rhtml +40 -0
  40. data/templates/default/views/Page_print.rhtml +6 -0
  41. data/templates/default/views/Page_revisions.rhtml +19 -0
  42. data/templates/default/views/Page_rss.rhtml +55 -0
  43. data/{template → templates/default}/views/Page_search_results.rhtml +1 -1
  44. data/templates/default/views/Page_view.rhtml +4 -0
  45. data/templates/default/views/UploadPage_edit.rhtml +38 -0
  46. data/templates/default/views/frame.rhtml +41 -0
  47. data/templates/default/views/messages.yaml +6 -0
  48. data/templates/instiki/attachment/header_backdrop.png +0 -0
  49. data/templates/instiki/attachment/instiki_style_sheet.css +199 -0
  50. data/templates/instiki/attachment/logo.tiff +0 -0
  51. data/templates/instiki/attachment/logotext.png +0 -0
  52. data/templates/instiki/attachment/newpage.js +41 -0
  53. data/templates/instiki/attachment/rss.png +0 -0
  54. data/templates/instiki/banned_titles.txt +31 -0
  55. data/templates/instiki/content/AutomaticSummary.textile +24 -0
  56. data/templates/instiki/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +60 -0
  57. data/templates/instiki/content/How%20to%20hack%20soks.textile +61 -0
  58. data/templates/instiki/content/How%20to%20import%20a%20site%20from%20instiki.textile +13 -0
  59. data/{template → templates/instiki}/content/Improving%20the%20style%20of%20this%20wiki.textile +2 -2
  60. data/templates/instiki/content/Known%20bugs.textile +8 -0
  61. data/templates/instiki/content/List%20of%20changes.textile +34 -0
  62. data/templates/instiki/content/Picture%20of%20a%20pair%20of%20soks.textile +1 -0
  63. data/templates/instiki/content/Pointers%20on%20adjusting%20the%20settings.textile +62 -0
  64. data/templates/instiki/content/Pointers%20on%20how%20to%20use%20this%20wiki.textile +27 -0
  65. data/templates/instiki/content/Recent%20Blog%20Entries.textile +3 -0
  66. data/templates/instiki/content/Recent%20Changes%20to%20This%20Site.textile +48 -0
  67. data/templates/instiki/content/Site%20Index.textile +16 -0
  68. data/templates/instiki/content/Soks%20Licence.textile +64 -0
  69. data/{template → templates/instiki}/content/home%20page.textile +9 -4
  70. data/templates/instiki/start.rb +85 -0
  71. data/templates/instiki/version.txt +1 -0
  72. data/templates/instiki/views/Page_content.rhtml +1 -0
  73. data/templates/instiki/views/Page_edit.rhtml +8 -0
  74. data/templates/instiki/views/Page_meta.rhtml +34 -0
  75. data/templates/instiki/views/Page_print.rhtml +6 -0
  76. data/templates/instiki/views/Page_revisions.rhtml +17 -0
  77. data/templates/instiki/views/Page_rss.rhtml +55 -0
  78. data/templates/instiki/views/Page_search_results.rhtml +18 -0
  79. data/templates/instiki/views/Page_view.rhtml +2 -0
  80. data/templates/instiki/views/UploadPage_edit.rhtml +16 -0
  81. data/templates/instiki/views/frame.rhtml +90 -0
  82. data/templates/instiki/views/messages.yaml +6 -0
  83. data/templates/rails/attachment/2colheader.css +77 -0
  84. data/templates/rails/attachment/basics.css +98 -0
  85. data/templates/rails/attachment/header_backdrop.png +0 -0
  86. data/templates/rails/attachment/logo.tiff +0 -0
  87. data/templates/rails/attachment/logotext.png +0 -0
  88. data/templates/rails/attachment/newpage.js +41 -0
  89. data/templates/rails/attachment/rss.png +0 -0
  90. data/templates/rails/banned_titles.txt +31 -0
  91. data/templates/rails/content/AutomaticSummary.textile +24 -0
  92. data/templates/rails/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +60 -0
  93. data/templates/rails/content/How%20to%20hack%20soks.textile +61 -0
  94. data/templates/rails/content/How%20to%20import%20a%20site%20from%20instiki.textile +13 -0
  95. data/templates/rails/content/Improving%20the%20style%20of%20this%20wiki.textile +30 -0
  96. data/templates/rails/content/Known%20bugs.textile +8 -0
  97. data/templates/rails/content/List%20of%20changes.textile +34 -0
  98. data/templates/rails/content/Picture%20of%20a%20pair%20of%20soks.textile +1 -0
  99. data/templates/rails/content/Pointers%20on%20adjusting%20the%20settings.textile +62 -0
  100. data/templates/rails/content/Pointers%20on%20how%20to%20use%20this%20wiki.textile +27 -0
  101. data/templates/rails/content/Recent%20Blog%20Entries.textile +3 -0
  102. data/templates/rails/content/Recent%20Changes%20to%20This%20Site.textile +48 -0
  103. data/templates/rails/content/Site%20Index.textile +16 -0
  104. data/templates/rails/content/Soks%20Licence.textile +64 -0
  105. data/templates/rails/content/home%20page.textile +23 -0
  106. data/templates/rails/start.rb +85 -0
  107. data/templates/rails/version.txt +1 -0
  108. data/templates/rails/views/Page_content.rhtml +1 -0
  109. data/templates/rails/views/Page_edit.rhtml +61 -0
  110. data/templates/rails/views/Page_meta.rhtml +38 -0
  111. data/templates/rails/views/Page_print.rhtml +6 -0
  112. data/templates/rails/views/Page_revisions.rhtml +19 -0
  113. data/templates/rails/views/Page_rss.rhtml +55 -0
  114. data/templates/rails/views/Page_search_results.rhtml +19 -0
  115. data/templates/rails/views/Page_view.rhtml +3 -0
  116. data/templates/rails/views/UploadPage_edit.rhtml +38 -0
  117. data/templates/rails/views/frame.rhtml +60 -0
  118. data/templates/rails/views/messages.yaml +6 -0
  119. metadata +122 -28
  120. data/template/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +0 -5
  121. data/template/content/Pointers%20on%20adjusting%20the%20settings.textile +0 -39
  122. data/template/content/Pointers%20on%20how%20to%20use%20this%20wiki.textile +0 -21
  123. data/template/content/Recent%20Changes%20to%20This%20Site.textile +0 -203
  124. data/template/start.rb +0 -74
  125. data/template/views/AttachmentPage_edit.rhtml +0 -36
  126. data/template/views/ImagePage_edit.rhtml +0 -36
  127. data/template/views/Page_edit.rhtml +0 -34
  128. data/template/views/Page_print.rhtml +0 -5
  129. data/template/views/Page_revisions.rhtml +0 -18
  130. data/template/views/Page_rss.rhtml +0 -34
  131. data/template/views/Page_view.rhtml +0 -3
  132. data/template/views/frame.rhtml +0 -34
@@ -0,0 +1,6 @@
1
+ :some_content_has_been_deleted : "Some content has been deleted"
2
+ :Type_what_you_want_here_and_click_save : "Type what you want here and click save"
3
+ :Create : "Create"
4
+ :page_deleted : "page deleted"
5
+ :content_moved_to : "content moved to"
6
+ :content_moved_from : "content moved from"
@@ -0,0 +1,77 @@
1
+ /* Outer Frame */
2
+
3
+ /* HEADER, LOGO ETC */
4
+ div#header {
5
+ margin-left:20px;
6
+ margin-top:10px;
7
+ height: 160px;
8
+ overflow: hidden;
9
+ text-align: left;
10
+ }
11
+
12
+ div#header h1 {
13
+ height: 70px;
14
+ background-image: url(/attachment/logotext.png);
15
+ background-repeat: no-repeat;
16
+ background-position: 0px 0px;
17
+ margin: 0;
18
+ margin-left: 140px;
19
+ padding: 0;
20
+ /* Move the header text away to leave the logo */
21
+ text-indent: -5000px;
22
+ }
23
+
24
+ div#logo {
25
+ float: left;
26
+ width: 110px;
27
+ height: 140px;
28
+ margin-right: 31px;
29
+ }
30
+
31
+ p#navMain {
32
+ height: 42px;
33
+ margin: 10px;
34
+ padding: 16px;
35
+ color: #FFFFFF;
36
+ }
37
+
38
+ p#navMain a {
39
+ padding: 0.2em 0.5em 0.2em 0.8em;
40
+ text-decoration: none;
41
+ color: #FFFFFF;
42
+ font-weight: bold;
43
+ border-left: 1px solid #FFFFFF;
44
+ }
45
+
46
+ p#navMain a:hover {
47
+ text-decoration: underline;
48
+ background-color: transparent;
49
+ }
50
+
51
+ /* THE BODY */
52
+ div#content {
53
+ position: absolute;
54
+ top: 150px;
55
+ left: 170px;
56
+ width: auto;
57
+ margin-right: 35px;
58
+ }
59
+
60
+ div#sidebar {
61
+ position: absolute;
62
+ top: 180px;
63
+ left: 35px;
64
+ width: 120px;
65
+ font-size: 0.8em;
66
+ }
67
+
68
+ div#sidebar h2 {
69
+ font-size: 1.1em;
70
+ font-weight: bold;
71
+ margin: 0em;
72
+ }
73
+
74
+ div#sidebar a {
75
+ display: block;
76
+ }
77
+
@@ -0,0 +1,98 @@
1
+ body {
2
+ color: #333333;
3
+
4
+ background-color: #FFFFFF;
5
+ background-image: url(/attachment/header_backdrop.png);
6
+ background-repeat: repeat-x;
7
+ background-position: 0 -25px;
8
+ font-size: 80%;
9
+ font-family: verdana, helvetica, arial, sans-serif;
10
+ }
11
+
12
+ /* HEADINGS */
13
+
14
+ /* LINKS */
15
+ a:link {
16
+ color: #BB2233;
17
+ }
18
+
19
+ a:visited {
20
+ color: #991122;
21
+ }
22
+
23
+ a:hover {
24
+ color: #CC2233;
25
+ background-color: #EEEEEE;
26
+ }
27
+
28
+ span.nolink {
29
+ color: #BB2233;
30
+ text-decoration: line-through;
31
+ }
32
+
33
+
34
+ /* IMAGES */
35
+ img { border: none; }
36
+
37
+ /* FORMS */
38
+ input:focus, textarea:focus, select:focus {
39
+ border-color: #333333;
40
+ }
41
+
42
+ .pagename {
43
+ font-size: xx-small;
44
+ display: block;
45
+ }
46
+
47
+ .disclaimer {
48
+ font-size: xx-small;
49
+ display: block;
50
+ }
51
+
52
+ .subpage {
53
+ padding: 10px;
54
+ margin: 10px;
55
+ border: solid 1px #AAAAAA;
56
+ font-size:x-small;
57
+ }
58
+
59
+ p.more {
60
+ font-size: xx-small;
61
+ text-align: right;
62
+ padding: 0px;
63
+ font-color: #grey;
64
+ }
65
+
66
+ .subpage h1 {
67
+ }
68
+
69
+ .calendar td {
70
+ border: solid 1px #AAAAAA;
71
+ text-align: center;
72
+ }
73
+
74
+ .upcomingevents {
75
+ padding: 0px 10px 0px 10px;
76
+ margin: 0px; border: solid 1px #AAAAAA;
77
+ }
78
+
79
+ a.pageview {
80
+ display: inline;
81
+ }
82
+
83
+ pre.change {
84
+ margin: 0px;
85
+ padding: 0px;
86
+ }
87
+
88
+ ul.tips {
89
+ list-style-type: none;
90
+ }
91
+
92
+ .metacolumn {
93
+ display: inline;
94
+ font-size: smaller;
95
+ }
96
+
97
+
98
+
@@ -0,0 +1,41 @@
1
+ function trim(str)
2
+ {
3
+ return str.replace(/^\s+/,'').replace(/\s+$/,'');
4
+ }
5
+
6
+ function editSelected()
7
+ {
8
+ if (window.getSelection)
9
+ {
10
+ txt = window.getSelection();
11
+ }
12
+ else if (document.getSelection)
13
+ {
14
+ txt = document.getSelection();
15
+ }
16
+ else if (document.selection)
17
+ {
18
+ txt = document.selection.createRange().text;
19
+ }
20
+ if(!txt){
21
+ void(txt=prompt('Please enter the title of the page you wish to create',''))
22
+ }
23
+ if(txt){
24
+ window.location = '/edit/'+escape(trim(txt))
25
+ }
26
+ }
27
+
28
+ function hotkey( event )
29
+ {
30
+ event = (event) ? event : ((window.event) ? event : null);
31
+ if (event)
32
+ {
33
+ if (event.ctrlKey )
34
+ {
35
+ var charCode = (event.charCode) ? event.charCode : ((event.which) ? event.which : event.keyCode);
36
+ if (charCode == 14 ) {
37
+ editSelected();
38
+ }
39
+ }
40
+ }
41
+ }
Binary file
@@ -0,0 +1,31 @@
1
+ # Each line contains a title that will NOT be automatically linked in the wiki (can still be manually linked)
2
+ the
3
+ of
4
+ and
5
+ a
6
+ to
7
+ in
8
+ is
9
+ that
10
+ it
11
+ was
12
+ he
13
+ for
14
+ as
15
+ on
16
+ with
17
+ his
18
+ be
19
+ at
20
+ you
21
+ I
22
+ are
23
+ this
24
+ by
25
+ from
26
+ had
27
+ have
28
+ they
29
+ not
30
+ or
31
+ one
@@ -0,0 +1,24 @@
1
+ h1. The Automatic Summary class
2
+
3
+ This class is in the lib/soks-helpers.rb file. Examples of its use can be seen in the AutomaticRecentChanges and AutomaticIndex classes in that file.
4
+
5
+ It is a flexible class that watches the wiki, and creates summaries of pages based on your specifications. To create a new automatic summary, edit the section in your start.rb file.
6
+
7
+ Possible settings are:
8
+ <code>
9
+ DEFAULT_SETTINGS = {
10
+ :regexp_for_title => /.*/, # These three regexps act as an AND
11
+ :regexp_for_author => nil,
12
+ :regexp_for_content => nil,
13
+ :max_pages_to_show => nil,
14
+ :pagename => 'Summary',
15
+ :author => 'AutomaticSummary',
16
+ :lines_to_include => nil, # Or pass a block
17
+ :only_new_pages => false,
18
+ :sort_pages_by => :created_on, # Could be :revised_on or :score or :name or :name_for_index, or :author
19
+ :reverse_sort => false,
20
+ :include_metadata => false, # Includes author and time in summary
21
+ :summarise_revisions => false, # If true, then can contain several revisions for same page
22
+ :remove_deleted_pages => true, # If false will keep references to deleted pages
23
+ }
24
+ </code>
@@ -0,0 +1,60 @@
1
+ h1. How to export a site from this wiki
2
+
3
+ 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.
4
+
5
+ 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.
6
+
7
+ E.g. The saved copy of a page titled Hello World would be two files:
8
+ # Hello%20World.textile
9
+ # Hello%20World.yaml
10
+
11
+ Hello%20World.textile might contain:
12
+ <pre>
13
+ h1. Hello world
14
+
15
+ What a beautiful world
16
+ </pre>
17
+
18
+ Hello%20World.yaml might contain
19
+ <pre>
20
+ --- # Start of document
21
+ - 0 # Revision number
22
+ - tamc # Revision author
23
+ - 2005-01-23 22:53:11.081896 +00:00 # Revision time
24
+ - # Array of change groups
25
+ - # Array of changes
26
+ - # Each change is an array
27
+ - "+" # Add or delete
28
+ - 0 # Line number
29
+ - h1. Hello george # What the line is
30
+ ---
31
+ - 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.
32
+ - tamc
33
+ - 2005-01-23 22:55:11.081896 +00:00
34
+ -
35
+ -
36
+ -
37
+ - "-"
38
+ - 0
39
+ - h1. Hello george
40
+ -
41
+ - "+"
42
+ - 0
43
+ - h1. Hello world
44
+ -
45
+ ---
46
+ - 0
47
+ - tamc
48
+ - 2005-01-23 22:55:11.081896 +00:00
49
+ -
50
+ -
51
+ -
52
+ - "+"
53
+ - 1
54
+ - ""
55
+ -
56
+ - "+"
57
+ - 2
58
+ - What a beautiful world
59
+ -
60
+ </pre>
@@ -0,0 +1,61 @@
1
+ h1. How to hack soks
2
+
3
+ Here are some pointers to help you figure out where to make whatever changes and improvements you desire. The soks licence is liberal, so please do whatever you want, but I would appreciate if you sent me any improvements you make ( tamc@rubyforge.com ).
4
+
5
+ * bin - contains the soks-create-wiki.rb file
6
+ * contrib - contains code from other people. Currently Redcloth and Diff:LCS
7
+ * lib - contains the soks code
8
+ * template - contains the defaults used by soks-create-wiki.rb when creating a new wiki. This folder is copied over, and the show.rb template filled out.
9
+
10
+ h2. template
11
+
12
+ * show.rb - contains the default ruby file used by soks-create-wiki.rb, this is written using erb
13
+ * attachments - contains the stuff that will be statically loaded when running a wiki, such as images and stylesheets. In particular you may want to replace logo.png
14
+ * views - contains the default templates see Improving the style of this wiki for a few notes on this
15
+ * content - contains the initial content for the wiki. The .textile files are flatfile text files containing the textile for a page. The title of the page is the filename (and has usually been url_encoded). Any .yaml files in here contain arrays containing the change history of the page
16
+
17
+ h2. lib
18
+
19
+ * soks.rb - Just requires all the other files
20
+ * soks-utils.rb - Contains various utility classes, EventQueue, Notify and some extensions to String to url_encode and decode
21
+ * soks-storage.rb - Contains a module which is mixed into the Wiki class to allow it to be saved
22
+ * soks-model.rb - Contains the model of the wiki: Wiki, Page and Revision
23
+ * soks-view.rb - Contains the classes that turn the wiki into html: View, WikiRedCloth, Links, RollingMatch
24
+ * soks-servlet.rb - Contains the webrick server that passes commands to and from the View object
25
+ * soks-helpers.rb - Contains optional classes that a Wiki can load to provide added functionality. These are called when changes are made to the site. They include: AutomaticUpdateCrossLinks, AutomaticRecentChanges, AutomaticOnePageIndex, AutomaticMultiPageIndex, AutomaticSummary, AutomaticCalendar and AutomaticUpcomingEvents.
26
+ * authenticators.rb - Contains some extra authenticators to extend those already provided by Webrick. Namely NotAuthentication and OnePasswordAuthentication
27
+
28
+ h3. soks-utils.rb
29
+
30
+ * Notify - This is an improvement on the Observable mix-in.
31
+ * EventQueue - This is used by Notify to inform observers in sequence of an event taking place, while allowing the original triggering class to continue.
32
+
33
+ h3. soks-model.rb
34
+
35
+ A Wiki class has many Page classes which have many Revision classes. ImagePage and AttachmentPage are subclasses of Page that return different textile.
36
+
37
+ The Wiki class decides what type of page to create based on its name. All AttachmentPage pages have names that start with 'Attached ', all ImagePage pages have names that start with 'Picture of'. This is defined in the @page_classes instance variable of the Wiki class.
38
+
39
+ The Wiki loads all the pages from file into a hash. When pages are changed it writes a copy to disk immediately. It has a thread that watches the disk for any changes to the files.
40
+
41
+ h3. soks-view.rb
42
+
43
+ The View object does the business. It is called by the soks-servlet, and then proceeds to call an appropriate method on the Wiki model. It may then Notify any observing AutomaticHelpers of any changes, before proceeding to render the html. This rendering happens in two places: First the Page.textile is turned into html by WikiRedCloth. then an appropriate ERB file is loaded and called.
44
+
45
+ The WikiRedCloth overrides the to_html method of redcloth to add a number of methods that do the automatic page insertion and automatic linking. The automatic linking is actually carried out in the RollingMatch class. A record of the links between pages is kept in the Links class and then written to each page object. Currently Redcloth 3.0.1 seems to have lots of stack overflows, so Redcloth 2.0.11 is used.
46
+
47
+ The ERB files are loaded from disk. The appropriate erb file is selected by looking for the pattern ClassName_viewname.rhtml (e.g. Page_edit.rhtml). If that page doesn't exist then the process is repeated with the Page's superclass. The ERB files are cached.
48
+
49
+ h3. soks-servlet.rb
50
+
51
+ This runs a Webrick server to interact with the user. There is a $SETTINGS global that contains most of the important settings, and a start_wiki method for setting them and triggering the server to start. The server can be stopped by sending an interupt (ctrl-c).
52
+
53
+ The server has two handlers, a WEBrick::HTTPServlet::FileHandler for doing the dynamic content (which is attached to any url starting in /attachment/) and a WikiServlet for the dynamic content.
54
+
55
+ The WikiServlet service method takes a look at the request url. If it is '/' it redirects to '/view/Home Page'. If it only has one slash in it (e.g. '/Home Page') then it assumes that it is equivalent to '/view/Home Page'. If it has two or more slashes in it (e.g. '/edit/Home Page' ) then it splits the url into a command ('edit') and the rest ('Home Page'). If the WikiServlet responds to doCommand (e.g. doEdit) then control is passed to that method. Otherwise it is assumed the command is the name of a view (e.g. 'print') and is therefore passed as is to the View object.
56
+
57
+ The WikiServlet deals with file uploads by separately writing the uploaded file to the 'attachments' directory and also asking the 'View' object to create or revise an ImagePage object whose content is the filename of the uploaded file.
58
+
59
+ h4. soks-helpers.rb
60
+
61
+ These are a series of classes that may be optionally loaded by a wiki's start.rb script. They receive notifications of page changes from the View object and can use this information to update other pages in the wiki.
@@ -0,0 +1,13 @@
1
+ h1. How to import a site from instiki
2
+
3
+ [[ Instiki => www.instiki.org ]] is great, and was definitely an inspiration for this site. If, however, you wish to import a wiki from instiki to here then you need to:
4
+
5
+ # Launch your instiki wiki
6
+ # Go to 'export' and click on 'Markup (textile)'
7
+ # Unzip the downloaded folder.
8
+ # Create a soks wiki: <code>soks-create-wiki.rb</code>
9
+ # Stop the wiki <code>ctrl-c</code>
10
+ # Copy the contents of the downloaded folder (step 3) into soks-wiki/content
11
+ # Start the wiki <code>ruby soks-wiki/start.rb</code>
12
+
13
+ Your instiki content should then appear. Note that all the links still work, but that all the pages have their WikiWord names.
@@ -0,0 +1,30 @@
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.tif 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.