Wiki On Zaurus

Goal: run the same Python-based WikiEngine on my IBook and my Sharp Zaurus, then set up some Data Synch routines...

Outcome summary

  • tweaked PikiPiki
  • launch by doing: go into Terminal; do cd documents/wiki; do '/usr/bin/python pcgi.py';

July'2005

Decided to go with this Python distribution, and grab the core, net-client, and net-server chunks.

  • here's some discussion of alternatives...
  • installed 'core' with no problem, and ran it. Excellent.
  • installed 'net-client' - it gave me a warning about now having 'io' and 'mime', which also leads me to 'math', etc.

Tried to run Simple Http Server, but got error which makes it clear I'm missing 'linecache.py'. Blech that's not in this distribution for Sharp Rom Zaurus, it's in another distribution from the same guy... How easy is it going to be to just sneak that module over?

  • copied 'linecache.py' over. Now no 'string.py'! After that, no 'shutil.py'.

Now when run get "serving on 0.0.0.0 port 8000"

  • bring up Opera, go to that URI
  • I get a directory listing! I pick a python file, and I get to see it.
  • I make 2 HTML pages that link to each other (using full-qualified URI-s so I know it's not just using the file: protocol), copy them over. Can load one, then follow link to the other, follow link back again! See title, bold, color links, etc.!

Next:

  • make real subclass of Simple Http Server to handle a real directory?
  • or jump right to some existing WikiEngine?
  • some notes on Simple Http Server
  • or maybe use Cgi Http Server with one of the Wikiengine-s that use CGI.
    • there's a super-lite [approach](http://feetup.org/blog/dev/python/Wiki Lite.html) using Wy Py and Cgi Http Server and Basic Http Server - that might be most promising
      • had to copy some more stuff over, plus hack a little code to get the 'sre' Regular Expression module working
      • now getting empty page but no error message, ugh how fun to debug that
    • switched to slightly longer version mentioned in the original reference.
      • Then needed to change the permissions on the file, tweak the uri in the same way, etc.
      • starting to work!
      • doesn't seem to be rendering links for Wiki Name-s!
      • doesn't seem to actually remember the page contents - if you reload you still see the contents, but if you hit Edit you get an empty textarea.
      • Opera died from lack of memory.
      • restarted Opera, tried again, had a tiny bit more success but still pretty bad...
      • I hacked a few pages via a text editor; backlinks even give me a list, except I'm just seeing the raw markup version rather than the pretty html. Not getting any good HTML at all - even simple paragraphs aren't getting separated. (Lack of View Source in this Opera is really annoying.) http://static.flickr.com/31/43577398_6ee87c5468_t.jpg
    • got the same code running on MacOs X. Works just right, rendering links, etc. At some point realized I had put some linebreaks in place where there were semi-colons, then realized that some of those weren't end-lines, but were hard constants within other stuff, so undid all that. But when I looked more closely at the version on the Zaurus, that one looked fine. Actually I went back and tweaked the linebreaks again anyway for a little bit of readability - have both platforms the same, and the Mac is running fine. Still half-working on Zaurus.
      • (at some point need to integrate some bits to make this server stoppable. In the meantime I'll try 'kill -s kill pid')
    • now thinking there's no point in hacking on this approach, given that the SmartAscii is so non-smart. Will start to play with some different WikiEngine-s. I'd just jump to MoinMoin, but (a) I'm pretty sure I hate its SmartAscii, and (b) it smells loverly big-complicated.....

Got PikiPiki WikiEngine running easily, but hate the SmartAscii it shares with MoinMoin. But maybe I should live with it for the sake of Wiki Standards...

  • get it running on MacOs X first. A few oddities with page loads, esp when using '/' instead of '?' as delimiter.
    • I suspect my little CGI stub is the culprit
      • which could have been one of the problems with Wy Py also...

Install PikiPiki on Sharp Zaurus.

  • get "can't work out query" page back - huh that means the Regular Expression check against the page-name isn't working.
  • so I hack out that code and just pass the page contents without checking whether it's a valid Wiki Name. I get the page contents, but without any of the HTML rendering! Just like in Wy Py!

So now I'm thinking that the Regular Expression library on the Sharp Zaurus is seriously not working or something (though it's not throwing off an exception, just never matching anything). I wonder if there's a Unit Test in there or something?

Aug'2005 - try to fix things

  • remove 're*' and 'sre*' from Zaurus
  • go back to source of feeds, grab the 're' library. Suspect I did something weird last time, maybe took from the non-Sharp Rom distribution, because now get demand for 'strold' library, so I add that.
  • put back in the original PikiPiki. Find I have to rename the script from plain 'piki' to 'piki.py'.
  • It's working!
  • But getting some strange results after editing. Sometimes clicking on an existing-page link, I'll get an edit form. I suspect it's some weird caching-effect... actually tweaking the code to pass the page-name as an argument (via '?' instead of just '/') seemed to help a lot
  • But I am having cache problems which cause pages not to show their changes unless I Reload (even an edit form!), which is very frustrating.

Despite the cache issue, have moved all my To-Do List-s over into Wiki. Success! http://static.flickr.com/25/43577445_b6faa63bef_t.jpg

Aug11'2005

  • tweak Regular Expression-s to handle my variants on WikiWord rules (can have consecutive caps and acronyms, include numbers anywhere in name except 1st char), plus decide to use double-brackets for a different patterns matching the BlogBit naming convention I use here.
  • all working, except the RecentChanges shows blank. Need to look at edit log
    • ah, I think the issue is that double-brackets was already used for macros calls - so need a different FreeLinks delimiter (I'm not doing full FreeLinks, I mainly want a variant that's like a date-stamp like I do on Zwiki for BlogBits).
      • single-brackets - no, I like to use that in body text sometimes.
      • bracket plus quotes? MoinMoin:HelpOnPageCreation (just used to allow spaces in names, not necessarily special chars)
      • double-parens? bracket-plus-paren?
        • actually, the double-parens might not be bad, as on the Sharp Zaurus Keyboard it doesn't smell easy to make those brackets anyway....
    • settled on bracket-plus-quote - thought it was breaking the 'Word Index' macro, but the real problem was I was mixing tabs and spaces (haven't gotten that worked out yet in JEdit), so that's cool
    • also inclined to move BlogBit pattern to starting straight with year-number, rather than with leading 'z' like I do in Zwiki. Though not quite comfortable with that decision, just because of potential for cross-compatibility...

Aug29'2005

  • everything looking pretty good (on code running on MacOs X - will need to roll out to Sharp Zaurus next)
  • though realized that RecentChanges in this code is case-insensitive and not careful about checking just for whole-words, so get some false-positive matches. Example: I was playing with ATT as acronym page, and Back Link led me to one page containing "attached" and another containing "formatted". Argh.
    • But probably not a priority for now (for more typical WikiWord-s it's probably more of a feature than a bug).
    • but this would be a problem if it was the basis for a Touch Graph view.

Aug30

  • trying to fix Opera caching problem - success!
    • found config file in '/home/root/.opera/'
    • edited per this doc - setting 'Docs Modification=1' was key

Aug31

  • try playing around with various MacOs X ways to GUI mount an FTP. I figured that would be interactive enough that I wouldn't end up needing to write any synch code...
    • unfortunately none of them seem to work - they take forever to prompt me for an id/password, then they fail, etc.
    • back to Command Line
      • open Terminal window
      • cd to IBook directory where I want to work
      • FTP, open connection to Sharp Zaurus
      • cd to Zaurus directory where I want to work
      • then do FTP commands - put, get, etc.

Sept'2005 - Converting Palm Pilot notes to Wiki pages

I have old notes going back to 1998 or so. Various conversion processes led me to have a text file for each old folder/category, with all the notes for the category dumped together (with a clear separator, etc.).

Heh, actually wrote my first Python 'class' from scratch.

Some issues that came up

  • did some clean-up of text in JEdit before conversion (dashes into *, correct line breaks and spacing for bullet lists, etc.)
  • a single-word Subject/firstLine for a note doesn't make a nice WikiWord, so have to review list of pages generated, find those cases, and go tweak the source document
  • I didn't even have unique names for notes within a category sometimes, so have to review and tweak, etc.
  • if I already named a note with a WikiWord, then using Python's 'title' function wipes out the mid-caps. So I have to write my own function to change cases in the ways I want to...
  • I tend to often name notes with a topic followed by a 6-dig yymmdd - I should probably convert these to use my "zyyyy-mm-dd-title" format...

I definitely have an issue with names duplicated across different contexts (NameSpace) - e.g. if I'm thinking about multiple possible Start Up-s then each one might have its own Elevator Pitch page. What am I going to do about that?

  • prefix each with context name: Business One Elevator Pitch, Business Two Elevator Pitch - blech long names; but maybe easiest solution if not many names will get used in multiple contexts. Short-term hack taken.
  • use Sub Pages features that some WikiEngines have (does PikiPiki do that? Nope.). You can more easily link back-up to pages in the main namespace, and you get a single integrated RecentChanges view.
    • do I see if I can run MoinMoin on the Zaurus, or do I try and steal just that little bit and put it into PikiPiki?
  • make multiple spaces:
    • probably best idea, given potential for writing lots of spec pages, etc. - though will probably have some transition process where new ideas will start in the root/core, then become their own spaces.
    • how accomplish this?
    • ugh I'm too lazy for these steps I think.
  • Feel like I need to think in the bigger picture - what happens in a WikiWeb with everyone having lots of wikis of varying types...

Oct20'2005 update

  • realized I need to wrap blog-bit listing pages in bracket-dblquote to make them link - just did it by hand for now
  • argh Sharp Zaurus FTP doesn't support 'mget' so it's going to be a huge pain to get files back from the zaurus to the IBook! (At least mput works, since it's driven from the MacOs X side) so I could dump a few hundred notes onto the Z.)
    • Jan'2008 update: well, for a 1-time thing, using an SD card might be easiest...

Apr'2007

https://www.flickr.com/photos/webseitz/tags/sharpzaurus/


Edited:    |       |    Search Twitter for discussion