#10637: Implement sage -sws2rst
-----------------------------------+----------------------------------------
   Reporter:  nthiery              |       Owner:  pang           
       Type:  enhancement          |      Status:  needs_review   
   Priority:  major                |   Milestone:  sage-4.7       
  Component:  notebook             |    Keywords:  ReST, worksheet
     Author:  Pablo Angulo         |    Upstream:  N/A            
   Reviewer:  Nicolas ThiƩry, ...  |      Merged:                 
Work_issues:                       |  
-----------------------------------+----------------------------------------
Changes (by pang):

  * owner:  jason, mpatel, was => pang


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!

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

 Edit:
 == Install instructions ==

  * Install the beautifulsoup spkg

  * A first patch (add_sws2rst_3.patch) adds the sage-sws2rst script, and
 it must be imported on the local/bin dir

  * A second patch (tools_sws2rst_3.patch) sends three files to sagenb/misc
 and it must be imported on the devel/sagenb dir, and followed by a

 {{{
     sage -python setup.py install && sage -python setup.py develop
 }}}

--

Comment:

 Done. I also added some tests:

  * I replaced ''' by """, otherwise tests are ignored!!!
  * I don't use the tests which include the word sage:, because they fail
 in weird ways. This is a consequence of the testing framework.

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