|
78 | 78 | "Subsequent builds will be faster, because only those source files which have changed will be re-built.\n",
|
79 | 79 | "To force re-building all source files, use the `-E` option.\n",
|
80 | 80 | "\n",
|
| 81 | + "<div class=\"alert alert-info\">\n", |
| 82 | + "\n", |
| 83 | + "**Note:**\n", |
| 84 | + "\n", |
| 85 | + "By default, notebooks will be executed during the Sphinx build process only if they do not have any output cells stored.\n", |
| 86 | + "See [Controlling Notebook Execution](executing-notebooks.ipynb).\n", |
| 87 | + "\n", |
| 88 | + "</div>\n", |
| 89 | + "\n", |
81 | 90 | "To create LaTeX output, use:\n",
|
82 | 91 | "\n",
|
83 | 92 | " python3 -m sphinx <source-dir> <build-dir> -b latex\n",
|
|
318 | 327 | "\n",
|
319 | 328 | "If you know of another Sphinx theme that should be included here, please open an [issue on Github](https://github.com/spatialaudio/nbsphinx/issues)."
|
320 | 329 | ]
|
| 330 | + }, |
| 331 | + { |
| 332 | + "cell_type": "markdown", |
| 333 | + "metadata": {}, |
| 334 | + "source": [ |
| 335 | + "## Using Notebooks with Git\n", |
| 336 | + "\n", |
| 337 | + "[Git](https://git-scm.com/) is extremely useful for managing source code and it can and should also be used for managing Jupyter notebooks.\n", |
| 338 | + "There is one caveat, however:\n", |
| 339 | + "Notebooks can contain output cells with rich media like images, plots, sounds, HTML, JavaScript and many other types of bulky machine-created content.\n", |
| 340 | + "This can make it hard to work with Git efficiently, because changes in those bulky contents can completely obscure the more interesting changes in text and source code.\n", |
| 341 | + "Working with multiple collaborators on a notebook can become very tedious because of this.\n", |
| 342 | + "\n", |
| 343 | + "It is therefore highly recommended that you remove all outputs from your notebooks before committing changes to a Git repository (except for the reasons mentioned in [Pre-Executing Notebooks](pre-executed.ipynb)).\n", |
| 344 | + "\n", |
| 345 | + "If there are no output cells in a notebook, `nbsphinx` will by default execute the notebook and the pages generated by Sphinx will therefore contain all the output cells.\n", |
| 346 | + "See [Controlling Notebook Execution](executing-notebooks.ipynb) for how this behavior can be customized.\n", |
| 347 | + "\n", |
| 348 | + "In the Jupyter Notebook application, you can manually clear all outputs by selecting\n", |
| 349 | + "\"Cell\" $\\to$ \"All Output\" $\\to$ \"Clear\" from the menu.\n", |
| 350 | + "\n", |
| 351 | + "There are several tools available to remove outputs from multiple files at once without having to open them separately.\n", |
| 352 | + "You can even include such a tool as \"clean/smudge filters\" into your Git workflow, which will strip the output cells automatically whenever a Git command is executed.\n", |
| 353 | + "For details, have a look at those links:\n", |
| 354 | + "\n", |
| 355 | + "* https://github.com/kynan/nbstripout\n", |
| 356 | + "* https://github.com/toobaz/ipynb_output_filter\n", |
| 357 | + "* http://tillahoffmann.github.io/2017/04/17/versioning-jupyter-notebooks-with-git.html\n", |
| 358 | + "* http://timstaley.co.uk/posts/making-git-and-jupyter-notebooks-play-nice/\n", |
| 359 | + "* http://pascalbugnion.net/blog/ipython-notebooks-and-git.html\n", |
| 360 | + "\n" |
| 361 | + ] |
321 | 362 | }
|
322 | 363 | ],
|
323 | 364 | "metadata": {
|
|
0 commit comments