Opened 3 years ago

Last modified 3 years ago

#23401 new defect

rst2ipynb ignores raw, table, csv-table and list-table directives

Reported by: slabbe Owned by:
Priority: major Milestone: sage-8.0
Component: packages: optional Keywords:
Cc: nthiery, tmonteil, vdelecroix Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by slabbe)

Consider the file a.rst containing:

=====================================================================
Some specific reStructuredText Directives not recognized by rst2ipynb
=====================================================================

See http://docutils.sourceforge.net/docs/ref/rst/directives.html

Some raw code:

.. raw::

    def f(a,b):
        return a + b

Some Python code:

.. code:: python

    def my_function():
        "just a test"
        print 8/2

A simple table:

=====  =====
  A    not A
=====  =====
False  True
True   False
=====  =====

A table:

.. table:: Truth table for "not"
   :widths: auto

   =====  =====
     A    not A
   =====  =====
   False  True
   True   False
   =====  =====

A csv-table:

.. csv-table:: Frozen Delights!
   :header: "Treat", "Quantity", "Description"
   :widths: 15, 10, 30

   "Albatross", 2.99, "On a stick!"
   "Crunchy Frog", 1.49, "If we took the bones out, it wouldn't be
   crunchy, now would it?"
   "Gannet Ripple", 1.99, "On a stick!"

A list-table:
    
.. list-table:: Frozen Delights!
   :widths: 15 10 30
   :header-rows: 1

   * - Treat
     - Quantity
     - Description
   * - Albatross
     - 2.99
     - On a stick!
   * - Crunchy Frog
     - 1.49
     - If we took the bones out, it wouldn't be
       crunchy, now would it?
   * - Gannet Ripple
     - 1.99
     - On a stick!

This is a Warning:

.. WARNING::

	This is indeed a warning.

This is a note:

.. NOTE::

	This is indeed a note.

Then sage -rst2ipynb a.rst a.ipynb gives:

Attachments (1)

rawcode_tables.png (53.1 KB) - added by slabbe 3 years ago.

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by slabbe

comment:1 Changed 3 years ago by slabbe

  • Description modified (diff)

comment:2 Changed 3 years ago by slabbe

  • Cc nthiery tmonteil vdelecroix added
Note: See TracTickets for help on using tickets.