A reST to Jupyter notebook converter
Project description
This project provides a way to convert standalone reStructuredText files to Jupyter notebook files.
This is currently achieved by converting to markdown using pandoc and then to a Jupyter notebook using notedown, plus some configuration and tweaks.
Requirements
Python 3 (for proper UTF-8 support in notedown), pandoc, notedown
Installation
Install pandoc and then this module as usual:
git clone https://github.com/nthiery/rst-to-ipynb.git cd rst-to-ipynb pip3 install .
pip3 will install the other dependencies as needed.
Caveat: the notedown package on pipy (1.5.0, 2015-10-07) is somewhat outdated; for better conversion, it is recommended to install the latest version from the github repo.
Usage
To convert a reST file xxx.rst to a Jupyter notebook xxx.ipynb, run:
rst2ipynb xxx.rst -o xxx.ipynb
Example
TODO
[X] Handle Sage’s doctests
- [X] Fenced code blocks: fix incompatibility between pandoc output and notedown input.
Fixed in notedown; see: https://github.com/aaren/notedown/issues/29.
- [ ] Configurability of the default ReST role, in particular to handle maths in Sage’s ReST dialect.
Current status: hardcoded for Sage.
[ ] Configurability of custom ReST roles, in particular to handle Sage’s custom roles
- [ ] Proper argument parsing; escape characters, spaces, … are not
yet supported
- [ ] Handle input/output blocks within itemize and other indented constructions
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rst2ipynb-0.2.3.tar.gz
.
File metadata
- Download URL: rst2ipynb-0.2.3.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30d70b0e96f1c37baad9c8dbe904fc2567354eec02c52b94e7c7287b6268eaa3 |
|
MD5 | eedfb3d5b8634e36b680ad86771cec38 |
|
BLAKE2b-256 | 5773279784ff0ff3d6fc087bd28d9eb4740d4a8afc95760b72e35fd2edf8eddc |
File details
Details for the file rst2ipynb-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: rst2ipynb-0.2.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 444f431a33076cfa8f88975c11f34b5b70329856b09811ae5361372ce210b432 |
|
MD5 | 3574911240fad2f9b02aa162c672c9c6 |
|
BLAKE2b-256 | ac458b2e692eda075aeb116e440afd4f0d5b3d0ea90d295cc27bb96cba9901b2 |