From f1090aeea1fa9c93bad6e83e5487c9c3dd239175 2015-02-26 19:10:39 From: Thomas Kluyver Date: 2015-02-26 19:10:39 Subject: [PATCH] Merge pull request #7879 from minrk/rm-old-nbformat remove old notebook format doc at the bottom of nbconvert doc --- diff --git a/docs/source/notebook/nbconvert.rst b/docs/source/notebook/nbconvert.rst index 446ae66..be40874 100644 --- a/docs/source/notebook/nbconvert.rst +++ b/docs/source/notebook/nbconvert.rst @@ -122,8 +122,6 @@ and using the command:: $ ipython nbconvert --config mycfg.py -.. _notebook_format: - LaTeX citations --------------- @@ -139,92 +137,3 @@ the nbconvert-examples_ repository. .. _nbconvert-examples: https://github.com/ipython/nbconvert-examples -Notebook JSON file format -------------------------- - -Notebook documents are JSON files with an ``.ipynb`` extension, formatted -as legibly as possible with minimal extra indentation and cell content broken -across lines to make them reasonably friendly to use in version-control -workflows. You should be very careful if you ever manually edit this JSON -data, as it is extremely easy to corrupt its internal structure and make the -file impossible to load. In general, you should consider the notebook as a -file meant only to be edited by the IPython Notebook app itself, not for -hand-editing. - -.. note:: - - Binary data such as figures are also saved directly in the JSON file. - This provides convenient single-file portability, but means that the - files can be large; a ``diff`` of binary data is also not very - meaningful. Since the binary blobs are encoded in a single line, they - affect only one line of the ``diff`` output, but they are typically very - long lines. You can use the ``Cell | All Output | Clear`` menu option to - remove all output from a notebook prior to committing it to version - control, if this is a concern. - -The notebook server can also generate a pure Python version of your notebook, -using the ``File | Download as`` menu option. The resulting ``.py`` file will -contain all the code cells from your notebook verbatim, and all Markdown cells -prepended with a comment marker. The separation between code and Markdown -cells is indicated with special comments and there is a header indicating the -format version. All output is removed when exporting to Python. - -As an example, consider a simple notebook called ``simple.ipynb`` which -contains one Markdown cell, with the content ``The simplest notebook.``, one -code input cell with the content ``print "Hello, IPython!"``, and the -corresponding output. - -The contents of the notebook document ``simple.ipynb`` is the following JSON -container:: - - { - "metadata": { - "name": "simple" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ - { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": "The simplest notebook." - }, - { - "cell_type": "code", - "collapsed": false, - "input": "print \"Hello, IPython\"", - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": "Hello, IPython\n" - } - ], - "prompt_number": 1 - } - ], - "metadata": {} - } - ] - } - - -The corresponding Python script is:: - - # -*- coding: utf-8 -*- - # 3.0 - - # - - # The simplest notebook. - - # - - print "Hello, IPython" - -Note that indeed the output of the code cell, which is present in the JSON -container, has been removed in the ``.py`` script. diff --git a/docs/source/notebook/notebook.rst b/docs/source/notebook/notebook.rst index 2eca0d1..132ee3f 100644 --- a/docs/source/notebook/notebook.rst +++ b/docs/source/notebook/notebook.rst @@ -80,7 +80,7 @@ nbviewer. .. seealso:: - :ref:`Details on the notebook JSON file format ` + :ref:`Details on the notebook JSON file format ` Starting the notebook server @@ -477,6 +477,6 @@ script back into a notebook will preserve this structure. format. .. seealso:: - :ref:`notebook_format` + :ref:`nbformat` .. include:: ../links.txt