#10637: Implement sage -sws2rst
------------------------------------------------------------+---------------
       Reporter:  nthiery                                   |         Owner:  
jason, mpatel, was                                                            
           Type:  enhancement                               |        Status:  
needs_work                                                                    
       Priority:  major                                     |     Milestone:  
sage-5.3                                                                      
      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 pang):

 Replying to [comment:67 kcrisman]:
 > Some suggestions for code.  Ignore if stupid.
 >
 > ----
 >
 > >  * This is just amusing.
 > > {{{
 > > arrow $\mapsto$ as "|-->").
 > > }}}
 > >    becomes the same thing, so it doesn't turn back into {{{|-->}}},
 the arrow!  Not sure what to do about that; why didn't the greater than
 sign just become a greater than sign when translated from html back?
 Also, I thought that {{{|}}} was one of the characters you escaped, but
 maybe this one escaped being escaped?
 >
 > 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.


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


 > 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. Your proposal would not
 cover all situations, like more than two nesting levels.

 > 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


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

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10637#comment:73>
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