#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 pang):
Replying to [comment:85 kcrisman]:
> > > * The way you replace a span by a `\n` means that sometimes TinyMCE
stuff left over from trying to unformat things gets in a new line.
TinyMCE is annoying that way - sometimes to unitalicize you have to do a
few things. Anyway, users will have to expect lots of newlines because of
that. In one case, I ''intentionally'' had used a lot of different ones,
and since bold isn't a span, but everything else you can do is, the doc
looked kind of weird, lots of new lines. In another case, the text was
colored on purpose.
> > > {{{
> > > Plot a green <span style="color: #008000;">$y=\sin(x)$</span>
together with...
> > > }}}
> > > and then it made a new line there. I'm wondering why you chose
to make {{{\n}}} instead of just a space - surely you encountered some
"real-life" examples where that was the better option. I'm assuming we
can't easily take the color info in, if that's the only info.
> >
> > I don't really remember why I did that, but it also screwed html
tables in some situations, so it's best, and more naturally, made into a
space.
> Is this the change in `visit_inline_no_tag`? Sorry, I just can't figure
that one out.
No, it's the
147 'p': 'inline_no_tag',
159 'p': 'p',
plus the:
331 def visit_p(self, node):
332 return ''.join(self.visit(tag) for tag in
node.contents) + '\n\n'
by the way, the following lines are garbage:
333 cs = [self.visit(tag) for tag in node.contents]
334 return ' '.join(c for c in cs if c.strip()) +
'\n\n'
Karl, should I make a single patch, and fix also this little stupid thing?
> > > * Dumb question; is there a way to have an empty cell? Currently
you remove them, but if the input ''and'' output are empty, then maybe
it's supposed to be an empty cell in the "live" documentation... that's
obviously very low priority.
> >
> > forgot that one too
> >
> I can't find where you did this.
I've done nothing, I guess I could drop the code that discards the empty
code cells, but on the other hand, I want them out of my pdf...
> Finally, I'm just wondering about a few changes - surely it's obvious
what they do, but I'm lazy.
> * The change to `ALL_ENTITIES` in `soup`.
Following the documentation of BeautifulSoup, that should convert entities
like & into & and $lt; into <, but it doesn't work, so I do it later
anyway. In a later ticket, I'll update to a newer version of
BeautifulSoup, and this will be a useful reminder.
> * The `images_dir` stuff - was that in response to anything I said?
No, that's in order to be able to use worksheet2rst as a sage-independent
script. Found it useful during testing.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10637#comment:88>
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.