Become a Try Ruby Narrator Straightaway #
Well, with the Try Ruby tutorial done, it’s time to work on adding a number of other more advanced tutorials. Or even just different takes on starting off.
You can find a list of tutorials in the TUTORIALS
constant. To start a small test tutorial I started: run 'meta'
. Alternatively, they’re listed in /Tutorials
.
>> Dir['/Tutorials/*'] => [".", "..", "intro.rb", "meta.rb"] >> require '/Tutorials/intro' => true
Finally, if you want to link directly to a tutorial: http://tryruby.hobix.com/?meta.
To add your own tutorial, check out from http://code.whytheluckystiff.net/svn/tryruby/trunk/htdocs/tutorials. Add your-tutorial.html, following the conventions in meta.html and intro.html.
- Each lesson page is contained in a
div
with a CSS class ofstretcher
. - Summaries, chapter headers are a CSS class of
chapmark
. - Load code into the interpreter with a
div
of CSS class ofload
, placed inside the lesson page. It will be executed when the page is displayed. - Check answers with
answer
andstdout
classeddiv
elements. These elements contain a regular expression. If the answer matches the regexp, the lesson proceeds.
I still need a script to update the site from SVN. For now, I’ll push things over manually each night.
Safari patches are applied now. Sorry about that. No browser bigotry going on here, just compatibility infantility.
Ezra
_why… Sadly the try ruby site seems to be broken in Safari again. I don’t get any prompt at all. But it works fine in Firefox on OSX .
Leon Spencer
In Camino, in the Your Own Turf section, the tutorial doesn’t change page after the File.open(”/Home/comics.txt”, “a”) do |f|. It just sits there, waiting for a block that will never come, shivering in the darkness between the |.
Leon Spencer
... and does the same thing in Firefox 1.5.
Leon Spencer
... and summary #5. Any incomplete statement results not in a page turn, but only of aching inertia borne of loneliness and regret.
cracker
B0rked in Safari: seconded.
brian
likewise for shiira (very similar to safari but sometimes more picky).
Numb
Why, you are my hero.
sleeper
Does it means that we could begin the translation of the tutorials too ?
Danno
Indeed, I think that if why allows it, the establishment of a Poignant Guide translation body would be most prudent.
The best thing would be to slice it up into chunks that would take roughly… 2 hours to transpose, that way filling in a section would be easy and quick enough that any Ruby guru could drop one in.
sleeper
Danno: In fact translation of Poignant Guide is already started ;) For the time being German and French are ongoing
Danno
Ho Ho! But I think you know what I mean.
I18N can come later for the TryRuby, perhaps.
Weirdbro
Requiring meta.rb doesn’t cause it to run. You have to figure out what it does, and then just “run ‘meta’”
why
Hmm.. can anyone get the popup to work? Type
help 5
and try that chapter out. I can’t get the IFRAME to switch its src.harold
waxbanks
Why et al. – just so’s you know, Try Ruby is fantastic. Surely one of the most engaging programming tutorials I’ve ever seen. As with the Poignant Guide, you’ve made a little piece of art here, masquerading as tech.
Gorgeous.
Comments are closed for this entry.