#11459: Implement sage -rst2txt and sage -rst2sws
--------------------------------------+-------------------------------------
       Reporter:  slabbe              |         Owner:  slabbe         
           Type:  enhancement         |        Status:  positive_review
       Priority:  major               |     Milestone:  sage-5.1       
      Component:  notebook            |    Resolution:                 
       Keywords:  sd31 days31 sd40.5  |   Work issues:                 
Report Upstream:  N/A                 |     Reviewers:  Keshav Kini    
        Authors:  Sébastien Labbé     |     Merged in:                 
   Dependencies:  #11080              |      Stopgaps:                 
--------------------------------------+-------------------------------------

Old description:

> This ticket concerns the following :
>
>  * Convert a ReST file into a worksheet file from the command line :
> `sage -rst2txt`.
>  * Convert a ReST file into a Sage worksheet from the command line :
> `sage -rst2sws`.
>  * Upload a ReST (.rst) file from the Notebook.
>  * Upload a .html file output from docutils rst2html on a ReST.
>  * Upload a `worksheet.html` file as those stored in the repository
> `~/.sage/sage_notebook.sagenb/home/admin` without having to change the
> extension to `.txt`.
>  * Add the class `docutilsHTMLProcessor` to the file
> `sagenb/notebook/docHTMLProcessor.py` which translates HTML file
> generated by docutils ``rst2html`` command into a worksheet text file.
> This class was inspired from the class `SphinxHTMLProcessor` already in
> the same Python file.
>  * Add the class `genericHTMLProcessor` to the same file which gathers
> all the common methods of the other two classes.
>  * Improve a lot the documentation of the file
> `sagenb/notebook/docHTMLProcessor.py` : it is now 100% doctest coveraged.
>
> My motivation is that in general I wrote my own code using the Sage Code
> Convention where examples are formatted in ReST. The possibility of
> converting rst syntax to a worksheet would be nice. Also, ReST file is
> more fun to edit than the html/cells worksheet text file. It is also more
> versatile as it can be used to generate a web page or S5 presentation,
> etc. using docutils.
>
> On my web page, I created a page
> [http://www.thales.math.uqam.ca/~labbes/Sage/rst2sws/ rst2sws] where I
> put an example of ReST file. Note that I managed to use !MathJax to
> render the HTML output of docutils `rst2html` command.
>
> Here is [http://code.google.com/r/slabqc-flask/ my clone of the sage-
> flask-notebook] where I my patch on the sage notebook will be available.
>
> I am planning to make this script more clean during
> [http://wiki.sagemath.org/days31 Sage Days 31]. I will upload patches as
> it gets better.
>
> Related to : #10637 (Implement sage -sws2rst) and #10652.
>
> I mentionned the idea on sage-devel in December 2010
> [http://groups.google.com/group/sage-
> devel/browse_thread/thread/5d86874cd359e1a5/eda52be07a9fb994 here].
>
> This is based on a script called `rst2notebook` I wrote in January 2011
> available
> [http://combinat.sagemath.org/hgwebdir.cgi/misc/file/ef17ccb37589/notebook2rst/
> on the Sage Combinat server].

New description:

 This ticket concerns the following :

  * Convert a ReST file into a worksheet file from the command line : `sage
 -rst2txt`.
  * Convert a ReST file into a Sage worksheet from the command line : `sage
 -rst2sws`.
  * Upload a ReST (.rst) file from the Notebook.
  * Upload a .html file output from docutils rst2html on a ReST.
  * Upload a `worksheet.html` file as those stored in the repository
 `~/.sage/sage_notebook.sagenb/home/admin` without having to change the
 extension to `.txt`.
  * Add the class `docutilsHTMLProcessor` to the file
 `sagenb/notebook/docHTMLProcessor.py` which translates HTML file generated
 by docutils ``rst2html`` command into a worksheet text file. This class
 was inspired from the class `SphinxHTMLProcessor` already in the same
 Python file.
  * Add the class `genericHTMLProcessor` to the same file which gathers all
 the common methods of the other two classes.
  * Improve a lot the documentation of the file
 `sagenb/notebook/docHTMLProcessor.py` : it is now 100% doctest coveraged.

 My motivation is that in general I wrote my own code using the Sage Code
 Convention where examples are formatted in ReST. The possibility of
 converting rst syntax to a worksheet would be nice. Also, ReST file is
 more fun to edit than the html/cells worksheet text file. It is also more
 versatile as it can be used to generate a web page or S5 presentation,
 etc. using docutils.

 On my web page, I created a page
 [http://www.thales.math.uqam.ca/~labbes/Sage/rst2sws/ rst2sws] where I put
 an example of ReST file. Note that I managed to use !MathJax to render the
 HTML output of docutils `rst2html` command.

 Here is [http://code.google.com/r/slabqc-flask/ my clone of the sage-
 flask-notebook] where I my patch on the sage notebook will be available.

 I am planning to make this script more clean during
 [http://wiki.sagemath.org/days31 Sage Days 31]. I will upload patches as
 it gets better.

 Related to : #10637 (Implement sage -sws2rst) and #10652.

 I mentionned the idea on sage-devel in December 2010
 [http://groups.google.com/group/sage-
 devel/browse_thread/thread/5d86874cd359e1a5/eda52be07a9fb994 here].

 This is based on a script called `rst2notebook` I wrote in January 2011
 available
 [http://combinat.sagemath.org/hgwebdir.cgi/misc/file/ef17ccb37589/notebook2rst/
 on the Sage Combinat server].

 ---

 Apply: [attachment:trac_11459-root.patch],
 [attachment:trac_11459-root.reviewer.patch] to `$SAGE_ROOT`

 Apply: [attachment:trac_11459-scripts.patch],
 [attachment:trac_11459-scripts.reviewer.patch] to `$SAGE_LOCAL/bin`

--

Comment (by kini):

 Whoops, forgot the other reviewer patch...

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