#10637: Implement sage -sws2rst
------------------------------------------------------------+---------------
Reporter: nthiery | Owner:
jason, mpatel, was
Type: enhancement | Status:
needs_review
Priority: major | Milestone:
sage-5.9
Component: notebook | Resolution:
Keywords: ReST, worksheet | Work issues:
Report Upstream: Workaround found; Bug reported upstream. | Reviewers:
Nicolas ThiƩry, Jason Grout, Karl-Dieter Crisman, Jason Bandlow, John Palmieri,
Simon King
Authors: Pablo Angulo, Karl-Dieter Crisman | Merged in:
Dependencies: #11080, #11459 | Stopgaps:
------------------------------------------------------------+---------------
Changes (by kcrisman):
* status: needs_work => needs_review
* work_issues: address tag, h5 and h6 tags =>
Comment:
> > > * Add levels `<h5>` and `<h6>` (see
[http://www.w3.org/TR/html401/struct/global.html#h-7.5.5 here], h6 is also
actually supported by TinyMCE in Sage)
> > See [http://sphinx-doc.org/rest.html#sections here] for some
conventions, but anyway it should be easy to add something for these, just
two places to do it.
> This will be easy, I believe.
Yes. The reason it didn't work for Simon is that Pablo added it to the
list of headers, but not the list of tags! I'll be updating the pull
shortly and posting a patch here for reference.
> > > * Decide what to do with address tag (possibly turn it into pre
tag? just an idea) and do that
Also done. It turned out that making it into em is the best way to
emulate what is there.
I ''did'' discover a different issue - it turns out that we probably
aren't dealing with line breaks correctly inside of things like strong and
em. In HTML you can have multiple lines inside of such a tag, but just
adding a newline doesn't work for this, as ReST treats
{{{
*Your name
Your email*
}}}
as one line of text, which is the usual behavior, but
{{{
*Your name
Your email*
}}}
is no longer emphasized. I don't think there is a super-easy way to fix
this, and as pointed out above one will always have to do some tweaking of
the output. Making it em for now seems like a good option, and I've fixed
the `br` tag to have two newlines. I didn't fix it in the pre and math
cases because those are working ok as they have a different role with the
indentation and all.
> > > * Still to check that regex, though apparently it's working fine
Okay, I did my best to mess with it, but I think that the only things it
won't do correctly wouldn't look very good in a Sage worksheet anyway, so
they would be user errors (like {{{\$$x$$}}} and the like).
> > > * Make an updated pull request for sagenb (luckily not a problem
with respect to rebasing, since we only add new files)
> Shouldn't be a problem, probably one of the sagenb folks can help with
this as well.
I just updated my pull request with Pablo's second patch as well as my own
extra patch, so we are there!
----
I think that the '''only''' thing that has to be done is, at most, for
Pablo to confirm that my change to the br tag is okay. It's too late for
me to check this with actual worksheets today.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10637#comment:129>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.