Show More
@@ -1,320 +1,322 b'' | |||||
1 | ============ |
|
1 | ============ | |
2 | 3.x Series |
|
2 | 3.x Series | |
3 | ============ |
|
3 | ============ | |
4 |
|
4 | |||
5 |
|
5 | |||
6 | Release 3.0 |
|
6 | Release 3.0 | |
7 | =========== |
|
7 | =========== | |
8 |
|
8 | |||
9 |
|
|
9 | Released February 27, 2015 | |
10 |
|
10 | |||
11 | This is a really big release. Over 150 contributors, and almost 6000 commits in a bit under a year. |
|
11 | This is a really big release. Over 150 contributors, and almost 6000 commits in a bit under a year. | |
12 | Support for languages other than Python is greatly improved, |
|
12 | Support for languages other than Python is greatly improved, | |
13 | notebook UI has been significantly redesigned, |
|
13 | notebook UI has been significantly redesigned, | |
14 | and a lot of improvement has happened in the experimental interactive widgets. |
|
14 | and a lot of improvement has happened in the experimental interactive widgets. | |
15 | The message protocol and document format have both been updated, |
|
15 | The message protocol and document format have both been updated, | |
16 | while maintaining better compatibility with previous versions than prior updates. |
|
16 | while maintaining better compatibility with previous versions than prior updates. | |
17 | The notebook webapp now enables editing of any text file, and even |
|
17 | The notebook webapp now enables editing of any text file, and even | |
18 | a web-based terminal (on Unix platforms). |
|
18 | a web-based terminal (on Unix platforms). | |
19 |
|
19 | |||
20 | 3.x will be the last monolithic release of IPython, |
|
20 | 3.x will be the last monolithic release of IPython, | |
21 | as the next release cycle will see the growing project split into its Python-specific and language-agnostic components. |
|
21 | as the next release cycle will see the growing project split into its Python-specific and language-agnostic components. | |
22 | Language-agnostic projects (notebook, qtconsole, etc.) will move under the umbrella of the new Project Jupyter name, |
|
22 | Language-agnostic projects (notebook, qtconsole, etc.) will move under the umbrella of the new Project Jupyter name, | |
23 | while Python-specific projects (interactive Python shell, Python kernel, IPython.parallel) |
|
23 | while Python-specific projects (interactive Python shell, Python kernel, IPython.parallel) | |
24 | will remain under IPython, and be split into a few smaller packages. |
|
24 | will remain under IPython, and be split into a few smaller packages. | |
25 | To reflect this, IPython is in a bit of a transition state. |
|
25 | To reflect this, IPython is in a bit of a transition state. | |
26 | The logo on the notebook is now the Jupyter logo. |
|
26 | The logo on the notebook is now the Jupyter logo. | |
27 | When installing kernels system-wide, they go in a `jupyter` directory. |
|
27 | When installing kernels system-wide, they go in a `jupyter` directory. | |
28 | We are going to do our best to ease this transition for users and developers. |
|
28 | We are going to do our best to ease this transition for users and developers. | |
29 |
|
29 | |||
30 | Big changes are ahead. |
|
30 | Big changes are ahead. | |
31 |
|
31 | |||
32 |
|
32 | |||
33 | Using different kernels |
|
33 | Using different kernels | |
34 | ----------------------- |
|
34 | ----------------------- | |
35 |
|
35 | |||
36 | .. image:: ../_images/kernel_selector_screenshot.png |
|
36 | .. image:: ../_images/kernel_selector_screenshot.png | |
37 | :alt: Screenshot of 'new' dropdown showing different kernels |
|
37 | :alt: Screenshot of 'new' dropdown showing different kernels | |
38 | :align: center |
|
38 | :align: center | |
39 |
|
39 | |||
40 | You can now choose a kernel for a notebook within the user interface, rather |
|
40 | You can now choose a kernel for a notebook within the user interface, rather | |
41 | than starting up a separate notebook server for each kernel you want to use. The |
|
41 | than starting up a separate notebook server for each kernel you want to use. The | |
42 | syntax highlighting adapts to match the language you're working in. |
|
42 | syntax highlighting adapts to match the language you're working in. | |
43 |
|
43 | |||
44 | Information about the kernel is stored in the notebook file, so when you open a |
|
44 | Information about the kernel is stored in the notebook file, so when you open a | |
45 | notebook, it will automatically start the correct kernel. |
|
45 | notebook, it will automatically start the correct kernel. | |
46 |
|
46 | |||
47 | It is also easier to use the Qt console and the terminal console with other |
|
47 | It is also easier to use the Qt console and the terminal console with other | |
48 | kernels, using the --kernel flag:: |
|
48 | kernels, using the --kernel flag:: | |
49 |
|
49 | |||
50 | ipython qtconsole --kernel bash |
|
50 | ipython qtconsole --kernel bash | |
51 | ipython console --kernel bash |
|
51 | ipython console --kernel bash | |
52 |
|
52 | |||
53 | # To list available kernels |
|
53 | # To list available kernels | |
54 | ipython kernelspec list |
|
54 | ipython kernelspec list | |
55 |
|
55 | |||
56 | Kernel authors should see :ref:`kernelspecs` for how to register their kernels |
|
56 | Kernel authors should see :ref:`kernelspecs` for how to register their kernels | |
57 | with IPython so that these mechanisms work. |
|
57 | with IPython so that these mechanisms work. | |
58 |
|
58 | |||
59 | Typing unicode identifiers |
|
59 | Typing unicode identifiers | |
60 | -------------------------- |
|
60 | -------------------------- | |
61 |
|
61 | |||
62 | .. image:: /_images/unicode_completion.png |
|
62 | .. image:: /_images/unicode_completion.png | |
63 |
|
63 | |||
64 | Complex expressions can be much cleaner when written with a wider choice of |
|
64 | Complex expressions can be much cleaner when written with a wider choice of | |
65 | characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier |
|
65 | characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier | |
66 | to type those, using a feature from Julia. Type a backslash followed by a LaTeX |
|
66 | to type those, using a feature from Julia. Type a backslash followed by a LaTeX | |
67 | style short name, such as ``\alpha``. Press tab, and it will turn into Ξ±. |
|
67 | style short name, such as ``\alpha``. Press tab, and it will turn into Ξ±. | |
68 |
|
68 | |||
69 | Widget migration guide |
|
69 | Widget migration guide | |
70 | ---------------------- |
|
70 | ---------------------- | |
71 | The widget framework has a lot of backwards incompatible changes. For information about migrating widget notebooks and custom widgets to 3.0 refer to the :doc:`widget migration guide<version3_widget_migration>`. |
|
71 | The widget framework has a lot of backwards incompatible changes. | |
|
72 | For information about migrating widget notebooks and custom widgets to 3.0 refer | |||
|
73 | to the :doc:`widget migration guide<version3_widget_migration>`. | |||
72 |
|
74 | |||
73 | Other new features |
|
75 | Other new features | |
74 | ------------------ |
|
76 | ------------------ | |
75 |
|
77 | |||
76 | * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a |
|
78 | * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a | |
77 | ``placeholder`` attribute, for displaying placeholder text before the |
|
79 | ``placeholder`` attribute, for displaying placeholder text before the | |
78 | user has typed anything. |
|
80 | user has typed anything. | |
79 |
|
81 | |||
80 | * The :magic:`load` magic can now find the source for objects in the user namespace. |
|
82 | * The :magic:`load` magic can now find the source for objects in the user namespace. | |
81 | To enable searching the namespace, use the ``-n`` option. |
|
83 | To enable searching the namespace, use the ``-n`` option. | |
82 |
|
84 | |||
83 | .. sourcecode:: ipython |
|
85 | .. sourcecode:: ipython | |
84 |
|
86 | |||
85 | In [1]: %load -n my_module.some_function |
|
87 | In [1]: %load -n my_module.some_function | |
86 |
|
88 | |||
87 | * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle` |
|
89 | * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle` | |
88 | method, which works like ``view.use_dill()``, but causes the ``cloudpickle`` |
|
90 | method, which works like ``view.use_dill()``, but causes the ``cloudpickle`` | |
89 | module from PiCloud's `cloud`__ library to be used rather than dill or the |
|
91 | module from PiCloud's `cloud`__ library to be used rather than dill or the | |
90 | builtin pickle module. |
|
92 | builtin pickle module. | |
91 |
|
93 | |||
92 | __ https://pypi.python.org/pypi/cloud |
|
94 | __ https://pypi.python.org/pypi/cloud | |
93 |
|
95 | |||
94 | * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook` |
|
96 | * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook` | |
95 | as a commandline argument to nbconvert. |
|
97 | as a commandline argument to nbconvert. | |
96 |
|
98 | |||
97 | * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This |
|
99 | * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This | |
98 | clears the output from IPython notebooks. |
|
100 | clears the output from IPython notebooks. | |
99 |
|
101 | |||
100 | * New preprocessor for nbconvert that executes all the code cells in a notebook. |
|
102 | * New preprocessor for nbconvert that executes all the code cells in a notebook. | |
101 | To run a notebook and save its output in a new notebook:: |
|
103 | To run a notebook and save its output in a new notebook:: | |
102 |
|
104 | |||
103 | ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed |
|
105 | ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed | |
104 |
|
106 | |||
105 | * Consecutive stream (stdout/stderr) output is merged into a single output |
|
107 | * Consecutive stream (stdout/stderr) output is merged into a single output | |
106 | in the notebook document. |
|
108 | in the notebook document. | |
107 | Previously, all output messages were preserved as separate output fields in the JSON. |
|
109 | Previously, all output messages were preserved as separate output fields in the JSON. | |
108 | Now, the same merge is applied to the stored output as the displayed output, |
|
110 | Now, the same merge is applied to the stored output as the displayed output, | |
109 | improving document load time for notebooks with many small outputs. |
|
111 | improving document load time for notebooks with many small outputs. | |
110 |
|
112 | |||
111 | * ``NotebookApp.webapp_settings`` is deprecated and replaced with |
|
113 | * ``NotebookApp.webapp_settings`` is deprecated and replaced with | |
112 | the more informatively named ``NotebookApp.tornado_settings``. |
|
114 | the more informatively named ``NotebookApp.tornado_settings``. | |
113 |
|
115 | |||
114 | * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings |
|
116 | * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings | |
115 | between the slowest and fastest runs, since this might meant that the multiple |
|
117 | between the slowest and fastest runs, since this might meant that the multiple | |
116 | runs are not independent of one another. |
|
118 | runs are not independent of one another. | |
117 |
|
119 | |||
118 | * It's now possible to provide mechanisms to integrate IPython with other event |
|
120 | * It's now possible to provide mechanisms to integrate IPython with other event | |
119 | loops, in addition to the ones we already support. This lets you run GUI code |
|
121 | loops, in addition to the ones we already support. This lets you run GUI code | |
120 | in IPython with an interactive prompt, and to embed the IPython |
|
122 | in IPython with an interactive prompt, and to embed the IPython | |
121 | kernel in GUI applications. See :doc:`/config/eventloops` for details. As part |
|
123 | kernel in GUI applications. See :doc:`/config/eventloops` for details. As part | |
122 | of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs |
|
124 | of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs | |
123 | in :mod:`IPython.lib.inputhook` have been deprecated in favour of |
|
125 | in :mod:`IPython.lib.inputhook` have been deprecated in favour of | |
124 | :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`. |
|
126 | :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`. | |
125 |
|
127 | |||
126 | * A ``ScrollManager`` was added to the notebook. The ``ScrollManager`` controls how the notebook document is scrolled using keyboard. Users can inherit from the ``ScrollManager`` or ``TargetScrollManager`` to customize how their notebook scrolls. The default ``ScrollManager`` is the ``SlideScrollManager``, which tries to scroll to the nearest slide or sub-slide cell. |
|
128 | * A ``ScrollManager`` was added to the notebook. The ``ScrollManager`` controls how the notebook document is scrolled using keyboard. Users can inherit from the ``ScrollManager`` or ``TargetScrollManager`` to customize how their notebook scrolls. The default ``ScrollManager`` is the ``SlideScrollManager``, which tries to scroll to the nearest slide or sub-slide cell. | |
127 |
|
129 | |||
128 | * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been |
|
130 | * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been | |
129 | added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`, |
|
131 | added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`, | |
130 | but adds a button to explicitly run the interacted-with function, rather than |
|
132 | but adds a button to explicitly run the interacted-with function, rather than | |
131 | doing it automatically for every change of the parameter widgets. This should |
|
133 | doing it automatically for every change of the parameter widgets. This should | |
132 | be useful for long-running functions. |
|
134 | be useful for long-running functions. | |
133 |
|
135 | |||
134 | * The ``%cython`` magic is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have access to the magic now. |
|
136 | * The ``%cython`` magic is now part of the Cython module. Use `%load_ext Cython` with a version of Cython >= 0.21 to have access to the magic now. | |
135 |
|
137 | |||
136 | * The Notebook application now offers integrated terminals on Unix platforms, |
|
138 | * The Notebook application now offers integrated terminals on Unix platforms, | |
137 | intended for when it is used on a remote server. To enable these, install |
|
139 | intended for when it is used on a remote server. To enable these, install | |
138 | the ``terminado`` Python package. |
|
140 | the ``terminado`` Python package. | |
139 |
|
141 | |||
140 | * The Notebook application can now edit any plain text files, via a full-page CodeMirror instance. |
|
142 | * The Notebook application can now edit any plain text files, via a full-page CodeMirror instance. | |
141 |
|
143 | |||
142 | * Setting the default highlighting language for nbconvert with the config option |
|
144 | * Setting the default highlighting language for nbconvert with the config option | |
143 | ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects |
|
145 | ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects | |
144 | metadata stored in the :ref:`kernel spec <kernelspecs>`. |
|
146 | metadata stored in the :ref:`kernel spec <kernelspecs>`. | |
145 |
|
147 | |||
146 | * IPython can now be configured systemwide, with files in :file:`/etc/ipython` |
|
148 | * IPython can now be configured systemwide, with files in :file:`/etc/ipython` | |
147 | or :file:`/usr/local/etc/ipython` on Unix systems, |
|
149 | or :file:`/usr/local/etc/ipython` on Unix systems, | |
148 | or :file:`{%PROGRAMDATA%}\\ipython` on Windows. |
|
150 | or :file:`{%PROGRAMDATA%}\\ipython` on Windows. | |
149 |
|
151 | |||
150 | * Added support for configurable user-supplied `Jinja |
|
152 | * Added support for configurable user-supplied `Jinja | |
151 | <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to |
|
153 | <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to | |
152 | directories containing template files can be specified via |
|
154 | directories containing template files can be specified via | |
153 | ``NotebookApp.extra_template_paths``. User-supplied template directories |
|
155 | ``NotebookApp.extra_template_paths``. User-supplied template directories | |
154 | searched first by the notebook, making it possible to replace existing |
|
156 | searched first by the notebook, making it possible to replace existing | |
155 | templates with your own files. |
|
157 | templates with your own files. | |
156 |
|
158 | |||
157 | For example, to replace the notebook's built-in ``error.html`` with your own, |
|
159 | For example, to replace the notebook's built-in ``error.html`` with your own, | |
158 | create a directory like ``/home/my_templates`` and put your override template |
|
160 | create a directory like ``/home/my_templates`` and put your override template | |
159 | at ``/home/my_templates/error.html``. To start the notebook with your custom |
|
161 | at ``/home/my_templates/error.html``. To start the notebook with your custom | |
160 | error page enabled, you would run:: |
|
162 | error page enabled, you would run:: | |
161 |
|
163 | |||
162 | ipython notebook '--extra_template_paths=["/home/my_templates/"]' |
|
164 | ipython notebook '--extra_template_paths=["/home/my_templates/"]' | |
163 |
|
165 | |||
164 | It's also possible to override a template while also `inheriting |
|
166 | It's also possible to override a template while also `inheriting | |
165 | <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that |
|
167 | <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that | |
166 | template, by prepending ``templates/`` to the ``{% extends %}`` target of |
|
168 | template, by prepending ``templates/`` to the ``{% extends %}`` target of | |
167 | your child template. This is useful when you only want to override a |
|
169 | your child template. This is useful when you only want to override a | |
168 | specific block of a template. For example, to add additional CSS to the |
|
170 | specific block of a template. For example, to add additional CSS to the | |
169 | built-in ``error.html``, you might create an override that looks like:: |
|
171 | built-in ``error.html``, you might create an override that looks like:: | |
170 |
|
172 | |||
171 | {% extends "templates/error.html" %} |
|
173 | {% extends "templates/error.html" %} | |
172 |
|
174 | |||
173 | {% block stylesheet %} |
|
175 | {% block stylesheet %} | |
174 | {{super()}} |
|
176 | {{super()}} | |
175 | <style type="text/css"> |
|
177 | <style type="text/css"> | |
176 | /* My Awesome CSS */ |
|
178 | /* My Awesome CSS */ | |
177 | </style> |
|
179 | </style> | |
178 | {% endblock %} |
|
180 | {% endblock %} | |
179 |
|
181 | |||
180 | * Added a widget persistence API. This allows you to persist your notebooks interactive widgets. |
|
182 | * Added a widget persistence API. This allows you to persist your notebooks interactive widgets. | |
181 | Two levels of control are provided: |
|
183 | Two levels of control are provided: | |
182 | 1. Higher level- ``WidgetManager.set_state_callbacks`` allows you to register callbacks for loading and saving widget state. The callbacks you register are automatically called when necessary. |
|
184 | 1. Higher level- ``WidgetManager.set_state_callbacks`` allows you to register callbacks for loading and saving widget state. The callbacks you register are automatically called when necessary. | |
183 | 2. Lower level- the ``WidgetManager`` Javascript class now has ``get_state`` and ``set_state`` methods that allow you to get and set the state of the widget runtime. |
|
185 | 2. Lower level- the ``WidgetManager`` Javascript class now has ``get_state`` and ``set_state`` methods that allow you to get and set the state of the widget runtime. | |
184 |
|
186 | |||
185 | Example code for persisting your widget state to session data:: |
|
187 | Example code for persisting your widget state to session data:: | |
186 |
|
188 | |||
187 | %%javascript |
|
189 | %%javascript | |
188 | require(['widgets/js/manager'], function(manager) { |
|
190 | require(['widgets/js/manager'], function(manager) { | |
189 | manager.WidgetManager.set_state_callbacks(function() { // Load |
|
191 | manager.WidgetManager.set_state_callbacks(function() { // Load | |
190 | return JSON.parse(sessionStorage.widgets_state || '{}'); |
|
192 | return JSON.parse(sessionStorage.widgets_state || '{}'); | |
191 | }, function(state) { // Save |
|
193 | }, function(state) { // Save | |
192 | sessionStorage.widgets_state = JSON.stringify(state); |
|
194 | sessionStorage.widgets_state = JSON.stringify(state); | |
193 | }); |
|
195 | }); | |
194 | }); |
|
196 | }); | |
195 |
|
197 | |||
196 | * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no |
|
198 | * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no | |
197 | arguments displays all environment variables and values. Additionally, |
|
199 | arguments displays all environment variables and values. Additionally, | |
198 | :magic:`env` can be used to get or set individual environment variables. To |
|
200 | :magic:`env` can be used to get or set individual environment variables. To | |
199 | display an individual value, use the `%env var` syntax. To set a value, use |
|
201 | display an individual value, use the `%env var` syntax. To set a value, use | |
200 | `env var val` or `env var=val`. Python value expansion using `$` works as usual. |
|
202 | `env var val` or `env var=val`. Python value expansion using `$` works as usual. | |
201 |
|
203 | |||
202 |
|
204 | |||
203 | Backwards incompatible changes |
|
205 | Backwards incompatible changes | |
204 | ------------------------------ |
|
206 | ------------------------------ | |
205 |
|
207 | |||
206 | * The :ref:`message protocol <messaging>` has been updated from version 4 to version 5. |
|
208 | * The :ref:`message protocol <messaging>` has been updated from version 4 to version 5. | |
207 | Adapters are included, so IPython frontends can still talk to kernels that |
|
209 | Adapters are included, so IPython frontends can still talk to kernels that | |
208 | implement protocol version 4. |
|
210 | implement protocol version 4. | |
209 |
|
211 | |||
210 | * The :ref:`notebook format <nbformat>` has been updated from version 3 to version 4. |
|
212 | * The :ref:`notebook format <nbformat>` has been updated from version 3 to version 4. | |
211 | Read-only support for v4 notebooks has been backported to IPython 2.4. |
|
213 | Read-only support for v4 notebooks has been backported to IPython 2.4. | |
212 | Notable changes: |
|
214 | Notable changes: | |
213 |
|
215 | |||
214 | * heading cells are removed in favor or markdown headings |
|
216 | * heading cells are removed in favor or markdown headings | |
215 | * notebook outputs and output messages are more consistent with each other |
|
217 | * notebook outputs and output messages are more consistent with each other | |
216 | * use :func:`IPython.nbformat.read` and :func:`~IPython.nbformat.write` |
|
218 | * use :func:`IPython.nbformat.read` and :func:`~IPython.nbformat.write` | |
217 | to read and write notebook files |
|
219 | to read and write notebook files | |
218 | instead of the deprecated :mod:`IPython.nbformat.current` APIs. |
|
220 | instead of the deprecated :mod:`IPython.nbformat.current` APIs. | |
219 |
|
221 | |||
220 | You can downgrade a notebook to v3 via ``nbconvert``:: |
|
222 | You can downgrade a notebook to v3 via ``nbconvert``:: | |
221 |
|
223 | |||
222 | ipython nbconvert --to notebook --nbformat 3 <notebook> |
|
224 | ipython nbconvert --to notebook --nbformat 3 <notebook> | |
223 |
|
225 | |||
224 | which will create :file:`notebook.v3.ipynb`, a copy of the notebook in v3 format. |
|
226 | which will create :file:`notebook.v3.ipynb`, a copy of the notebook in v3 format. | |
225 |
|
227 | |||
226 | * :func:`IPython.core.oinspect.getsource` call specification has changed: |
|
228 | * :func:`IPython.core.oinspect.getsource` call specification has changed: | |
227 |
|
229 | |||
228 | * `oname` keyword argument has been added for property source formatting |
|
230 | * `oname` keyword argument has been added for property source formatting | |
229 | * `is_binary` keyword argument has been dropped, passing ``True`` had |
|
231 | * `is_binary` keyword argument has been dropped, passing ``True`` had | |
230 | previously short-circuited the function to return ``None`` unconditionally |
|
232 | previously short-circuited the function to return ``None`` unconditionally | |
231 |
|
233 | |||
232 | * Removed the octavemagic extension: it is now available as ``oct2py.ipython``. |
|
234 | * Removed the octavemagic extension: it is now available as ``oct2py.ipython``. | |
233 |
|
235 | |||
234 | * Creating PDFs with LaTeX no longer uses a post processor. |
|
236 | * Creating PDFs with LaTeX no longer uses a post processor. | |
235 | Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`. |
|
237 | Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`. | |
236 |
|
238 | |||
237 | * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3. |
|
239 | * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3. | |
238 |
|
240 | |||
239 | Additional changes: |
|
241 | Additional changes: | |
240 |
|
242 | |||
241 | - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`) |
|
243 | - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`) | |
242 | - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less` |
|
244 | - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less` | |
243 | - Set `#header` div `margin-bottom: 0px;` |
|
245 | - Set `#header` div `margin-bottom: 0px;` | |
244 | - Set `#menus` to `float: left;` |
|
246 | - Set `#menus` to `float: left;` | |
245 | - Set `#maintoolbar .navbar-text` to `float: none;` |
|
247 | - Set `#maintoolbar .navbar-text` to `float: none;` | |
246 | - Added no-padding convenience class. |
|
248 | - Added no-padding convenience class. | |
247 | - Set border of #maintoolbar to 0px |
|
249 | - Set border of #maintoolbar to 0px | |
248 |
|
250 | |||
249 | * Accessing the `container` DOM object when displaying javascript has been |
|
251 | * Accessing the `container` DOM object when displaying javascript has been | |
250 | deprecated in IPython 2.0 in favor of accessing `element`. Starting with |
|
252 | deprecated in IPython 2.0 in favor of accessing `element`. Starting with | |
251 | IPython 3.0 trying to access `container` will raise an error in browser |
|
253 | IPython 3.0 trying to access `container` will raise an error in browser | |
252 | javascript console. |
|
254 | javascript console. | |
253 |
|
255 | |||
254 | * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all |
|
256 | * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all | |
255 | the same functionality. |
|
257 | the same functionality. | |
256 |
|
258 | |||
257 | * The NotebookManager and ``/api/notebooks`` service has been replaced by |
|
259 | * The NotebookManager and ``/api/notebooks`` service has been replaced by | |
258 | a more generic ContentsManager and ``/api/contents`` service, |
|
260 | a more generic ContentsManager and ``/api/contents`` service, | |
259 | which supports all kinds of files. |
|
261 | which supports all kinds of files. | |
260 | * The Dashboard now lists all files, not just notebooks and directories. |
|
262 | * The Dashboard now lists all files, not just notebooks and directories. | |
261 | * The ``--script`` hook for saving notebooks to Python scripts is removed, |
|
263 | * The ``--script`` hook for saving notebooks to Python scripts is removed, | |
262 | use :samp:`ipython nbconvert --to python {notebook}` instead. |
|
264 | use :samp:`ipython nbconvert --to python {notebook}` instead. | |
263 |
|
265 | |||
264 | * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See |
|
266 | * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See | |
265 | :mod:`rpy2.ipython.rmagic`. |
|
267 | :mod:`rpy2.ipython.rmagic`. | |
266 |
|
268 | |||
267 | * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd` |
|
269 | * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd` | |
268 | no longer accept a ``executable`` parameter. Use the kernelspec machinery instead. |
|
270 | no longer accept a ``executable`` parameter. Use the kernelspec machinery instead. | |
269 |
|
271 | |||
270 | * The widget classes have been renamed from `*Widget` to `*`. The old names are |
|
272 | * The widget classes have been renamed from `*Widget` to `*`. The old names are | |
271 | still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed |
|
273 | still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed | |
272 | to `IntSlider`. |
|
274 | to `IntSlider`. | |
273 | * The ContainerWidget was renamed to Box and no longer defaults as a flexible |
|
275 | * The ContainerWidget was renamed to Box and no longer defaults as a flexible | |
274 | box in the web browser. A new FlexBox widget was added, which allows you to |
|
276 | box in the web browser. A new FlexBox widget was added, which allows you to | |
275 | use the flexible box model. |
|
277 | use the flexible box model. | |
276 |
|
278 | |||
277 | * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate |
|
279 | * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate | |
278 | `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a |
|
280 | `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a | |
279 | `channel` key in the message dict, for both send and recv. |
|
281 | `channel` key in the message dict, for both send and recv. | |
280 |
|
282 | |||
281 |
|
283 | |||
282 | Content Security Policy |
|
284 | Content Security Policy | |
283 | ``````````````````````` |
|
285 | ``````````````````````` | |
284 |
|
286 | |||
285 | The Content Security Policy is a web standard for adding a layer of security to |
|
287 | The Content Security Policy is a web standard for adding a layer of security to | |
286 | detect and mitigate certain classes of attacks, including Cross Site Scripting |
|
288 | detect and mitigate certain classes of attacks, including Cross Site Scripting | |
287 | (XSS) and data injection attacks. This was introduced into the notebook to |
|
289 | (XSS) and data injection attacks. This was introduced into the notebook to | |
288 | ensure that the IPython Notebook and its APIs (by default) can only be embedded |
|
290 | ensure that the IPython Notebook and its APIs (by default) can only be embedded | |
289 | in an iframe on the same origin. |
|
291 | in an iframe on the same origin. | |
290 |
|
292 | |||
291 | Override ``headers['Content-Security-Policy']`` within your notebook |
|
293 | Override ``headers['Content-Security-Policy']`` within your notebook | |
292 | configuration to extend for alternate domains and security settings.:: |
|
294 | configuration to extend for alternate domains and security settings.:: | |
293 |
|
295 | |||
294 | c.NotebookApp.tornado_settings = { |
|
296 | c.NotebookApp.tornado_settings = { | |
295 | 'headers': { |
|
297 | 'headers': { | |
296 | 'Content-Security-Policy': "frame-ancestors 'self'" |
|
298 | 'Content-Security-Policy': "frame-ancestors 'self'" | |
297 | } |
|
299 | } | |
298 | } |
|
300 | } | |
299 |
|
301 | |||
300 | Example policies:: |
|
302 | Example policies:: | |
301 |
|
303 | |||
302 | Content-Security-Policy: default-src 'self' https://*.jupyter.org |
|
304 | Content-Security-Policy: default-src 'self' https://*.jupyter.org | |
303 |
|
305 | |||
304 | Matches embeddings on any subdomain of jupyter.org, so long as they are served |
|
306 | Matches embeddings on any subdomain of jupyter.org, so long as they are served | |
305 | over SSL. |
|
307 | over SSL. | |
306 |
|
308 | |||
307 | There is a `report-uri <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#report-uri>`_ endpoint available for logging CSP violations, located at |
|
309 | There is a `report-uri <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#report-uri>`_ endpoint available for logging CSP violations, located at | |
308 | ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP:: |
|
310 | ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP:: | |
309 |
|
311 | |||
310 | c.NotebookApp.tornado_settings = { |
|
312 | c.NotebookApp.tornado_settings = { | |
311 | 'headers': { |
|
313 | 'headers': { | |
312 | 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report" |
|
314 | 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report" | |
313 | } |
|
315 | } | |
314 | } |
|
316 | } | |
315 |
|
317 | |||
316 | It simply provides the CSP report as a warning in IPython's logs. The default |
|
318 | It simply provides the CSP report as a warning in IPython's logs. The default | |
317 | CSP sets this report-uri relative to the ``base_url`` (not shown above). |
|
319 | CSP sets this report-uri relative to the ``base_url`` (not shown above). | |
318 |
|
320 | |||
319 | For a more thorough and accurate guide on Content Security Policies, check out |
|
321 | For a more thorough and accurate guide on Content Security Policies, check out | |
320 | `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples. |
|
322 | `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples. |
General Comments 0
You need to be logged in to leave comments.
Login now