Show More
@@ -288,31 +288,70 b' which captures the output inline within the notebook format. This has the benefi' | |||||
288 |
|
288 | |||
289 | Converting notebooks to other formats |
|
289 | Converting notebooks to other formats | |
290 | ------------------------------------- |
|
290 | ------------------------------------- | |
291 | Newly added in the 1.0 release of IPython is the ``nbconvert`` tool to convert a notebook document into another static format. This is a command line tool; at present, this functionality is not available to export directly from within the Notebook app. The syntax is:: |
|
291 | Newly added in the 1.0 release of IPython is the ``nbconvert`` tool, which allows you to convert an ``.ipynb`` notebook document file into another static format. | |
292 |
|
292 | |||
|
293 | Currently, only a command line tool is provided; at present, this functionality is not available for direct exports from within the Notebook app. The syntax is:: | |||
|
294 | ||||
|
295 | $ ipython nbconvert --format=FORMAT notebook.ipynb | |||
|
296 | ||||
|
297 | which will convert the IPython document file `notebook.ipynb` into the output format specified by the `FORMAT` string. | |||
|
298 | ||||
|
299 | The default output format is HTML, for which the `--format`` modifier is not required:: | |||
|
300 | ||||
293 | $ ipython nbconvert notebook.ipynb |
|
301 | $ ipython nbconvert notebook.ipynb | |
294 |
|
302 | |||
295 | for standard HTML output, or:: |
|
303 | Otherwise, the following `FORMAT` | |
296 |
|
304 | |||
297 | $ ipython nbconvert --format=FORMAT notebook.ipynb |
|
305 | where ``FORMAT`` is the desired export format. The currently export format options available are the following. | |
298 |
|
306 | |||
299 | where ``FORMAT`` is the desired export format. Options for this format include: |
|
307 | * HTML output formats: | |
300 |
|
308 | |||
301 |
|
|
309 | - ``full_html``: | |
302 | Standard HTML |
|
310 | Standard HTML | |
|
311 | ||||
|
312 | - ``simple_html``: | |||
|
313 | Simplified HTML | |||
|
314 | ||||
|
315 | - ``reveal``: | |||
|
316 | HTML slideshow presentation for use with the ``reveal.js`` package | |||
303 |
|
317 | |||
304 | * ``simple_html``: |
|
|||
305 | A simplified version of HTML |
|
|||
306 |
|
|
318 | ||
307 | * ``reveal``: |
|
|||
308 | A format to be used with the ``reveal.js`` package for slideshow presentations. |
|
|||
309 |
|
|
319 | ||
310 | * ``sphinx_howto``: |
|
320 | * ``sphinx_howto``: | |
311 | A standard documentation format. |
|
321 | The format for Sphinx HOWTOs; similar to an `article` in LaTeX | |
|
322 | ||||
|
323 | * ``sphinxP | |||
312 |
|
324 | |||
313 | * ``latex``: |
|
325 | * ``latex``: | |
314 | Produces LaTeX output which may be compiled with ``pdflatex`` to PDF. |
|
326 | Produces LaTeX output which may be compiled with ``pdflatex`` to PDF. | |
315 |
|
327 | |||
|
328 | The simplest way to use nbconvert is | |||
|
329 | ||||
|
330 | > ipython nbconvert mynotebook.ipynb | |||
|
331 | ||||
|
332 | which will convert mynotebook.ipynb to the default format (probably HTML). | |||
|
333 | ||||
|
334 | You can specify the export format with `--format`. | |||
|
335 | Options include ['basic_html', 'full_html', 'latex', 'markdown', 'python', 'reveal', 'rst', 'sphinx_howto', 'sphinx_manual'] | |||
|
336 | ||||
|
337 | > ipython nbconvert --format latex mynotebook.ipnynb | |||
|
338 | ||||
|
339 | You can also pipe the output to stdout, rather than a file | |||
|
340 | ||||
|
341 | > ipython nbconvert mynotebook.ipynb --stdout | |||
|
342 | ||||
|
343 | Multiple notebooks can be given at the command line in a couple of | |||
|
344 | different ways: | |||
|
345 | ||||
|
346 | > ipython nbconvert notebook*.ipynb | |||
|
347 | > ipython nbconvert notebook1.ipynb notebook2.ipynb | |||
|
348 | ||||
|
349 | or you can specify the notebooks list in a config file, containing:: | |||
|
350 | ||||
|
351 | c.NbConvertApp.notebooks = ["my_notebook.ipynb"] | |||
|
352 | ||||
|
353 | > ipython nbconvert --config mycfg.py | |||
|
354 | ||||
316 |
|
|
355 | ||
317 | Configuration |
|
356 | Configuration | |
318 | ------------- |
|
357 | ------------- |
General Comments 0
You need to be logged in to leave comments.
Login now