On Monday, March 19, 2018 at 11:52:55 AM UTC, Erik Bray wrote:
>
> On Mon, Mar 19, 2018 at 12:16 PM, Emmanuel Charpentier 
> <emanuel.c...@gmail.com <javascript:>> wrote: 
> > 
> > 
> > Le lundi 19 mars 2018 11:44:33 UTC+1, Erik Bray a écrit : 
> >> 
> >> This question raised an issue I was not aware of (and didn't see any 
> >> existing tickets for): 
> >> 
> >> https://ask.sagemath.org/question/41592/inside-help-not-processed/# 
> >> 
> >> When viewing docs for Sage objects in the Jupyter Notebook, they are 
> >> just displayed as plain text--this is a major shortcoming over SageNB 
> >> which renders the latex in the online help. 
> >> 
> >> What's worse, in the Notebook the docs are passed through the same 
> >> "de-texification" that is used on the command-line to make some tex 
> >> readable in plain ASCII.  There are two issues here: 
> >> 
> >> 1) The de-texification is obviously imperfect.  The particular example 
> >> contained \longrightarrow which it didn't know what to do with. 
> >> Easily fixable, but beside the point.  It will never be 100% perfect 
> >> (it also looks like it could benefit tremendously from Unicode support 
> >> which has never been added to it). 
> > 
> > 
> > De-texification is *hard* : see the various solutions enumerated here... 
> >> 
> >> 
> >> 2) It goes without saying that in the Notebook help should be rendered 
> >> by MathJax.  It's not clear to me that the Jupyter Notebook actually 
> >> knows that it can/should run MathJax over the help window, but 
> >> currently it does not appear to run MathJax over the help panel (even 
> >> if I explicitly wrap equations in dollar signs or something). 
> > 
> > 
> > It can be done. See for an (approximate) example what do the two 
> available R 
> > Jupyter kernels (respectively IRkernel and Juniper). I'ts only 
> approximate, 
> > since R help pahges use their own sui generis markup (Rd). 
>
> Thanks for pointing those out.  I looked at the source code for 
> Juniper and indeed found the part where it handles introspection: 
>
>
> https://github.com/JuniperKernel/JuniperKernel/blob/master/R/inspect_request.R
>  
>
> So it basically returns the help as HTML.  It seems we can actually 
> return a multi-part MIME message with all sorts of data in it (images, 
> etc.) as well. 
>

Have you tried asking Jupyter people/github how this can be done---I cannot 
imagine Sage is the only Python library
which has docstrings with MathJax ready to be used in them...
 

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to