Since my last post that described briefly some features of the new Crunchy engine, I have not had much time to work on Crunchy. Johannes too has been fairly busy so that Crunchy development pretty much stopped, until the beginning of Google Summer of Code. Two students joined the Crunchy team: Edin Salković and Bryan Psimas. Unfortunately, due to other commitments, Edin was not able to continue with his SoC project - but he did manage to write the prototype of a new plugin for Crunchy that I will describe below.
The new Crunchy engine now works extremely well. As I wrote in my previous post, Crunchy is now more responsive; it supports simultaneous execution of multiple code sample, proper input (stdin) handling from the webpage browser and the api (for writing tutorials) has been significantly simplified as there is no longer be any need to have an embedded "canvas" call in a tutorial: the user is now able to load a graphics dynamically anywhere on a page. These graphics can even include simple animations using pure Python code (for the end user - javascript behind the scene for us, unfortunately).
There is more. For example:
- it is now possible to style <code> elements;
- Python code sample (either inside <pre> or <code>) that contain pre-existing html markup can now be handled by Crunchy without generating an error (blank page!) as before;
- it is now possible to specify a starting number different from 1 when requesting that line numbers be added to a code sample;
- when it styles the code, Crunchy now automatically detects if a given code sample represents an interpreter session or a "normal" code sample;
- it is now possible to use input() and raw_input() with an interpreter, and the result appears inside the page displayed by the browser.
Quite a few features from the "old Crunchy" need to be implemented (e.g. menus including a way to properly quit the application, translations, update:
One of the "problems" with the old Crunchy is that it did require two things from a tutorial writer:
- That the html code written be W3C compliant (with no warning, no unclosed tags, etc.).
- That Crunchy specific markup (vlam = very little additional markup) be added to instruct Crunchy to add interactive elements.
And ... Crunchy has now been written so that it automatically inserts a Python interpreter whenever it sees a bare <pre> (i.e. with nam = no additional markup). As a result, one can now browse the official Python tutorial with Crunchy and interact with it.
This automatic insertion of an interpreter sometimes yields too many interpreter inserted on a page than really needed; it is better to hand craft a tutorial. However, it should make Crunchy a lot more useful to many more people.
For those interested in trying out the "new Crunchy", an alpha release is available. If you have never used Crunchy before, you should try version 0.8.2 first and go through the tutorial from the menu.
No comments:
Post a Comment
Spammers: none shall pass.
Note: Only a member of this blog may post a comment.