Hello,

I am working on adjusting SageMathCell to Volker's display system and have 
a few questions mostly for him, but perhaps of interest to others as well:
    
1) What exactly is the point of display_immediately and when is it supposed 
to be called? The default displayhook calls display_immediately. The 
IPython notebook conversely calls displayhook from display_immediately 
defined in the common base class, while the command line overrides it with 
a different call to displayhook. (In which case the "common" version should 
be moved to the notebook class.)

2) Calling "data field" differently in each output container is 
inconvenient, since similar containers cannot be handled together, rather 
one should copy-paste the same code again and again. I would much prefer 
writing
{{{
elif isinstance(rich_output, (OutputImagePng, OutputImagePng, ...)):
    msg = self.launch_viewer(
        rich_output.data.filename(), plain_text.text.get())
    return ({u'text/plain': msg}, {})
}}}
rather than
{{{
elif isinstance(rich_output, OutputImagePng):
    msg = self.launch_viewer(
        rich_output.png.filename(ext='png'), plain_text.text.get())
    return ({u'text/plain': msg}, {})
elif isinstance(rich_output, OutputImageGif):
    msg = self.launch_viewer(
        rich_output.gif.filename(ext='gif'), plain_text.text.get())
    return ({u'text/plain': msg}, {})
...
}}}
Note that the current/second variant requires replacing Png with Gif in 3 
different places and different cases. (The first one would require 
implementing default extension mechanism.)

3) html("string") should render "string" as a piece of HTML code rather 
than just printing it if frontend supports it - I am not clear on how to 
implement it in the current model, it seems to me that OutputHTML format 
should be added and supported.
    
4) show(x^2) and view(x^2) should trigger display of OutputLatex, but it 
does not seem to be the case - it seems to me that SageNB still relies on 
old mess and IPython supports only global preferences for displaying 
formulas.
    
5) Just to confirm - only SageNB depends now on EMBEDDED_MODE == True 
blocks, correct?

Thank you!
Andrey

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to