Thursday, January 17, 2008

100 posts, olpc, rst and Crunchy

This is the 100th post on this blog which I started to write a little over 3 years ago - shortly after I started my programming hobby. And, as it so happens, I received two gifts in the past 24 hours:
  • I received my give-one-get-one olpc in the mail today.
  • A student wrote a simple programs to add Crunchy-specific "directives" for docutils so that rst can be used to create Crunchy ready tutorials. More on this below.
I had seen the olpc at Pycon 2007 but, not having tried it back then, I did not realise how small the keyboard really is. I have fairly small hands but they are much too big to use the keyboard comfortably. I thought of using it to write this blog entry but quickly gave up on that idea.

It will take a while to fully explore the olpc. I am extremely impressed by the quality of the screen. However, it is a slow computer which apparently can only handle a "small" number of applications running concurrently - I managed to freeze it with about 8 applications running. I seemed to remember from the Pycon presentation that the track pad had 2 (or 3, depending on how you count them) active region, but only the central one seems to be active. Members of my family were surprise at the "plastic toy" appearance of the olpc but they all seem to be fairly impressed once they saw it running.

Now, all I have to do is to figure out how to make Crunchy run on it. :-)

Speaking of Crunchy, as part of Google's HOP contest, I had set up two tasks related to reStructured Text. One of them was to write a plugin so that a rst file could be loaded, transformed into a html file (by docutils) and displayed by Crunchy. This was done a while ago as I reported here. However, when this is done, Crunchy treats all the code elements on a page (inside "pre" tags) the same way, which is specified via the variable crunchy.no_markup. This does not allow for the same fine-tuning that is possible with the addition of vlam (very little added markup) to a normal html page.

The second rst task was to write "directives" so that vlam could be inserted inside rst pages. I had read quickly about rst directives and figured this would be fairly complicated. From my superficial reading, I *thought* it would require a modification to docutils that would have to be incorporated into the core (or make a special version of docutils that incorporated those directives). Of course this would make little sense. In any event, a student wrote a 200 lines program that defined most required "rst directives" for Crunchy, allowing to take a rst file as input and output an html file. All I had to do was to cut-and-paste the student's program into the existing rst plugin, change 2 lines of code, and I now have a fully working vlam-compatible rst loader for Crunchy.

This will be part of the next Crunchy release.

No comments: