Show More
@@ -78,18 +78,44 b' The currently supported export formats are:' | |||
|
78 | 78 | Basic reStructuredText output. Useful as a starting point for embedding notebooks |
|
79 | 79 | in Sphinx docs. |
|
80 | 80 | |
|
81 |
* ``--to p |
|
|
81 | * ``--to script`` | |
|
82 | 82 | |
|
83 |
Convert a notebook to an executable |
|
|
84 | This is the simplest way to get a Python script out of a notebook. | |
|
85 |
If there were any magics in |
|
|
83 | Convert a notebook to an executable script. | |
|
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 an IPython notebook, this may only be executable from | |
|
86 | 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 | 115 | .. note:: |
|
89 | 116 | |
|
90 | 117 | nbconvert uses pandoc_ to convert between various markup languages, |
|
91 |
so pandoc is a dependency |
|
|
92 | excluding Markdown and Python. | |
|
118 | so pandoc is a dependency when converting to latex or reStructuredText. | |
|
93 | 119 | |
|
94 | 120 | .. _pandoc: http://johnmacfarlane.net/pandoc/ |
|
95 | 121 |
@@ -219,7 +219,7 b' Backwards incompatible changes' | |||
|
219 | 219 | |
|
220 | 220 | You can downgrade a notebook to v3 via ``nbconvert``:: |
|
221 | 221 | |
|
222 |
ipython nbconvert --to notebook --nbformat 3 |
|
|
222 | ipython nbconvert --to notebook --nbformat 3 <notebook> | |
|
223 | 223 | |
|
224 | 224 | which will create :file:`notebook.v3.ipynb`, a copy of the notebook in v3 format. |
|
225 | 225 |
General Comments 0
You need to be logged in to leave comments.
Login now