Soks

D

Daniel Lewis

Subject: Soks-Wiki (WEBrick, Ruby On Rails)
Related Website: http://www.soks.org/

Question:

Is there a way to add additional html files onto the Soks servlet?

At the moment I have my Soks-Wiki, which is happily getting and
setting content... But I want to put a folder with html files into the
wiki folder. A structure a bit like this:

* soks-wiki
* * views/
* * banned_titles.txt
* * start.rb
* * version.txt

* * attachment/

* * caches/

* * content/
* * * Sidebar%20Page.textile

* * htmlAdditions/ # <---- This would be the
folder I want to add
* * * randomHtmlFile.html # <----- With some html files
* * * ...... .html # <----- With some html files

Now ideally I'd like to have a link from the side bar to the
"htmlAdditions" folder, and this all being done on the same soks
server.

Anyone have any ideas? Anyone know anyone that would be able to help?

Thanks for any info.

Daniel Lewis.
 
D

Daniel Lewis

Thats fantastic, worked perfectly.

Thank you so much.
(Soks is brilliant :) )

Daniel.

Hello Daniel

Is there a way to add additional html files onto the Soks servlet?

At the moment I have my Soks-Wiki, which is happily getting and
setting content... But I want to put a folder with html files into the
wiki folder. A structure a bit like this:

Now ideally I'd like to have a link from the side bar to the
"htmlAdditions" folder, and this all being done on the same soks
server.

Anyone have any ideas? Anyone know anyone that would be able to help?

Assuming you are using a reasonably recent version of Soks:

Open your start.rb file

Look for a line like this:
servlet.static_file_directories[ 'Attachment' ] =3D "#{root_directory}/
attachment"

And add another line like this just after it:
servlet.static_file_directories[ 'Htmladditions' ] =3D "#
{root_directory}/htmlAdditions"

You should now be able to browse the static file directory by going to:

http://whereveryourwikiis/Htmladditions/randomHtmlFile.html

You can put a link to the directory by typing this on your sidebar page:
"Pretty name":/Htmladditions/randomHtmlFile.html

Note, in my testing that this works just now I've discovered two bugs:
1) With servlet.static_file_directories[ 'Htmladditions' ] the
'Htmladditions' MUST start with a capital letter, and the remainder
must be lowercase (e.g. htmlAdditions would not work)
2) http://whereveryourwikiis/Htmladditions or http://
whereveryourwikiis/Htmladditions/ will not work. You must specify a
filename such as http://whereveryourwikiis/Htmladditions/index.html

I'll fix these for the next release. Let me know if you have any
other bugs or questions.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,190
Messages
2,571,017
Members
47,618
Latest member
Leemorton01

Latest Threads

Top