#5653: [with patch, needs work] display docstrings in the notebook using html 
and
jsMath
-------------------------+--------------------------------------------------
 Reporter:  jhpalmieri   |       Owner:  boothby   
     Type:  enhancement  |      Status:  new       
 Priority:  major        |   Milestone:  sage-3.4.2
Component:  notebook     |    Keywords:            
-------------------------+--------------------------------------------------
 The attached patch shouldn't affect docstrings from the command line
 (well, except that it should replace 'a \times b' with 'a x b'). In the
 notebook, though:
 {{{
 identity_matrix(TAB
 }}}
 should pop open the usual docstring, but it's not in html <pre> format:
 see [http://sage.math.washington.edu/home/palmieri/misc/docstring.png this
 picture]. It's in a variable width font, with math typeset correctly --
 see the $n \times n$ in the first line of the docstring -- and with
 example blocks in <pre> format.

 This is marked "needs work" for two reasons, one of which is a mystery to
 me:

 1. (the mystery) start a fresh worksheet and type
 {{{
 identity_matrix? [SHIFT-RETURN]
 }}}
 This will be typeset in <pre> format. Then type
 {{{
 identity_matrix? [TAB]
 }}}
 This is typeset nicely. I don't know what the difference is.

 2. Math is not handled properly.  I have a hack in place to typeset inline
 math ("{{{... `blah` ...}}}") in the docstring, but not displayed math
 (directive "{{{.. math::}}}"). This is because I'm using docutils to
 convert the docstring to html, and docutils doesn't know about math. I
 would like to use Sphinx to do the conversion (in which case more math
 should be handled, and there would also be some syntax highlighting), but
 I don't know how to use Sphinx well enough to do that.  I've posted a
 question to the sphinx-dev group, and if I hear anything, I'll post it
 here or update the ticket.

 Please test out the patch, improve it, rewrite it, whatever.

 (By the way, Tom Boothby deserves credit for getting jsMath to process the
 docstring.)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5653>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to