##// END OF EJS Templates
date typos
Min RK -
Show More
@@ -1,379 +1,379 b''
1 1 ============
2 2 2.x Series
3 3 ============
4 4
5 5 Release 2.4
6 6 ===========
7 7
8 January, 2014
8 January, 2015
9 9
10 10 - backport read support for nbformat v4 from IPython 3
11 11 - support for PyQt5
12 12 - support for Pygments 2.0
13 13
14 14 For more information on what fixes have been backported to 2.4,
15 15 see our :ref:`detailed release info <issues_list_200>`.
16 16
17 17
18 18 Release 2.3.1
19 19 =============
20 20
21 21 November, 2014
22 22
23 23 - Fix CRCRLF line-ending bug in notebooks on Windows
24 24
25 25 For more information on what fixes have been backported to 2.3.1,
26 26 see our :ref:`detailed release info <issues_list_200>`.
27 27
28 28 Release 2.3.0
29 29 =============
30 30
31 31 October, 2014
32 32
33 33 - improve qt5 support
34 34 - prevent notebook data loss with atomic writes
35 35
36 36 For more information on what fixes have been backported to 2.3,
37 37 see our :ref:`detailed release info <issues_list_200>`.
38 38
39 39 Release 2.2.0
40 40 =============
41 41
42 42 August, 2014
43 43
44 44 - Add CORS configuration
45 45
46 46 For more information on what fixes have been backported to 2.2,
47 47 see our :ref:`detailed release info <issues_list_200>`.
48 48
49 49 Release 2.1.0
50 50 =============
51 51
52 52 May, 2014
53 53
54 54 IPython 2.1 is the first bugfix release for 2.0.
55 55 For more information on what fixes have been backported to 2.1,
56 56 see our :ref:`detailed release info
57 57 <issues_list_200>`.
58 58
59 59
60 60 Release 2.0.0
61 61 =============
62 62
63 63 April, 2014
64 64
65 65 IPython 2.0 requires Python β‰₯ 2.7.2 or β‰₯ 3.3.0.
66 66 It does not support Python 3.0, 3.1, 3.2, 2.5, or 2.6.
67 67
68 68 The principal milestones of 2.0 are:
69 69
70 70 - interactive widgets for the notebook
71 71 - directory navigation in the notebook dashboard
72 72 - persistent URLs for notebooks
73 73 - a new modal user interface in the notebook
74 74 - a security model for notebooks
75 75
76 76 Contribution summary since IPython 1.0 in August, 2013:
77 77
78 78 - ~8 months of work
79 79 - ~650 pull requests merged
80 80 - ~400 issues closed (non-pull requests)
81 81 - contributions from ~100 authors
82 82 - ~4000 commits
83 83
84 84 The amount of work included in this release is so large that we can only cover
85 85 here the main highlights; please see our :ref:`detailed release statistics
86 86 <issues_list_200>` for links to every issue and pull request closed on GitHub
87 87 as well as a full list of individual contributors.
88 88
89 89 New stuff in the IPython notebook
90 90 ---------------------------------
91 91
92 92 Directory navigation
93 93 ********************
94 94
95 95 .. image:: /_images/2.0/treeview.png
96 96 :width: 392px
97 97 :alt: Directory navigation
98 98 :align: center
99 99
100 100 The IPython notebook dashboard allows navigation into subdirectories.
101 101 URLs are persistent based on the notebook's path and name,
102 102 so no more random UUID URLs.
103 103
104 104 Serving local files no longer needs the ``files/`` prefix.
105 105 Relative links across notebooks and other files should work just as if notebooks were regular HTML files.
106 106
107 107 Interactive widgets
108 108 *******************
109 109
110 110 .. image:: /_images/2.0/widgets.png
111 111 :width: 392px
112 112 :alt: Interactive widgets
113 113 :align: center
114 114
115 115 IPython 2.0 adds :mod:`IPython.html.widgets`, for manipulating
116 116 Python objects in the kernel with GUI controls in the notebook.
117 117 IPython comes with a few built-in widgets for simple data types,
118 118 and an API designed for developers to build more complex widgets.
119 119 See the `widget docs`_ for more information.
120 120
121 121 .. _widget docs: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Interactive%20Widgets/Index.ipynb
122 122
123 123
124 124 Modal user interface
125 125 ********************
126 126
127 127 The notebook has added separate Edit and Command modes,
128 128 allowing easier keyboard commands and making keyboard shortcut customization possible.
129 129 See the new `User Interface notebook`_ for more information.
130 130
131 131 .. _User Interface Notebook: http://nbviewer.ipython.org/github/ipython/ipython/blob/2.x/examples/Notebook/User%20Interface.ipynb
132 132
133 133
134 134 You can familiarize yourself with the updated notebook user interface, including an
135 135 explanation of Edit and Command modes, by going through the short guided tour
136 136 which can be started from the Help menu.
137 137
138 138 .. image:: /_images/2.0/user-interface.png
139 139 :width: 392px
140 140 :alt: Interface tour
141 141 :align: center
142 142
143 143
144 144 Security
145 145 ********
146 146
147 147 2.0 introduces a :ref:`security model <notebook_security>` for notebooks,
148 148 to prevent untrusted code from executing on users' behalf when notebooks open.
149 149 A quick summary of the model:
150 150
151 151 - Trust is determined by :ref:`signing notebooks<signing_notebooks>`.
152 152 - Untrusted HTML output is sanitized.
153 153 - Untrusted Javascript is never executed.
154 154 - HTML and Javascript in Markdown are never trusted.
155 155
156 156 Dashboard "Running" tab
157 157 ***********************
158 158
159 159 .. image:: /_images/2.0/running-crop.png
160 160 :width: 392px
161 161 :alt: Running tab
162 162 :align: center
163 163
164 164 The dashboard now has a "Running" tab which shows all of the running notebooks.
165 165
166 166 Single codebase Python 3 support
167 167 --------------------------------
168 168
169 169 IPython previously supported Python 3 by running 2to3 during setup. We
170 170 have now switched to a single codebase which runs natively on Python 2.7
171 171 and 3.3.
172 172
173 173 For notes on how to maintain this, see :doc:`/development/pycompat`.
174 174
175 175 Selecting matplotlib figure formats
176 176 -----------------------------------
177 177
178 178 Deprecate single-format ``InlineBackend.figure_format``
179 179 configurable in favor of ``InlineBackend.figure_formats``,
180 180 which is a set, supporting multiple simultaneous figure formats (e.g. png, pdf).
181 181
182 182 This is available at runtime with the new API function :func:`IPython.display.set_matplotlib_formats`.
183 183
184 184 clear_output changes
185 185 --------------------
186 186
187 187 * There is no longer a 500ms delay when calling ``clear_output``.
188 188 * The ability to clear stderr and stdout individually was removed.
189 189 * A new ``wait`` flag that prevents ``clear_output`` from being executed until new
190 190 output is available. This eliminates animation flickering by allowing the
191 191 user to double buffer the output.
192 192 * The output div height is remembered when the ``wait=True`` flag is used.
193 193
194 194 Extending configurable containers
195 195 ---------------------------------
196 196
197 197 Some configurable traits are containers (list, dict, set)
198 198 Config objects now support calling ``extend``, ``update``, ``insert``, etc.
199 199 on traits in config files, which will ultimately result in calling
200 200 those methods on the original object.
201 201
202 202 The effect being that you can now add to containers without having to copy/paste
203 203 the initial value::
204 204
205 205 c = get_config()
206 206 c.InlineBackend.rc.update({ 'figure.figsize' : (6, 4) })
207 207
208 208 Changes to hidden namespace on startup
209 209 --------------------------------------
210 210
211 211 Previously, all names declared in code run at startup
212 212 (startup files, ``ipython -i script.py``, etc.)
213 213 were added to the hidden namespace, which hides the names from tools like ``%whos``.
214 214 There are two changes to this behavior:
215 215
216 216 1. Scripts run on the command-line ``ipython -i script.py``now behave the same as if they were
217 217 passed to ``%run``, so their variables are never hidden.
218 218 2. A boolean config flag ``InteractiveShellApp.hide_initial_ns`` has been added to optionally
219 219 disable the hidden behavior altogether. The default behavior is unchanged.
220 220
221 221 Using dill to expand serialization support
222 222 ------------------------------------------
223 223
224 224 The new function :func:`~IPython.utils.pickleutil.use_dill` allows
225 225 dill to extend serialization support in :mod:`IPython.parallel` (closures, etc.).
226 226 A :meth:`DirectView.use_dill` convenience method was also added, to enable dill
227 227 locally and on all engines with one call.
228 228
229 229 New IPython console lexer
230 230 -------------------------
231 231
232 232 The IPython console lexer has been rewritten and now supports tracebacks
233 233 and customized input/output prompts. See the :ref:`new lexer docs <console_lexer>`
234 234 for details.
235 235
236 236 DisplayFormatter changes
237 237 ------------------------
238 238
239 239 There was no official way to query or remove callbacks in the Formatter API.
240 240 To remedy this, the following methods are added to :class:`BaseFormatter`:
241 241
242 242 - ``lookup(instance)`` - return appropriate callback or a given object
243 243 - ``lookup_by_type(type_or_str)`` - return appropriate callback for a given type or ``'mod.name'`` type string
244 244 - ``pop(type_or_str)`` - remove a type (by type or string).
245 245 Pass a second argument to avoid KeyError (like dict).
246 246
247 247 All of the above methods raise a KeyError if no match is found.
248 248
249 249 And the following methods are changed:
250 250
251 251 - ``for_type(type_or_str)`` - behaves the same as before, only adding support for ``'mod.name'``
252 252 type strings in addition to plain types. This removes the need for ``for_type_by_name()``,
253 253 but it remains for backward compatibility.
254 254
255 255 Formatters can now raise NotImplementedError in addition to returning None
256 256 to indicate that they cannot format a given object.
257 257
258 258 Exceptions and Warnings
259 259 ***********************
260 260
261 261 Exceptions are no longer silenced when formatters fail.
262 262 Instead, these are turned into a :class:`~IPython.core.formatters.FormatterWarning`.
263 263 A FormatterWarning will also be issued if a formatter returns data of an invalid type
264 264 (e.g. an integer for 'image/png').
265 265
266 266
267 267 Other changes
268 268 -------------
269 269
270 270 * `%%capture` cell magic now captures the rich display output, not just
271 271 stdout/stderr
272 272
273 273 * In notebook, Showing tooltip on tab has been disables to avoid conflict with
274 274 completion, Shift-Tab could still be used to invoke tooltip when inside
275 275 function signature and/or on selection.
276 276
277 277 * ``object_info_request`` has been replaced by ``object_info`` for consistency in the javascript API.
278 278 ``object_info`` is a simpler interface to register callback that is incompatible with ``object_info_request``.
279 279
280 280 * Previous versions of IPython on Linux would use the XDG config directory,
281 281 creating :file:`~/.config/ipython` by default. We have decided to go
282 282 back to :file:`~/.ipython` for consistency among systems. IPython will
283 283 issue a warning if it finds the XDG location, and will move it to the new
284 284 location if there isn't already a directory there.
285 285
286 286 * Equations, images and tables are now centered in Markdown cells.
287 287 * Multiline equations are now centered in output areas; single line equations
288 288 remain left justified.
289 289
290 290 * IPython config objects can be loaded from and serialized to JSON.
291 291 JSON config file have the same base name as their ``.py`` counterpart,
292 292 and will be loaded with higher priority if found.
293 293
294 294 * bash completion updated with support for all ipython subcommands and flags, including nbconvert
295 295
296 296 * ``ipython history trim``: added ``--keep=<N>`` as an alias for the more verbose
297 297 ``--HistoryTrim.keep=<N>``
298 298 * New ``ipython history clear`` subcommand, which is the same as the newly supported
299 299 ``ipython history trim --keep=0``
300 300
301 301 * You can now run notebooks in an interactive session via ``%run notebook.ipynb``.
302 302
303 303 * Print preview is back in the notebook menus, along with options to
304 304 download the open notebook in various formats. This is powered by
305 305 nbconvert.
306 306
307 307 * :exc:`~IPython.nbconvert.utils.pandoc.PandocMissing` exceptions will be
308 308 raised if Pandoc is unavailable, and warnings will be printed if the version
309 309 found is too old. The recommended Pandoc version for use with nbconvert is
310 310 1.12.1.
311 311
312 312 * The InlineBackend.figure_format now supports JPEG output if PIL/Pillow is available.
313 313
314 314 * Input transformers (see :doc:`/config/inputtransforms`) may now raise
315 315 :exc:`SyntaxError` if they determine that input is invalid. The input
316 316 transformation machinery in IPython will handle displaying the exception to
317 317 the user and resetting state.
318 318
319 319 * Calling ``container.show()`` on javascript display is deprecated and will
320 320 trigger errors on future IPython notebook versions. ``container`` now show
321 321 itself as soon as non-empty
322 322
323 323 * Added ``InlineBackend.print_figure_kwargs`` to allow passing keyword arguments
324 324 to matplotlib's ``Canvas.print_figure``. This can be used to change the value of
325 325 ``bbox_inches``, which is 'tight' by default, or set the quality of JPEG figures.
326 326
327 327 * A new callback system has been introduced. For details, see :doc:`/config/callbacks`.
328 328
329 329 * jQuery and require.js are loaded from CDNs in the default HTML template,
330 330 so javascript is available in static HTML export (e.g. nbviewer).
331 331
332 332 Backwards incompatible changes
333 333 ------------------------------
334 334
335 335 * Python 2.6 and 3.2 are no longer supported: the minimum required
336 336 Python versions are now 2.7 and 3.3.
337 337 * The Transformer classes have been renamed to Preprocessor in nbconvert and
338 338 their ``call`` methods have been renamed to ``preprocess``.
339 339 * The ``call`` methods of nbconvert post-processsors have been renamed to
340 340 ``postprocess``.
341 341
342 342 * The module ``IPython.core.fakemodule`` has been removed.
343 343
344 344 * The alias system has been reimplemented to use magic functions. There should be little
345 345 visible difference while automagics are enabled, as they are by default, but parts of the
346 346 :class:`~IPython.core.alias.AliasManager` API have been removed.
347 347
348 348 * We fixed an issue with switching between matplotlib inline and GUI backends,
349 349 but the fix requires matplotlib 1.1 or newer. So from now on, we consider
350 350 matplotlib 1.1 to be the minimally supported version for IPython. Older
351 351 versions for the most part will work, but we make no guarantees about it.
352 352
353 353 * The :command:`pycolor` command has been removed. We recommend the much more capable
354 354 :command:`pygmentize` command from the `Pygments <http://pygments.org/>`_ project.
355 355 If you need to keep the exact output of :command:`pycolor`, you can still use
356 356 ``python -m IPython.utils.PyColorize foo.py``.
357 357
358 358 * :mod:`IPython.lib.irunner` and its command-line entry point have been removed.
359 359 It had fallen out of use long ago.
360 360
361 361 * The ``input_prefilter`` hook has been removed, as it was never
362 362 actually used by the code. The input transformer system offers much
363 363 more powerful APIs to work with input code. See
364 364 :doc:`/config/inputtransforms` for details.
365 365
366 366 * :class:`IPython.core.inputsplitter.IPythonInputSplitter` no longer has a method
367 367 ``source_raw_reset()``, but gains :meth:`~IPython.core.inputsplitter.IPythonInputSplitter.raw_reset`
368 368 instead. Use of ``source_raw_reset`` can be replaced with::
369 369
370 370 raw = isp.source_raw
371 371 transformed = isp.source_reset()
372 372
373 373 * The Azure notebook manager was removed as it was no longer compatible with the notebook storage scheme.
374 374
375 375 * Simplifying configurable URLs
376 376
377 377 - base_project_url is renamed to base_url (base_project_url is kept as a deprecated alias, for now)
378 378 - base_kernel_url configurable is removed (use base_url)
379 379 - websocket_url configurable is removed (use base_url)
@@ -1,310 +1,310 b''
1 1 ============
2 2 3.x Series
3 3 ============
4 4
5 5
6 6 Release 3.0
7 7 ===========
8 8
9 Coming Feburary, 2015
9 Coming February, 2015
10 10
11 11 This is a really big release. Over 150 contributors, and almost 6000 commits in a bit under a year.
12 12 Support for languages other than Python is greatly improved,
13 13 notebook UI has been significantly redesigned,
14 14 and a lot of improvement has happened in the experimental interactive widgets.
15 15 The message protocol and document format have both been updated,
16 16 while maintaining better compatibility with previous versions than prior updates.
17 17 The notebook webapp now enables editing of any text file, and even
18 18 a web-based terminal (on Unix platforms).
19 19
20 20 3.x will be the last monolithic release of IPython,
21 21 as the next release cycle will see the growing project split into its Python-specific and language-agnostic components.
22 22 Language-agnostic projects (notebook, qtconsole, etc.) will move under the umbrella of the new Project Jupyter name,
23 23 while Python-specific projects (interactive Python shell, Python kernel, IPython.parallel)
24 24 will remain under IPython, and be split into a few smaller packages.
25 25 To reflect this, IPython is in a bit of a transition state.
26 26 The logo on the notebook is now the Jupyter logo.
27 27 When installing kernels system-wide, they go in a `jupyter` directory.
28 28 We are going to do our best to ease this transition for users and developers.
29 29
30 30 Big changes are ahead.
31 31
32 32
33 33 Using different kernels
34 34 -----------------------
35 35
36 36 .. image:: ../_images/kernel_selector_screenshot.png
37 37 :alt: Screenshot of 'new' dropdown showing different kernels
38 38 :align: center
39 39
40 40 You can now choose a kernel for a notebook within the user interface, rather
41 41 than starting up a separate notebook server for each kernel you want to use. The
42 42 syntax highlighting adapts to match the language you're working in.
43 43
44 44 Information about the kernel is stored in the notebook file, so when you open a
45 45 notebook, it will automatically start the correct kernel.
46 46
47 47 It is also easier to use the Qt console and the terminal console with other
48 48 kernels, using the --kernel flag::
49 49
50 50 ipython qtconsole --kernel bash
51 51 ipython console --kernel bash
52 52
53 53 # To list available kernels
54 54 ipython kernelspec list
55 55
56 56 Kernel authors should see :ref:`kernelspecs` for how to register their kernels
57 57 with IPython so that these mechanisms work.
58 58
59 59 Typing unicode identifiers
60 60 --------------------------
61 61
62 62 .. image:: /_images/unicode_completion.png
63 63
64 64 Complex expressions can be much cleaner when written with a wider choice of
65 65 characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier
66 66 to type those, using a feature from Julia. Type a backslash followed by a LaTeX
67 67 style short name, such as ``\alpha``. Press tab, and it will turn into Ξ±.
68 68
69 69 Other new features
70 70 ------------------
71 71
72 72 * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a
73 73 ``placeholder`` attribute, for displaying placeholder text before the
74 74 user has typed anything.
75 75
76 76 * The :magic:`load` magic can now find the source for objects in the user namespace.
77 77 To enable searching the namespace, use the ``-n`` option.
78 78
79 79 .. sourcecode:: ipython
80 80
81 81 In [1]: %load -n my_module.some_function
82 82
83 83 * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle`
84 84 method, which works like ``view.use_dill()``, but causes the ``cloudpickle``
85 85 module from PiCloud's `cloud`__ library to be used rather than dill or the
86 86 builtin pickle module.
87 87
88 88 __ https://pypi.python.org/pypi/cloud
89 89
90 90 * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook`
91 91 as a commandline argument to nbconvert.
92 92
93 93 * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This
94 94 clears the output from IPython notebooks.
95 95
96 96 * New preprocessor for nbconvert that executes all the code cells in a notebook.
97 97 To run a notebook and save its output in a new notebook::
98 98
99 99 ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed
100 100
101 101 * Consecutive stream (stdout/stderr) output is merged into a single output
102 102 in the notebook document.
103 103 Previously, all output messages were preserved as separate output fields in the JSON.
104 104 Now, the same merge is applied to the stored output as the displayed output,
105 105 improving document load time for notebooks with many small outputs.
106 106
107 107 * ``NotebookApp.webapp_settings`` is deprecated and replaced with
108 108 the more informatively named ``NotebookApp.tornado_settings``.
109 109
110 110 * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings
111 111 between the slowest and fastest runs, since this might meant that the multiple
112 112 runs are not independent of one another.
113 113
114 114 * It's now possible to provide mechanisms to integrate IPython with other event
115 115 loops, in addition to the ones we already support. This lets you run GUI code
116 116 in IPython with an interactive prompt, and to embed the IPython
117 117 kernel in GUI applications. See :doc:`/config/eventloops` for details. As part
118 118 of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs
119 119 in :mod:`IPython.lib.inputhook` have been deprecated in favour of
120 120 :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`.
121 121
122 122 * 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.
123 123
124 124 * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been
125 125 added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`,
126 126 but adds a button to explicitly run the interacted-with function, rather than
127 127 doing it automatically for every change of the parameter widgets. This should
128 128 be useful for long-running functions.
129 129
130 130 * 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.
131 131
132 132 * The Notebook application now offers integrated terminals on Unix platforms,
133 133 intended for when it is used on a remote server. To enable these, install
134 134 the ``terminado`` Python package.
135 135
136 136 * The Notebook application can now edit any plain text files, via a full-page CodeMirror instance.
137 137
138 138 * Setting the default highlighting language for nbconvert with the config option
139 139 ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects
140 140 metadata stored in the :ref:`kernel spec <kernelspecs>`.
141 141
142 142 * IPython can now be configured systemwide, with files in :file:`/etc/ipython`
143 143 or :file:`/usr/local/etc/ipython` on Unix systems,
144 144 or :file:`{%PROGRAMDATA%}\\ipython` on Windows.
145 145
146 146 * Added support for configurable user-supplied `Jinja
147 147 <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to
148 148 directories containing template files can be specified via
149 149 ``NotebookApp.extra_template_paths``. User-supplied template directories
150 150 searched first by the notebook, making it possible to replace existing
151 151 templates with your own files.
152 152
153 153 For example, to replace the notebook's built-in ``error.html`` with your own,
154 154 create a directory like ``/home/my_templates`` and put your override template
155 155 at ``/home/my_templates/error.html``. To start the notebook with your custom
156 156 error page enabled, you would run::
157 157
158 158 ipython notebook '--extra_template_paths=["/home/my_templates/"]'
159 159
160 160 It's also possible to override a template while also `inheriting
161 161 <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that
162 162 template, by prepending ``templates/`` to the ``{% extends %}`` target of
163 163 your child template. This is useful when you only want to override a
164 164 specific block of a template. For example, to add additional CSS to the
165 165 built-in ``error.html``, you might create an override that looks like::
166 166
167 167 {% extends "templates/error.html" %}
168 168
169 169 {% block stylesheet %}
170 170 {{super()}}
171 171 <style type="text/css">
172 172 /* My Awesome CSS */
173 173 </style>
174 174 {% endblock %}
175 175
176 176 * Added a widget persistence API. This allows you to persist your notebooks interactive widgets.
177 177 Two levels of control are provided:
178 178 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.
179 179 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.
180 180
181 181 Example code for persisting your widget state to session data::
182 182
183 183 %%javascript
184 184 require(['widgets/js/manager'], function(manager) {
185 185 manager.WidgetManager.set_state_callbacks(function() { // Load
186 186 return JSON.parse(sessionStorage.widgets_state || '{}');
187 187 }, function(state) { // Save
188 188 sessionStorage.widgets_state = JSON.stringify(state);
189 189 });
190 190 });
191 191
192 192 * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no
193 193 arguments displays all environment variables and values. Additionally,
194 194 :magic:`env` can be used to get or set individual environment variables. To
195 195 display an individual value, use the `%env var` syntax. To set a value, use
196 196 `env var val` or `env var=val`. Python value expansion using `$` works as usual.
197 197
198 198
199 199 Backwards incompatible changes
200 200 ------------------------------
201 201
202 202 * The :ref:`message protocol <messaging>` has been updated from version 4 to version 5.
203 203 Adapters are included, so IPython frontends can still talk to kernels that
204 204 implement protocol version 4.
205 205
206 206 * The :ref:`notebook format <nbformat>` has been updated from version 3 to version 4.
207 207 Read-only support for v4 notebooks has been backported to IPython 2.4.
208 208 Notable changes:
209 209
210 210 * heading cells are removed in favor or markdown headings
211 211 * notebook outputs and output messages are more consistent with each other
212 212 * use :func:`IPython.nbformat.read` and :func:`~IPython.nbformat.write`
213 213 to read and write notebook files
214 214 instead of the deprecated :mod:`IPython.nbformat.current` APIs.
215 215
216 216 * :func:`IPython.core.oinspect.getsource` call specification has changed:
217 217
218 218 * `oname` keyword argument has been added for property source formatting
219 219 * `is_binary` keyword argument has been dropped, passing ``True`` had
220 220 previously short-circuited the function to return ``None`` unconditionally
221 221
222 222 * Removed the octavemagic extension: it is now available as ``oct2py.ipython``.
223 223
224 224 * Creating PDFs with LaTeX no longer uses a post processor.
225 225 Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`.
226 226
227 227 * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3.
228 228
229 229 Additional changes:
230 230
231 231 - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`)
232 232 - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less`
233 233 - Set `#header` div `margin-bottom: 0px;`
234 234 - Set `#menus` to `float: left;`
235 235 - Set `#maintoolbar .navbar-text` to `float: none;`
236 236 - Added no-padding convenience class.
237 237 - Set border of #maintoolbar to 0px
238 238
239 239 * Accessing the `container` DOM object when displaying javascript has been
240 240 deprecated in IPython 2.0 in favor of accessing `element`. Starting with
241 241 IPython 3.0 trying to access `container` will raise an error in browser
242 242 javascript console.
243 243
244 244 * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all
245 245 the same functionality.
246 246
247 247 * The NotebookManager and ``/api/notebooks`` service has been replaced by
248 248 a more generic ContentsManager and ``/api/contents`` service,
249 249 which supports all kinds of files.
250 250 * The Dashboard now lists all files, not just notebooks and directories.
251 251 * The ``--script`` hook for saving notebooks to Python scripts is removed,
252 252 use :samp:`ipython nbconvert --to python {notebook}` instead.
253 253
254 254 * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See
255 255 :mod:`rpy2.ipython.rmagic`.
256 256
257 257 * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd`
258 258 no longer accept a ``executable`` parameter. Use the kernelspec machinery instead.
259 259
260 260 * The widget classes have been renamed from `*Widget` to `*`. The old names are
261 261 still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed
262 262 to `IntSlider`.
263 263 * The ContainerWidget was renamed to Box and no longer defaults as a flexible
264 264 box in the web browser. A new FlexBox widget was added, which allows you to
265 265 use the flexible box model.
266 266
267 267 * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate
268 268 `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a
269 269 `channel` key in the message dict, for both send and recv.
270 270
271 271
272 272 Content Security Policy
273 273 ```````````````````````
274 274
275 275 The Content Security Policy is a web standard for adding a layer of security to
276 276 detect and mitigate certain classes of attacks, including Cross Site Scripting
277 277 (XSS) and data injection attacks. This was introduced into the notebook to
278 278 ensure that the IPython Notebook and its APIs (by default) can only be embedded
279 279 in an iframe on the same origin.
280 280
281 281 Override ``headers['Content-Security-Policy']`` within your notebook
282 282 configuration to extend for alternate domains and security settings.::
283 283
284 284 c.NotebookApp.tornado_settings = {
285 285 'headers': {
286 286 'Content-Security-Policy': "frame-ancestors 'self'"
287 287 }
288 288 }
289 289
290 290 Example policies::
291 291
292 292 Content-Security-Policy: default-src 'self' https://*.jupyter.org
293 293
294 294 Matches embeddings on any subdomain of jupyter.org, so long as they are served
295 295 over SSL.
296 296
297 297 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
298 298 ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP::
299 299
300 300 c.NotebookApp.tornado_settings = {
301 301 'headers': {
302 302 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report"
303 303 }
304 304 }
305 305
306 306 It simply provides the CSP report as a warning in IPython's logs. The default
307 307 CSP sets this report-uri relative to the ``base_url`` (not shown above).
308 308
309 309 For a more thorough and accurate guide on Content Security Policies, check out
310 310 `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