rst2ipynb.py
21 lines
| 757 B
| text/x-python
|
PythonLexer
/ nbconvert1 / rst2ipynb.py
Paul Ivanov
|
r6284 | #!/usr/bin/env python | ||
slojo404
|
r6232 | """ | ||
A minimal front end to the Docutils Publisher, producing an ipython notebook. | ||||
""" | ||||
import docutils.readers.standalone | ||||
import docutils.parsers.rst | ||||
import docutils.core | ||||
slojo404
|
r6277 | import rst2ipynblib | ||
slojo404
|
r6232 | from docutils.core import publish_cmdline | ||
Paul Ivanov
|
r6285 | description = ('Generates an ipython notebook from standalone ' | ||
'reStructuredText source. ' + | ||||
slojo404
|
r6277 | docutils.core.default_description) | ||
slojo404
|
r6232 | |||
publish_cmdline(reader=docutils.readers.standalone.Reader(), | ||||
parser=docutils.parsers.rst.Parser(), | ||||
writer=rst2ipynblib.Writer(), | ||||
enable_exit_status=1, | ||||
usage=docutils.core.default_usage, | ||||
description=description) | ||||