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,8 @@
1
+ h1. Known Bugs
2
+
3
+ _If you can fix any of the bugs here, please let me know. If you spot any more, please let me know._
4
+
5
+ * Uploads are not password protected
6
+ * Sometimes the last item in a list of links is not linked correctly
7
+ * Sometimes entities such as > are not encoded correctly
8
+
@@ -0,0 +1,34 @@
1
+ h1. List of changes
2
+
3
+ h2. Between v-0-1-0 and v-0-0-2
4
+
5
+ h3. Features
6
+
7
+ * File format for revisions changed from marshalled array of revisions to a yaml'd array of strings and times. This should allow easier import/export.
8
+ * Changes to the files on disk appear in the wiki (by default checks for changes on disk every 60 seconds) to allow external editing of the wiki.
9
+ * New way of making new pages: highlight the text you wish to link and press crtl-n. This only works on some browsers.
10
+ * RSS feed for changes made to any page (use the RSS feed on Recent Changes to be notified of all changes to the site, use the RSS feed on Site Index to be notified of new pages).
11
+ * Added a WikiWord link for those that don't like to give out links with %20's in them. e.g. http://yoursite.com/wiki/HomePage redirects to http://yoursite.com/view/Home%20Page.
12
+ * The automatic summary class has been extended to allow summary based on the page title, page author, or page content.
13
+ * Different parts of the wiki, and different commands, can be authenticated differently based on regexps.
14
+ * Kill list of words that will not be automatically linked (default set is the 30 most common English language words).
15
+ * The soks-create-wiki command can now be interactive (or can use command line options including --help and --no-interaction). It also manages upgrades from the previous version of Soks.
16
+ * There are some demo templates: default is the standard, rails looks a bit like www.rubyonrails.com and instiki which looks a bit like www.instiki.org.
17
+
18
+ h3. Refactorings
19
+
20
+ * The recent changes and site index helpers now use the automatic summary class.
21
+ * The Wiki class now notifies other classes of changes to the site, including the View class.
22
+ * The storage methods are now a module which is mixed into the wiki class.
23
+
24
+ h3. Bug Fixes
25
+
26
+ * Bug in uploads on windows fixed (thanks to Sebastien Clediere).
27
+ * Bugs in accepting titles with punctuation fixed.
28
+ * Bug in automatic summary fixed.
29
+ * Logo changed from png to tif so that it is transparent on a wider selection of browsers.
30
+
31
+ h3. Bugs remaining
32
+
33
+ * No authentication on pictures and attachments
34
+ * Lots of little faults with the textile to html conversion. Some due to the use of Redcloth v 2.0.11 (looking forward to a stable v3!) and some due to my inept subclassing.
@@ -0,0 +1 @@
1
+ /attachment/logo.tiff
@@ -0,0 +1,62 @@
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 restart 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 make your site accessible beyond localhost
14
+
15
+ Open start.rb in your directory. Un-comment the lines
16
+ <code>
17
+ # :url => 'http://localhost:8000',
18
+ # :port => 8000,
19
+ </code>
20
+ and replace them with the url and port you wish the wiki to run on.
21
+
22
+ h2. To password protect your site.
23
+
24
+ Open start.rb in your wiki directory. Un-comment and edit the authenticators section and edit the array. The format is [ [ first regexp to match against title, authenticator to use ], [ second regexp to match against title, authenticator to use ] .... ]. For example:
25
+
26
+ # This matches against all the standard 'non editing commands' and doesn't ask for any authentication
27
+ <code>[ %r{/(view|rss|print|find|meta)/.*}, WEBrick::HTTPAuth::NoAuthenticationRequired.new ]</code>
28
+
29
+ # This doesn't permit any file or picture uploads
30
+ <code>[ %r{/upload/.*}, WEBrick::HTTPAuth::NotPermitted.new ]</code>
31
+
32
+ # This asks for a site wide password to edit or save changes to the home page
33
+ <code>[ %r{/(edit|save)/home page}, WEBrick::HTTPAuth::SiteWidePassword.new('password','You need to enter the site wide password to edit the home page') ]</code>
34
+
35
+ # This uses the standard WEBrick authentication system on any page whose name starts with private. The standard WEBrick authentication uses a database of usernames and passwords. See [[ Gnome's Guide => http://shogo.homelinux.org/~ysantoso/webrickguide/html/html_webrick.html ]] for details.
36
+ <code>[ %r{/(view|edit|save)/private.*},WEBrick::HTTPAuth::BasicAuth.new( :UserDB => htpasswd, :Realm => realm ) ]</code>
37
+
38
+ # This is the default. For any page it just asks for a username, but the password can be left blank.
39
+ <code>[ %r{.*}, WEBrick::HTTPAuth::AskForUserName.new( 'No password, just enter a name') ]</code>
40
+
41
+ Note a big bug is that viewing attached images and files is NOT password protected. If someone knows how to make WEBrick::HTTPServlet::FileHandler use an authenticator, please let me know.
42
+
43
+ h2. To edit the default site settings used by soks-create-wiki.rb
44
+
45
+ Edit template/start.rb in the directory where soks was installed.
46
+
47
+ h2. To change how often the wiki checks the content directory for any changes.
48
+
49
+ Open start.rb and add this to your CUSTOM_SETTINGS hash:
50
+ <code>:check_files_every => 60, # Seconds</code>
51
+
52
+ h2. To add a calendar and upcoming events page:
53
+
54
+ Open start.rb and uncomment:
55
+ <code>
56
+ # calendar = AutomaticCalendar.new( wiki ) # Adds a series of calendar pages to the wiki
57
+ # AutomaticUpcomingEvents.new( wiki, calendar ) # Creates a page with the next weeks events drawn from the calendar pages
58
+ </code>
59
+
60
+ h2. To add a page that summarises other pages:
61
+
62
+ See AutomaticSummary
@@ -0,0 +1,27 @@
1
+ h1. Pointers on how to use this wiki
2
+
3
+ h2. Adding Pages
4
+
5
+ There are several ways to add pages to soks:
6
+ # Click on the 'add a new page'
7
+ # Highlight the text on the page you wish to link from and press crtl-n[1]
8
+ # Type the title of the page you wish to create and click search, there will be a link to create the page at the bottom of the search results.
9
+ # As you are editing a page, put the title of a new page in square brackets like this: <notextile>[[ title of the new page ]]</notextile>. When you save the page, a link will be created that permits you to create a new page.
10
+
11
+ Yes, this means it is very easy to create orphaned pages. No I don't think this is a problem, because there is a site index.
12
+
13
+ fn1. This only works on some browsers. It doesn't seem to work on Mac Firefox or Mac OmniWeb. It does on Mac Safari. Please report your successes and failiures.
14
+
15
+ h2. Editing Pages
16
+
17
+ * To edit a page, click edit.
18
+ * The pages are written in textile. A reference is at http://hobix.com/textile/quick.html
19
+ * Links to other pages within this wiki, and to web addresses, and to e-mail addresses, happen automatically
20
+ * To force a link put it inside double square brackets e.g. <notextile>[[a forced link]]</notextile>
21
+ * To alias a link: <notextile> [[ a different name for </notextile>=><notextile> site index ]] </notextile>
22
+ * To insert another page: <notextile>[ [ insert site index ]]</notextile>
23
+ * This is particularly usefull if you want to insert a picture: <notextile>[ [ insert picture of the soks logo ]]</notextile>
24
+
25
+ h2. Searching
26
+
27
+ The search box on the right takes a single regexp.
@@ -0,0 +1,3 @@
1
+ h1. Recent Blog Entries
2
+
3
+ No pages found to summarise
@@ -0,0 +1,48 @@
1
+ h1. Recent Changes to This Site
2
+
3
+ * home page revised on 2005 Jan 23 23:27 by tamc2
4
+ * home page revised on 2005 Jan 23 23:27 by tamc2
5
+ * home page revised on 2005 Jan 23 23:26 by tamc2
6
+ * home page revised on 2005 Jan 23 23:26 by tamc2
7
+ * Picture of a pair of soks revised on 2005 Jan 23 23:25 by AutomaticImport
8
+ * Picture of a pair of soks revised on 2005 Jan 23 23:24 by AutomaticImport
9
+ * How to hack soks revised on 2005 Jan 23 23:23 by tamc2
10
+ * How to export a site from this wiki revised on 2005 Jan 23 23:21 by tamc2
11
+ * How to import a site from instiki revised on 2005 Jan 23 23:10 by tamc2
12
+ * Site Index revised on 2005 Jan 23 23:10 by AutomaticIndex
13
+ * AutomaticSummary revised on 2005 Jan 23 23:10 by tamc2
14
+ * Pointers on adjusting the settings revised on 2005 Jan 23 23:04 by tamc2
15
+ * Pointers on adjusting the settings revised on 2005 Jan 23 23:04 by tamc2
16
+ * Pointers on adjusting the settings revised on 2005 Jan 23 23:03 by tamc2
17
+ * Pointers on adjusting the settings revised on 2005 Jan 23 23:01 by tamc2
18
+ * Pointers on adjusting the settings revised on 2005 Jan 23 22:59 by tamc2
19
+ * Pointers on adjusting the settings revised on 2005 Jan 23 22:58 by tamc2
20
+ * List of changes revised on 2005 Jan 23 22:48 by tamc2
21
+ * Site Index revised on 2005 Jan 23 22:45 by AutomaticIndex
22
+ * List of changes revised on 2005 Jan 23 22:45 by tamc2
23
+ * home page revised on 2005 Jan 23 22:31 by tamc2
24
+ * Site Index revised on 2005 Jan 23 22:30 by AutomaticIndex
25
+ * Known bugs revised on 2005 Jan 23 22:30 by tamc2
26
+ * home page revised on 2005 Jan 23 22:29 by tamc2
27
+ * Improving the style of this wiki revised on 2005 Jan 23 22:21 by tamc2
28
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:20 by tamc2
29
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:20 by tamc2
30
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:19 by tamc2
31
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:19 by tamc2
32
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:18 by tamc2
33
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:18 by tamc2
34
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:17 by tamc2
35
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:16 by tamc2
36
+ * home page revised on 2005 Jan 23 22:09 by tamc2
37
+ * Site Index revised on 2005 Jan 23 22:06 by AutomaticIndex
38
+ * Recent Blog Entries revised on 2005 Jan 23 22:06 by AutomaticSummary
39
+ * Site Index revised on 2005 Jan 23 22:06 by AutomaticIndex
40
+ * Soks Licence revised on 2005 Jan 23 22:06 by AutomaticImport
41
+ * Pointers on how to use this wiki revised on 2005 Jan 23 22:06 by AutomaticImport
42
+ * Pointers on adjusting the settings revised on 2005 Jan 23 22:06 by AutomaticImport
43
+ * Picture of a pair of soks revised on 2005 Jan 23 22:06 by AutomaticImport
44
+ * Improving the style of this wiki revised on 2005 Jan 23 22:06 by AutomaticImport
45
+ * How to import a site from instiki revised on 2005 Jan 23 22:06 by AutomaticImport
46
+ * How to hack soks revised on 2005 Jan 23 22:06 by AutomaticImport
47
+ * How to export a site from this wiki revised on 2005 Jan 23 22:06 by AutomaticImport
48
+ * home page revised on 2005 Jan 23 22:06 by AutomaticImport
@@ -0,0 +1,16 @@
1
+ h1. Site Index
2
+
3
+ * Picture of a pair of soks
4
+ * AutomaticSummary
5
+ * home page
6
+ * How to export a site from this wiki
7
+ * How to hack soks
8
+ * How to import a site from instiki
9
+ * Improving the style of this wiki
10
+ * Known bugs
11
+ * List of changes
12
+ * Pointers on adjusting the settings
13
+ * Pointers on how to use this wiki
14
+ * Recent Blog Entries
15
+ * Recent Changes to This Site
16
+ * Soks Licence
@@ -0,0 +1,64 @@
1
+ h1. Soks is licensed under the The Ruby License
2
+
3
+ Note: This licence applies to all that is contained in this distribution EXCEPT files within the contrib folder which may be under different licences.
4
+
5
+ Soks is copyrighted (c) 2004, 2005 free software by Thomas Counsell tamc@rubyforge.org.
6
+
7
+ <pre>
8
+
9
+ You can redistribute it and/or modify it under either the terms of the
10
+ GPL (see the file GPL), or the conditions below:
11
+
12
+ 1. You may make and give away verbatim copies of the source form of the
13
+ software without restriction, provided that you duplicate all of the
14
+ original copyright notices and associated disclaimers.
15
+
16
+ 2. You may modify your copy of the software in any way, provided that
17
+ you do at least ONE of the following:
18
+
19
+ a) place your modifications in the Public Domain or otherwise
20
+ make them Freely Available, such as by posting said
21
+ modifications to Usenet or an equivalent medium, or by allowing
22
+ the author to include your modifications in the software.
23
+
24
+ b) use the modified software only within your corporation or
25
+ organization.
26
+
27
+ c) rename any non-standard executables so the names do not conflict
28
+ with standard executables, which must also be provided.
29
+
30
+ d) make other distribution arrangements with the author.
31
+
32
+ 3. You may distribute the software in object code or executable
33
+ form, provided that you do at least ONE of the following:
34
+
35
+ a) distribute the executables and library files of the software,
36
+ together with instructions (in the manual page or equivalent)
37
+ on where to get the original distribution.
38
+
39
+ b) accompany the distribution with the machine-readable source of
40
+ the software.
41
+
42
+ c) give non-standard executables non-standard names, with
43
+ instructions on where to get the original software distribution.
44
+
45
+ d) make other distribution arrangements with the author.
46
+
47
+ 4. You may modify and include the part of the software into any other
48
+ software (possibly commercial). But some files in the distribution
49
+ are not written by the author, so that they are not under these terms.
50
+
51
+ For the list of those files and their copying conditions, see the
52
+ contrib directory.
53
+
54
+ 5. The scripts and library files supplied as input to or produced as
55
+ output from the software do not automatically fall under the
56
+ copyright of the software, but belong to whomever generated them,
57
+ and may be sold commercially, and may be aggregated with this
58
+ software.
59
+
60
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
61
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
62
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
63
+ PURPOSE.
64
+ </pre>
@@ -0,0 +1,23 @@
1
+ h1. Welcome!
2
+
3
+ You have succesfully installed soks. Remember it is work in progress, and definitely not fully de-bugged. So don't trust your mission critical sites to it.
4
+
5
+ If you are upgrading from a previous version, you may wish to glance at the list of changes.
6
+
7
+ h2. Further information
8
+
9
+ * Pointers on how to use this wiki
10
+ * Improving the style of this wiki
11
+ * Pointers on adjusting the settings such as the url, or the port, or 'advanced' features such as automatic calendars and summaries.
12
+ * How to import a site from instiki
13
+ * How to export a site from this wiki
14
+ * How to hack soks
15
+ * [[Known bugs]] (If you know how to fix them, please let me know!)
16
+
17
+ h2. Feedback
18
+
19
+ * Please send me your feedback. tamc@rubyforge.com.
20
+ * Or submit a bug at http://rubyforge.org/projects/soks/.
21
+ * To keep track of developments, you may wish to subscribe to the mailing list at http://rubyforge.org/projects/soks to be notified of updates.
22
+
23
+ [[insert picture of a pair of soks]]
@@ -0,0 +1,85 @@
1
+ #!/usr/local/bin/ruby
2
+
3
+ # This file was created automatically on <%= Time.now %>
4
+ # Uncomment different sections to enable features of this wiki.
5
+
6
+ #Add the required libraries to the search path:
7
+ $:.push( "<%= settings[:soks_libraries].join('","') %>" )
8
+
9
+ require 'soks'
10
+
11
+ module StartSoks
12
+
13
+ =begin
14
+ # You can choose what level of authentication to apply based on regular expressions matched
15
+ # against the page title. These regexps are tried in order.Defaults are here:
16
+ AUTHENTICATORS = [ [ %r{/(view|rss|print|find|meta)/.*}, WEBrick::HTTPAuth::NoAuthenticationRequired.new ],
17
+ # [ %r{/upload/.*}, WEBrick::HTTPAuth::NotPermitted.new ],
18
+ # [ %r{/(edit|save)/home page}, WEBrick::HTTPAuth::SiteWidePassword.new('password','You need to enter the site wide password to edit the home page') ],
19
+ # [ %r{/(view|edit|save)/private.*},WEBrick::HTTPAuth::BasicAuth.new( :UserDB => htpasswd, :Realm => realm ) ], # See webrick documentation
20
+ [ %r{.*}, WEBrick::HTTPAuth::AskForUserName.new( 'No password, just enter a name') ]
21
+ ]
22
+
23
+ =end
24
+
25
+ CUSTOMSETTINGS = {
26
+ :root_directory => '<%= settings[:root_directory] %>',
27
+ # :name => 'test',
28
+ # :description => 'A Soks Wiki',
29
+ :url => '<%= settings[:url] %>',
30
+ :port => <%= settings[:port] %>,
31
+ # :authenticators => AUTHENTICATORS
32
+ }
33
+
34
+ def self.start
35
+ start_wiki( CUSTOMSETTINGS ) do |wiki, view|
36
+ AutomaticRecentChanges.new( wiki )
37
+
38
+ AutomaticOnePageIndex.new( wiki ) # Index on one page, best for small wikis
39
+ # AutomaticMultiPageIndex.new( wiki ) # One page per letter index, best for large wikis
40
+
41
+ calendar = AutomaticCalendar.new( wiki ) # Adds a series of calendar pages to the wiki
42
+ AutomaticUpcomingEvents.new( wiki, calendar ) # Creates a page with the next weeks events drawn from the calendar pages
43
+
44
+
45
+
46
+ # Example of an automatically generated summary of any new pages whose title starts with 'blog'
47
+ AutomaticSummary.new( wiki,
48
+ :regexp_for_title => /^Blog/i,
49
+ :max_pages_to_show => 10,
50
+ :pagename => 'Recent Blog Entries',
51
+ :only_new_pages => true,
52
+ :lines_to_include => 10,
53
+ :include_metadata => true
54
+ )
55
+
56
+ # Possible settings for the Automatic Summary (with defaults)
57
+ # :regexp_for_title => /.*/, # These three regexps act as an AND
58
+ # :regexp_for_author => nil,
59
+ # :regexp_for_content => nil,
60
+ # :max_pages_to_show => nil,
61
+ # :pagename => 'Summary',
62
+ # :author => 'AutomaticSummary',
63
+ # :lines_to_include => nil, # nil puts a link, can pass a block instead to render
64
+ # :only_new_pages => false,
65
+ # :sort_pages_by => :created_on, # Could be :revised_on or :score or :name or :name_for_index, or :author
66
+ # :reverse_sort => false,
67
+ # :include_metadata => false, # Includes author and time in summary
68
+ # :summarise_revisions => false, # If true, then can contain several revisions for same page
69
+ # :remove_deleted_pages => true, # If false will keep references to deleted pages
70
+
71
+ # This is an array of titles that will NOT be automatically linked.
72
+ # Default is the 30 most common words in the english language
73
+ # Note that pages can still be created with these titles, and they can still be manually linked to.
74
+ banned_titles = IO.readlines('<%= settings[:root_directory] %>/banned_titles.txt').map { |title| title.strip }
75
+
76
+ # This takes a while, so do it last. Note that the banned_titles argument is optional.
77
+ AutomaticUpdateCrossLinks.new( wiki, view, banned_titles )
78
+ end
79
+ end
80
+
81
+ end
82
+
83
+ if $0 == __FILE__ then
84
+ StartSoks::start
85
+ end
@@ -0,0 +1 @@
1
+ 0.0.3
@@ -0,0 +1 @@
1
+ <%= page.content %>
@@ -0,0 +1,61 @@
1
+ <span class='pagename'><a href='/meta/<%= pagename %>'><%= pagename %></a></span>
2
+ <form method=post action='/save/<%= pagename %>' >
3
+ <table>
4
+ <tr>
5
+ <td>Title:</td>
6
+ <td><input name='newtitle' size = '60' value='<%= pagename %>' onClick="this.value == 'Type a title here' ? this.value = '' : true"/></td>
7
+ </tr>
8
+
9
+ <tr>
10
+ <td valign='top'>Content:</td>
11
+ <td>
12
+ <textarea name='content' rows=30 cols=60 onClick="this.value == 'Type what you want here and click save' ? this.value = '' : true" ><%= page.content %></textarea>
13
+ </td>
14
+ <td valign='top'>
15
+ <div class='tips'>
16
+ <ul>
17
+ <li>h1. big heading</li>
18
+ <li>h2. little heading</li>
19
+ <li>*bold text* = <b>bold text</b></li>
20
+ <li>_italic text_ = <i>italic text</i></li>
21
+ <li>* bullet one = &#8226; bullet one<br />
22
+ * bullet two = &#8226; bullet two</li>
23
+ <li># list one = 1. list one<br />
24
+ # list two = 2. list two</li>
25
+ <li>Most links are automatic</li>
26
+ <li>[[insert picture of title of picture]]</li>
27
+ <li><a href='http://hobix.com/textile/quick.html' target='textile_ref'>More</a></li>
28
+ </ul>
29
+ </div>
30
+ <td>
31
+ </tr>
32
+ <tr>
33
+ <td>Author:</td>
34
+ <td><a href='/<%= person %>'><%= person %></a> Quit browser to log out.</td>
35
+ </tr>
36
+ <tr>
37
+ <td></td>
38
+ <td><input name=action value='Save' type=submit accesskey="S"> <a href='/<%= pagename %>' accesskey="C" >(Do not Save)</a> or <a href='/delete/<%= pagename %>' accesskey='D'>(Delete)</a> this page.</td>
39
+ </tr>
40
+ </table>
41
+ </form>
42
+ <hr />
43
+ <% unless page.empty? %>
44
+ <p>The most recent change was made by <a href='/<%= page.author %>'><%= page.author %></a> who changed:</p>
45
+ <%
46
+ page.changes.each do |change_group|
47
+ change_group.each do |change|
48
+ case change[0]
49
+ when "-" %>
50
+ <del><%= change[1] %>. <%= change[2] %></del><br />
51
+ <% when "+" %>
52
+ <%= change[1] %>. <%= change[2] %><br />
53
+ <%
54
+ end
55
+ end
56
+ end
57
+ %>
58
+ <p>
59
+ <a href='/rollback/<%= pagename %>?revision=<%= page.number-1 %>' accesskey="U" >(Undo this change)</a> or <a href='/revisions/<%= pagename %>' accesskey="A" >(Show All changes)</a>
60
+ </p>
61
+ <% end %>