|
1351 | 1351 | "source": [
|
1352 | 1352 | "..."
|
1353 | 1353 | ]
|
| 1354 | + }, |
| 1355 | + { |
| 1356 | + "cell_type": "markdown", |
| 1357 | + "metadata": {}, |
| 1358 | + "source": [ |
| 1359 | + "--- \n", |
| 1360 | + "\n", |
| 1361 | + "Readers may ignore the following cell" |
| 1362 | + ] |
| 1363 | + }, |
| 1364 | + { |
| 1365 | + "cell_type": "code", |
| 1366 | + "execution_count": 9, |
| 1367 | + "metadata": {}, |
| 1368 | + "outputs": [ |
| 1369 | + { |
| 1370 | + "name": "stdout", |
| 1371 | + "output_type": "stream", |
| 1372 | + "text": [ |
| 1373 | + "[NbConvertApp] WARNING | pattern 'input_path' matched no files\n", |
| 1374 | + "This application is used to convert notebook files (*.ipynb) to various other\n", |
| 1375 | + "formats.\n", |
| 1376 | + "\n", |
| 1377 | + "WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.\n", |
| 1378 | + "\n", |
| 1379 | + "Options\n", |
| 1380 | + "-------\n", |
| 1381 | + "\n", |
| 1382 | + "Arguments that take values are actually convenience aliases to full\n", |
| 1383 | + "Configurables, whose aliases are listed on the help line. For more information\n", |
| 1384 | + "on full configurables, see '--help-all'.\n", |
| 1385 | + "\n", |
| 1386 | + "--debug\n", |
| 1387 | + " set log level to logging.DEBUG (maximize logging output)\n", |
| 1388 | + "--generate-config\n", |
| 1389 | + " generate default config file\n", |
| 1390 | + "-y\n", |
| 1391 | + " Answer yes to any questions instead of prompting.\n", |
| 1392 | + "--execute\n", |
| 1393 | + " Execute the notebook prior to export.\n", |
| 1394 | + "--allow-errors\n", |
| 1395 | + " Continue notebook execution even if one of the cells throws an error and include the error message in the cell output (the default behaviour is to abort conversion). This flag is only relevant if '--execute' was specified, too.\n", |
| 1396 | + "--stdin\n", |
| 1397 | + " read a single notebook file from stdin. Write the resulting notebook with default basename 'notebook.*'\n", |
| 1398 | + "--stdout\n", |
| 1399 | + " Write notebook output to stdout instead of files.\n", |
| 1400 | + "--inplace\n", |
| 1401 | + " Run nbconvert in place, overwriting the existing notebook (only \n", |
| 1402 | + " relevant when converting to notebook format)\n", |
| 1403 | + "--no-prompt\n", |
| 1404 | + " Exclude input and output prompts from converted document.\n", |
| 1405 | + "--log-level=<Enum> (Application.log_level)\n", |
| 1406 | + " Default: 30\n", |
| 1407 | + " Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')\n", |
| 1408 | + " Set the log level by value or name.\n", |
| 1409 | + "--config=<Unicode> (JupyterApp.config_file)\n", |
| 1410 | + " Default: ''\n", |
| 1411 | + " Full path of a config file.\n", |
| 1412 | + "--to=<Unicode> (NbConvertApp.export_format)\n", |
| 1413 | + " Default: 'html'\n", |
| 1414 | + " The export format to be used, either one of the built-in formats, or a\n", |
| 1415 | + " dotted object name that represents the import path for an `Exporter` class\n", |
| 1416 | + "--template=<Unicode> (TemplateExporter.template_file)\n", |
| 1417 | + " Default: ''\n", |
| 1418 | + " Name of the template file to use\n", |
| 1419 | + "--writer=<DottedObjectName> (NbConvertApp.writer_class)\n", |
| 1420 | + " Default: 'FilesWriter'\n", |
| 1421 | + " Writer class used to write the results of the conversion\n", |
| 1422 | + "--post=<DottedOrNone> (NbConvertApp.postprocessor_class)\n", |
| 1423 | + " Default: ''\n", |
| 1424 | + " PostProcessor class used to write the results of the conversion\n", |
| 1425 | + "--output=<Unicode> (NbConvertApp.output_base)\n", |
| 1426 | + " Default: ''\n", |
| 1427 | + " overwrite base name use for output files. can only be used when converting\n", |
| 1428 | + " one notebook at a time.\n", |
| 1429 | + "--output-dir=<Unicode> (FilesWriter.build_directory)\n", |
| 1430 | + " Default: ''\n", |
| 1431 | + " Directory to write output(s) to. Defaults to output to the directory of each\n", |
| 1432 | + " notebook. To recover previous default behaviour (outputting to the current\n", |
| 1433 | + " working directory) use . as the flag value.\n", |
| 1434 | + "--reveal-prefix=<Unicode> (SlidesExporter.reveal_url_prefix)\n", |
| 1435 | + " Default: ''\n", |
| 1436 | + " The URL prefix for reveal.js. This can be a a relative URL for a local copy\n", |
| 1437 | + " of reveal.js, or point to a CDN.\n", |
| 1438 | + " For speaker notes to work, a local reveal.js prefix must be used.\n", |
| 1439 | + "--nbformat=<Enum> (NotebookExporter.nbformat_version)\n", |
| 1440 | + " Default: 4\n", |
| 1441 | + " Choices: [1, 2, 3, 4]\n", |
| 1442 | + " The nbformat version to write. Use this to downgrade notebooks.\n", |
| 1443 | + "\n", |
| 1444 | + "To see all available configurables, use `--help-all`\n", |
| 1445 | + "\n", |
| 1446 | + "Examples\n", |
| 1447 | + "--------\n", |
| 1448 | + "\n", |
| 1449 | + " The simplest way to use nbconvert is\n", |
| 1450 | + " \n", |
| 1451 | + " > jupyter nbconvert mynotebook.ipynb\n", |
| 1452 | + " \n", |
| 1453 | + " which will convert mynotebook.ipynb to the default format (probably HTML).\n", |
| 1454 | + " \n", |
| 1455 | + " You can specify the export format with `--to`.\n", |
| 1456 | + " Options include ['asciidoc', 'custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']\n", |
| 1457 | + " \n", |
| 1458 | + " > jupyter nbconvert --to latex mynotebook.ipynb\n", |
| 1459 | + " \n", |
| 1460 | + " Both HTML and LaTeX support multiple output templates. LaTeX includes\n", |
| 1461 | + " 'base', 'article' and 'report'. HTML includes 'basic' and 'full'. You\n", |
| 1462 | + " can specify the flavor of the format used.\n", |
| 1463 | + " \n", |
| 1464 | + " > jupyter nbconvert --to html --template basic mynotebook.ipynb\n", |
| 1465 | + " \n", |
| 1466 | + " You can also pipe the output to stdout, rather than a file\n", |
| 1467 | + " \n", |
| 1468 | + " > jupyter nbconvert mynotebook.ipynb --stdout\n", |
| 1469 | + " \n", |
| 1470 | + " PDF is generated via latex\n", |
| 1471 | + " \n", |
| 1472 | + " > jupyter nbconvert mynotebook.ipynb --to pdf\n", |
| 1473 | + " \n", |
| 1474 | + " You can get (and serve) a Reveal.js-powered slideshow\n", |
| 1475 | + " \n", |
| 1476 | + " > jupyter nbconvert myslides.ipynb --to slides --post serve\n", |
| 1477 | + " \n", |
| 1478 | + " Multiple notebooks can be given at the command line in a couple of \n", |
| 1479 | + " different ways:\n", |
| 1480 | + " \n", |
| 1481 | + " > jupyter nbconvert notebook*.ipynb\n", |
| 1482 | + " > jupyter nbconvert notebook1.ipynb notebook2.ipynb\n", |
| 1483 | + " \n", |
| 1484 | + " or you can specify the notebooks list in a config file, containing::\n", |
| 1485 | + " \n", |
| 1486 | + " c.NbConvertApp.notebooks = [\"my_notebook.ipynb\"]\n", |
| 1487 | + " \n", |
| 1488 | + " > jupyter nbconvert --config mycfg.py\n", |
| 1489 | + "\n" |
| 1490 | + ] |
| 1491 | + } |
| 1492 | + ], |
| 1493 | + "source": [ |
| 1494 | + "! python ../.convert_notebook_to_script.py --input ch02.ipynb --output ch02.py" |
| 1495 | + ] |
| 1496 | + }, |
| 1497 | + { |
| 1498 | + "cell_type": "code", |
| 1499 | + "execution_count": null, |
| 1500 | + "metadata": { |
| 1501 | + "collapsed": true |
| 1502 | + }, |
| 1503 | + "outputs": [], |
| 1504 | + "source": [] |
1354 | 1505 | }
|
1355 | 1506 | ],
|
1356 | 1507 | "metadata": {
|
|
1370 | 1521 | "name": "python",
|
1371 | 1522 | "nbconvert_exporter": "python",
|
1372 | 1523 | "pygments_lexer": "ipython3",
|
1373 |
| - "version": "3.6.2" |
| 1524 | + "version": "3.6.1" |
1374 | 1525 | }
|
1375 | 1526 | },
|
1376 | 1527 | "nbformat": 4,
|
|
0 commit comments