#10637: Implement sage -sws2rst
------------------------------------------------------------+---------------
Reporter: nthiery | Owner:
jason, mpatel, was
Type: enhancement | Status:
needs_work
Priority: major | Milestone:
sage-5.2
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:
------------------------------------------------------------+---------------
Changes (by kcrisman):
* status: needs_review => needs_work
* reviewer: Nicolas Thiéry, Jason Grout, Karl-Dieter Crisman, Jason
Bandlow => Nicolas Thiéry, Jason Grout, Karl-
Dieter Crisman, Jason Bandlow, John Palmieri
* work_issues: => answer questions, math formatting, lists, maybe
absolute paths?
Old description:
> Implement:
>
> {{{
> sage -sws2rst bla.sws bli.sws ...
> }}}
>
> which given worksheets
>
> {{{bla.sws, bli.sws, ...}}} would create ReST files {{{bla.rst, bli.rst,
> ...}}} together with media directories:
>
> {{{
> media/bla/
> media/bla/data/
> media/bla/7/sage0.png
> ...
> media/bli/
> ...
> }}}
>
> The proposed implementation adds a script
> {{{local/bin/sage-sws2rst}}}, edits {{{local/bin/sage-sage}}} to add
> the sws2rst option, and add some libraries in
> {{{sagenb-main/sagenb/notebook/}}}. It further depends on the
> BeautifulSoup Python library (released under Python's license).
>
> The script builds the ReST file from the worksheet.html file included in
> the .sws as follow:
>
> - Preparsing to handle the input / output fields
> - Parsing of the resulting html using BeautifulSoup
> - Manipulation on the obtained tree
>
> Suggestions for better file layout or implementation welcome!
>
> == Install instructions ==
>
> * Be sure you have a recent beta, and/or that #11080 and #11459 are
> included.
> * Install the beautifulsoup spkg
> [http://sage.math.washington.edu/home/kcrisman/beautifulsoup-3.2.1.spkg
> here]
> * Apply [attachment:trac_10637-root.patch] to the root repository
> * Apply [attachment:trac_10637-scripts.patch] and [attachment:trac_10637
> -scripts-docsandmore.patch] to the scripts repository
>
> * Apply [attachment:tools_sws2rst_4.patch] and [attachment:trac_10637
> -sagenb-reviewer.patch] to sagenb, possibly followed by
> {{{
> sage -python setup.py install && sage -python setup.py develop
> }}}
New description:
Implement:
{{{
sage -sws2rst bla.sws bli.sws ...
}}}
which given worksheets
{{{bla.sws, bli.sws, ...}}} would create ReST files {{{bla.rst, bli.rst,
...}}} together with media directories:
{{{
media/bla/
media/bla/data/
media/bla/7/sage0.png
...
media/bli/
...
}}}
The proposed implementation adds a script
{{{local/bin/sage-sws2rst}}}, edits {{{spkg/bin/sage}}} to add
the sws2rst option, and add some libraries in
{{{sagenb-main/sagenb/notebook/}}}. It further depends on the
!BeautifulSoup Python library (released under Python's license).
The script builds the ReST file from the worksheet.html file included in
the .sws as follow:
- Preparsing to handle the input / output fields
- Parsing of the resulting html using !BeautifulSoup
- Manipulation on the obtained tree
Suggestions for better file layout or implementation welcome!
== Install instructions ==
* Be sure you have a recent beta, and/or that #11080 and #11459 are
included.
* Install the beautifulsoup spkg
[http://sage.math.washington.edu/home/kcrisman/beautifulsoup-3.2.1.spkg
here]
* Apply [attachment:trac_10637-root.patch] to the root repository
* Apply [attachment:trac_10637-scripts.patch] and [attachment:trac_10637
-scripts-docsandmore.patch] to the scripts repository
* Apply [attachment:tools_sws2rst_4.patch] and [attachment:trac_10637
-sagenb-reviewer.patch] to sagenb, possibly followed by
{{{
sage -python setup.py install && sage -python setup.py develop
}}}
--
Comment:
Okay, after thinking about it some more, here is what would be absolutely
required for positive review.
* All questions in comment:59 and comment:63 need to be answered. Not
solved! Just to have some answer, even if it's "I don't know". This will
help tremendously for any followup work.
* The issue with the math formatting needing the new line must be fixed.
* The variety of bullet issues should be made better.
* The unexpected indent warning
* Display math in lists
* If not already true, allow unordered lists as sublists of ordered
ones (? maybe not as important as the others)
Humbly disagreeing with jhpalmieri about the absolute paths, since I
documented it - but of course that would be great, what magic makes this
work but not the other version? If this does in fact work, then I guess
that would be good too.
The point is that we don't want to make the review process overly long
here.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10637#comment:66>
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.