On 5/14/06, <b class="gmail_sendername">kirby urner</b> &lt;<a href="mailto:kirby.urner@gmail.com">kirby.urner@gmail.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've fallen behind on Crunchy Frog.<br><br>Having been through the first version's tutorial, I was left wondering<br>what the back end API looks like i.e. suppose I'm a teacher wanting to<br>whip out some Crunchy Frog oeuvre d'evers, what would that look like?
<br>Do I need to know any HTML?</blockquote><div><br><br>&nbsp;Yes, one needs to know html, or at the very least be able to make some small changes to an existing html file.&nbsp; My assumption is that most tutorials are available as html files.&nbsp; 
<br><br>For those that haven't read the latest, hopefully more explicit tutorial, here's (in a nutshell) what Crunchy Frog requires and allows.<br><br>1. Requirement: tutorial written in (x)html.<br><br>2. Possibilities:<br>
a) Given some sample Python code (at the interpreter) in the html file:<br>[Note: I know that I should have written &amp;gt;&amp;gt;&amp;gt; rather than &gt;&gt;&gt; in the code below]<br><br>&lt;pre&gt;<br>&gt;&gt;&gt; print &quot;Hello world!&quot;
<br>Hello world!<br>&gt;&gt;&gt; a = 6*7<br>&gt;&gt;&gt; print a<br>42<br>&lt;/pre&gt;<br><br>One can embed a Python interpreter prompt by changing the first line above to:<br>&lt;pre vlam=&quot;interpreter&quot;&gt;<br><br>
&quot;vlam&quot; stands for &quot;Very Little Added Markup.&quot;<br><br>When the html file will be served to your browser by Crunchy Frog, an interpreter (somewhat similar to Ian Bicking's HTConsole) will appear just below the &lt;/pre&gt; tag, allowing the user to try to reproduce the above example, or simply try other Python code.
<br><br>b) Given some sample code (not an interpreter example) in an html file:<br>&lt;pre&gt;<br>def times2(n):<br>&nbsp;&nbsp;&nbsp; return n*2<br>&lt;/pre&gt;<br><br>One can embed an &quot;editor&quot; (html textarea) with an &quot;Evaluate&quot; button next to it by
<br>changing the first line to:<br>&lt;pre vlam=&quot;editor&quot;&gt;<br><br>This &quot;editor&quot;, which will appear just below the sample code again, will allow the user to enter some code in it (perhaps the example written above) and try running it as a Python script by pressing the &quot;Evaluate&quot; button.&nbsp; The output will appear below. The code in the editor can then be changed, and run again, as often as desired.
<br><br>c) Given some sample &quot;doctest&quot; result in an html file<br>&lt;pre&gt;<br>&quot;&quot;&quot;<br>&gt;&gt;&gt; print times2(4)<br>8<br>&quot;&quot;&quot;<br>&lt;/pre&gt;<br>One can embed an &quot;editor&quot; below with an &quot;Evaluate&quot; button which, when pressed, will run the above code and test to see if the doctest string can be reproduced.&nbsp; This is done by changing the first line to
<br>&lt;pre vlam=&quot;doctest&quot;&gt;<br><br>There's a bit more to it than what I wrote above, but it should give the flavor.<br></div></div><br>André<br>