newLISP wiki: some basics

Started by cormullion, April 06, 2007, 05:46:45 AM

Previous topic - Next topic

cormullion

I couldn't resist any longer and decided to try out the newLISP wiki running on my local machine.



What I've done so far is this:



1: downloaded the newLISP wiki 4.0 and moved the contents of the 'wiki' folder into /Library/Webserver/Documents.



2: In System Preferences, I switched on Personal Web Sharing, which gives me the following 'URI' to use: http://192.168.0.3/">http://192.168.0.3/.



3: In a web browser, I typed in 'http://192.168.0.3/">http://192.168.0.3/'.



The result is a nice "Index of /" page, delivered by Apache. I can see index.cgi, logo.png, etc, and these all display nicely (as source) when I click on them, although index.cgi displays 'The requested URL /index.cgi was not found on this server.'.



So it's all very easy to use (thanks to Lutz and Apple).



But I don't know what to do now. What is step 4?

Lutz

#1
The Apache webserver has to be configured to permit running CGI files or try the newLISP webserver like this (in a terminal window).


sudo newlisp -http -d 80 -w /Library/Webserver/Documents/wiki &


It will ask for your password. You have to use 'sudo' and the password because using port 80 requires it. Then in the browser type http://localhost/">http://localhost/



Previously in /Library/Webserver/Documents/ you have done:


sudo tar xzvf newlisp-wiki-4.0.tgz

My MacMini and MacBook came with a directory called 'Sites' in the home directory, and that is the directory I used to un-tar the wiki and then used:


sudo newlisp -http -d 80 -w /Users/lutzmueller/Sites/wiki

I believe /Library/Webserver/Documents/ should not be used to store user files, but the Sites directory in your home directory.



ps: there is also a way to configure newLISP server on the Mac permanently using a setup the /etc/xinetd and /etc/services files. This is described in the Code Patterns document.

cormullion

#2
And it was looking so promising! ;-)



So I've moved the wiki folder to ~/Sites/wiki. Unfortunately:


sudo newlisp -http -d 80 -w /path/to/Sites/wiki/

fails with



newLISP server setup on port 80 failed.



Trying without a port number works OK, though.



But surely I would have to tell the web browser to look in ~/Sites/wiki somehow...? It seems to be looking in /Library/Webserver still.

cormullion

#3
Ah, I've found the problem... Had to switch off Personal Web Sharing before running newlisp as http server... (OK, it seems obvious now... :-)



So this wiki business uses a completely different set up to the Mac's built-ini Personal Web Sharing stuff...



Now when I go http://localhost/index.cgi">http://localhost/index.cgi I get a web page! Hooray.



At this stage I reckon I can resume the documentation...

cormullion

#4
Another question: I'm trying to get an overview of this wiki, not getting in to formatting yet.



All the content goes into the pages directory, I gather. How does this handle subdirectories? I created a page in a subdirectory OK, and it displays, but it appears to cause problems when something like this is used:



http://localhost/index.cgi?search=folder1/test">http://localhost/index.cgi?search=folder1/test



;-> list or string expected in function replace : content



Obviously the '/' is the problem, but it half works, which puzzles me...

Lutz

#5
The wiki/pages directory should be exclusively managed by the wiki, don't create anything in there by other means.



Lutz

cormullion

#6
I don't get it - how do I get images and stuff into the system? Can't I add stuff to folders?

m i c h a e l

#7
Hi cormullion,



Yes, you can make folders in your wiki directory (say, wiki/images/ and wiki/audio/) and refer to the files in them this way:

"audio/some-playlist/some-audio-file.mp3"

or:

"images/some-image.png"



Very clean.



I agree that it's a little hard to get into the mindset of newLISP wiki initially, but after a day or so, I was saying goodbye to thoughts of using some complicated, much-harder-to-learn site-builder.



It's once you begin to maintain the site that you start to appreciate how easy it is to do the various upkeep duties (backing up, restoring, creating and deleting pages, etc.). Every time I use it, I'm almost giddy :-)



m i c h a e l

tom

#8
[image:pix/pic.png ]



is how I included an image in my newlisp wiki, but I had to upload it by hand ( I used scp) It can be a relative path.  As far as I know, the pages directory doesn't handle subdirectories, and you can't upload anything but text to pages from the wiki itself.

cormullion

#9
Thanks - the nebulous dark mass is starting to solidify. Every page of text content has to be in pages/, then, so probably some sort of naming scheme is the way to go...

tom

#10
Quote from: "cormullion"Thanks - the nebulous dark mass is starting to solidify. Every page of text content has to be in pages/, then, so probably some sort of naming scheme is the way to go...


The only scheme the wiki understands is "text_file."  You can bypass the wiki by putting files named like this directly into the pages directory, or the wiki does it automatically with [[text file]] from a browser's text field.



I just stuck an image in mine as a test, and the wiki complained when I tried to view it.





On another note,  one enhancement I'd like to see would add subdirectory creation.  The way nl wiki handles locking and protection and stuff is with the first line of wiki pages.  The first line of a locked page would have [locked:password] on it.  It would be cool if you could have



[locked:password] [sub:thisdir] [sub:sub:thatdir]



it would be a way to organize different users or catagories.

cormullion

#11
Having great fun here - newLISP wikiCMS is very clever - but I'm still coming up with dumb questions... ;-)



I've got some styles sorted out, and played with the template, so the menu appears on the left. The default template is set up more for wiki than CMS, so now I want to move towards CMS-mode by displaying a menu of relevant pages on the left, but not sure how to do this. Where would I put this, - instead of the following?


<%
(if has-menu
 (begin
  (println {<div>})
  (if (file? (append "pages/" page-name))
      (if is-protected
          (print {<p><a>Edit protected</a></p>})
          ;
          (print {<p><a>Edit</a></p>})))
  (println {<p><a>Home</a></p>}
           {<p><a>Files</a></p>}
           {<p><a>Index</a></p>}
           {<p><a>Changes</a></p>}
           {<p><a>References</a></p>})
  (println {</div>})))
%>


Presumably I can use one of these:



[search:pattern] displays a table of pages with pattern in content

[title:pattern] displays a table of pages with pattern in title  



but I don't want to put any weird pattern in the title, just so that the pages get listed...



Also, some misc questions: what's the "Left" page for? And what's the "nifty" DIV for?



Another question - I'm trying to work out what tools there are, and I put [title:z] in a page. The listing of files was this:



.DS_Store

Bottom_Bar

Browser_Title

Changes

Click_To_Edit_and_Create

Contacts

Copyright_Text

Default_Style

FeatureComments

Home

How_To_Customize

How_To_Edit_Text

How_To_Use_Advanced_Features

Left_Bar

News

Title_Text

Wiki_Link



Only one of these contains a z in the title? I'm also having trouble understanding [search:z] as well... it includes every file in pages/except 'contacts'... Am I misunderstanding something?

cormullion

#12
any thoughts ? i might have another go at this this week

Lutz

#13
Typically when you use newlisp-wiki more as a CMS than a Wiki you would close it up using the security open/closed uption in the setup menu.



This will make the standard menu on the bottom disappear completely. You could then hard code your important links into the template.html page using normal HTML <a>...</a> tags and not a newLISP function.



The 'Left' page is the rest of experimenting with a left side-bar appearing to the left of the content box. You would put a CSS division with code (HTML + newLISP) similar to class="bottombar" into your template.html.



Doing it this way would permit you have a left sidebar similar to manage as your "Title Text" and "Botom Bar" pages. Of course you could also just hardcode the stuff into template.html as described first in this post.



The "nifty corners" stuff is there to make the round corners on the newlisp.org home page. If you look into the source of the newlisp.org home page you see how this is done. This link explains you all about it:



http://www.html.it/articoli/nifty/index.html">http://www.html.it/articoli/nifty/index.html



Lutz

rickyboy

#14
Like cormullion, I'm looking into newLISP wiki 4.0, and I have a question.  Why, when you opt for closed security, does each page not publish its title?



I removed this restriction in my version[*], because I wanted a closed system (one that only I updated) but I still wanted page titles (pagenames) displayed.  However, I dislike having my own version of the code which I'll have to reconcile with the new official version, when that comes along.



Any thoughts?  --Rick

___________________

[*] -- Here's my change in diff:
<     (set 'has-pagename (and (not (find {[(notitle|noname):]} abody 512)) (= SETUP:security "open")))
---
>     (set 'has-pagename (not (find {[(notitle|noname):]} abody 512)))
(λx. x x) (λx. x x)