#10637: Implement sage -sws2rst
------------------------------------------------------------+---------------
       Reporter:  nthiery                                   |         Owner:  
jason, mpatel, was                                                            
           Type:  enhancement                               |        Status:  
needs_work                                                                    
       Priority:  major                                     |     Milestone:  
sage-5.4                                                                      
      Component:  notebook                                  |    Resolution:    
                                                                            
       Keywords:  ReST, worksheet                           |   Work issues:  
answer questions, math formatting, lists, maybe absolute paths?               
Report Upstream:  Workaround found; Bug reported upstream.  |     Reviewers:  
Nicolas ThiƩry, Jason Grout, Karl-Dieter Crisman, Jason Bandlow, John Palmieri
        Authors:  Pablo Angulo, Karl-Dieter Crisman         |     Merged in:    
                                                                            
   Dependencies:  #11080, #11459                            |      Stopgaps:    
                                                                            
------------------------------------------------------------+---------------

Comment (by kcrisman):

 > > Okay, I think that what happens is that in `replace_latex` you only
 replace these characters ''if'' there was no LaTeX to replace in the first
 place.  But of course that might not always be the case.  This isn't a
 huge issue, but worth pointing out and probably easy to fix.
 >
 > Solved: now I replace those chars outside of LaTex as many times as
 needed.
 Check.

 > > In `visit_li`, I think that replacing
 > > {{{
 > >         return (' '*self._nested_list
 > >                 + ('#. ' if self._inside_ol else '- ')
 > >                 +' '.join(self.visit(tag) for tag in node.contents))
 > > }}}
 > > with `' '*(self._nested_list-1)` should work.  That was also a very
 minor point.
 >
 > ok, did something similar. It did improve a lot.
 Ok, I found it - a little tricky!

 > > Would reversing the setting in `visit_ol` for `visit_ul` work for
 allowing nested mixed lists?
 > > {{{
 > > self._inside_ol = False
 > > blah
 > > self._inside_ol = True
 > > }}}
 >
 > ok, but I did something slightly more complex.
 Yup, and I like it.
 > > Would replacing, in `visit_display`,
 > > {{{
 > > return ('\n.. MATH::\n\n    ' +
 > > }}}
 > > with
 > > {{{
 > > return ('\n\n.. MATH::\n\n    ' +
 > > }}}
 > > help with the math display issue?
 >
 > It did
 Great.
 >
 > > To solve the issue with the unexpected indent, it looks like it would
 suffice to change the `visit_ul` and `visit_ol` to have
 > > {{{
 > > result = '\n' + '\n'.join(self.visit(tag) for tag in node.contents)
 > > }}}
 > > I think that changing `visit_li` will be less optimal, since there are
 already newlines between all of those things.  This is where it should be
 handled.
 >
 > You're right. Problem is: with tinyMCE I got a nested list that was
 inside an <li> tag for the parent list, but of course I want to allow also
 for the nested ul to be inside the ul directly, so: is there is any
 problem is I just add an excess of blank lines:
 >
 > {{{result = '\n\n' + '\n'.join(self.visit(tag) for tag in
 node.contents)}}}
 That should be okay, I think.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10637#comment:83>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
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