On 7/31/11 3:05 PM, Rob Beezer wrote:
On Jul 31, 2:55 pm, Rob Beezer<goo...@beezer.cotse.net> wrote:
Some questions and observations.
Knew I was forgetting something.
8. Is there a way to "pre-load" the CodeMirror text area? Or more
precisely, what could I place into the HTML that would take some code
and load up the text area with the code as its content? Maybe this
should be an argument to the singlecell creation function?
Yes. Anything in that div should show up in the Codemirror box. In
order to get plain code, I'd suggest doing what mathjax does to wrap
code (put it in a script tag):
<div id="my_singlecell">
<script type="text/python-code">
print 'hi'
print 'even < works!'
</script>
</div>
I believe making "#my_singlecell" a singlecell will then put those two
lines in the singlecell div. I may have to turn off the current
behavior of saving what was in the singlecell div and restoring it on
refresh.
Thanks,
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org