Re: [Zope-dev] the right way to do wiki in zope ?
In another thread, Anthony wrote:
Question: Can we make ZClasses directly on ZPT?
Ditto. If not, I wondered if one could actually hack wiki functionality on there using nothing but DTML. I'm not yet convinced you couldn't. Zclasses - mindbending stuff. I did some experimenting on my local server, and here's where I'm at. I made a Zclass called WikiDTMLPage, based on DTML Document. I gave it an index_html method which translates words which match the wiki link pattern to relative hyperlinks, this way: <dtml-var "_.ts_regex.gsub( '\([A-Z]+[a-z]+[A-Z][A-Za-z]*\|[A-Z][A-Z]+[a-z][A-Za-z]*\|_[\\\w.:_]+_\)', '<A HREF=\\1>\\1</a>', data) "> data is a zclass property I added; I'd rather use the DTML document's existing data attribute but couldn't find the right syntax. I added ts_regex to the DTML namespace - DC, is there any reason not to provide ts_regex or re to DTML users ? Regexps are darn useful. This allows you to create & edit wiki pages, displays the links, but doesn't help you create new pages of course. A helper external method for this class seems like a good way to go.
Once I fix up the namespace mangling that Zope is doing (and which prevents freezing it - python is already frozen) I'll whip up a ZikiSpace.
Excellent. -Simon
On 20 Aug 1999, Simon Michael wrote:
In another thread, Anthony wrote: I gave it an index_html method which translates words which match the wiki link pattern to relative hyperlinks, this way:
<dtml-var "_.ts_regex.gsub( '\([A-Z]+[a-z]+[A-Z][A-Za-z]*\|[A-Z][A-Z]+[a-z][A-Za-z]*\|_[\\\w.:_]+_\)', '<A HREF=\\1>\\1</a>', data) ">
I was thinking more along the lines of how Everything (http://everything.blockstackers.com) does links. Here, you surround the link in brackets like so: [ZikiSpace] and it is turned into a hyperlink. Then, when you click on it if the link doesn't exist a new instance of Zikibit is created and you are dumped into the edit mode. Thereafter, you are lead directly to the view mode. With regards to statistics... I was thinking we could could have a google (www.google.com) style 1-10 rating button down the bottom so that we can catagorise on coolness as well as popularility and frequency of editing. Then, we could have: [Zikispace text page] Rate this page: 1 2 3 4 5 6 7 8 9 10 [Edit this page] [Roadmap] [How to get here] Roadmap leads to a java app showing a roadmap of where you have been in ZikiSpace (the new session object might come in handy ;) How to get here shows backlinks grouped by catagory items (see Everything for the concepts behind this). Cheers, Anthony Pfrunder PS: Did you know that you can freeze python15.dll down to 350Kbytes, python script library to 450KBytes and the Zope script library to 600KBytes -> total size of directory: 1.5-2MBytes!! Look for Zwin next week folks!
participants (2)
-
Anthony Pfrunder -
Simon Michael