Show More
@@ -78,18 +78,44 b' The currently supported export formats are:' | |||||
78 | Basic reStructuredText output. Useful as a starting point for embedding notebooks |
|
78 | Basic reStructuredText output. Useful as a starting point for embedding notebooks | |
79 | in Sphinx docs. |
|
79 | in Sphinx docs. | |
80 |
|
80 | |||
81 |
* ``--to p |
|
81 | * ``--to script`` | |
82 |
|
82 | |||
83 |
Convert a notebook to an executable |
|
83 | Convert a notebook to an executable script. | |
84 | This is the simplest way to get a Python script out of a notebook. |
|
84 | This is the simplest way to get a Python (or other language, depending on the kernel) script out of a notebook. | |
85 |
If there were any magics in |
|
85 | If there were any magics in an IPython notebook, this may only be executable from | |
86 | an IPython session. |
|
86 | an IPython session. | |
|
87 | ||||
|
88 | * ``--to notebook`` | |||
|
89 | ||||
|
90 | .. versionadded:: 3.0 | |||
|
91 | ||||
|
92 | This doesn't convert a notebook to a different format *per se*, | |||
|
93 | instead it allows the running of nbconvert preprocessors on a notebook, | |||
|
94 | and/or conversion to other notebook formats. For example:: | |||
|
95 | ||||
|
96 | ipython nbconvert --to notebook --execute mynotebook.ipynb | |||
|
97 | ||||
|
98 | will open the notebook, execute it, capture new output, and save the result in | |||
|
99 | :file:`mynotebook.nbconvert.ipynb`. | |||
|
100 | ||||
|
101 | :: | |||
|
102 | ||||
|
103 | ipython nbconvert --to notebook --nbformat 3 mynotebook | |||
|
104 | ||||
|
105 | will create a copy of :file:`mynotebook.ipynb` in :file:`mynotebook.v3.ipynb` | |||
|
106 | in version 3 of the :ref:`notebook format <nbformat>`. | |||
|
107 | ||||
|
108 | If you want to convert a notebook in-place, | |||
|
109 | you can specify the ouptut file to be the same as the input file:: | |||
|
110 | ||||
|
111 | ipython nbconvert --to notebook mynb --output mynb | |||
|
112 | ||||
|
113 | Be careful with that, since it will replace the input file. | |||
87 |
|
|
114 | ||
88 | .. note:: |
|
115 | .. note:: | |
89 |
|
116 | |||
90 | nbconvert uses pandoc_ to convert between various markup languages, |
|
117 | nbconvert uses pandoc_ to convert between various markup languages, | |
91 |
so pandoc is a dependency |
|
118 | so pandoc is a dependency when converting to latex or reStructuredText. | |
92 | excluding Markdown and Python. |
|
|||
93 |
|
119 | |||
94 | .. _pandoc: http://johnmacfarlane.net/pandoc/ |
|
120 | .. _pandoc: http://johnmacfarlane.net/pandoc/ | |
95 |
|
121 |
@@ -217,6 +217,12 b' Backwards incompatible changes' | |||||
217 | to read and write notebook files |
|
217 | to read and write notebook files | |
218 | instead of the deprecated :mod:`IPython.nbformat.current` APIs. |
|
218 | instead of the deprecated :mod:`IPython.nbformat.current` APIs. | |
219 |
|
219 | |||
|
220 | You can downgrade a notebook to v3 via ``nbconvert``:: | |||
|
221 | ||||
|
222 | ipython nbconvert --to notebook --nbformat 3 <notebook> | |||
|
223 | ||||
|
224 | which will create :file:`notebook.v3.ipynb`, a copy of the notebook in v3 format. | |||
|
225 | ||||
220 | * :func:`IPython.core.oinspect.getsource` call specification has changed: |
|
226 | * :func:`IPython.core.oinspect.getsource` call specification has changed: | |
221 |
|
227 | |||
222 | * `oname` keyword argument has been added for property source formatting |
|
228 | * `oname` keyword argument has been added for property source formatting |
General Comments 0
You need to be logged in to leave comments.
Login now