Show More
@@ -0,0 +1,272 b'' | |||||
|
1 | ============ | |||
|
2 | 3.x Series | |||
|
3 | ============ | |||
|
4 | ||||
|
5 | ||||
|
6 | Release 3.0b1 | |||
|
7 | ============= | |||
|
8 | ||||
|
9 | Using different kernels | |||
|
10 | ----------------------- | |||
|
11 | ||||
|
12 | .. image:: ../_images/kernel_selector_screenshot.png | |||
|
13 | :alt: Screenshot of 'new' dropdown showing different kernels | |||
|
14 | :align: center | |||
|
15 | ||||
|
16 | You can now choose a kernel for a notebook within the user interface, rather | |||
|
17 | than starting up a separate notebook server for each kernel you want to use. The | |||
|
18 | syntax highlighting adapts to match the language you're working in. | |||
|
19 | ||||
|
20 | Information about the kernel is stored in the notebook file, so when you open a | |||
|
21 | notebook, it will automatically start the correct kernel. | |||
|
22 | ||||
|
23 | It is also easier to use the Qt console and the terminal console with other | |||
|
24 | kernels, using the --kernel flag:: | |||
|
25 | ||||
|
26 | ipython qtconsole --kernel bash | |||
|
27 | ipython console --kernel bash | |||
|
28 | ||||
|
29 | # To list available kernels | |||
|
30 | ipython kernelspec list | |||
|
31 | ||||
|
32 | Kernel authors should see :ref:`kernelspecs` for how to register their kernels | |||
|
33 | with IPython so that these mechanisms work. | |||
|
34 | ||||
|
35 | Typing unicode identifiers | |||
|
36 | -------------------------- | |||
|
37 | ||||
|
38 | .. image:: /_images/unicode_completion.png | |||
|
39 | ||||
|
40 | Complex expressions can be much cleaner when written with a wider choice of | |||
|
41 | characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier | |||
|
42 | to type those, using a feature from Julia. Type a backslash followed by a LaTeX | |||
|
43 | style short name, such as ``\alpha``. Press tab, and it will turn into α. | |||
|
44 | ||||
|
45 | Other new features | |||
|
46 | ------------------ | |||
|
47 | ||||
|
48 | * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a | |||
|
49 | ``placeholder`` attribute, for displaying placeholder text before the | |||
|
50 | user has typed anything. | |||
|
51 | ||||
|
52 | * The :magic:`load` magic can now find the source for objects in the user namespace. | |||
|
53 | To enable searching the namespace, use the ``-n`` option. | |||
|
54 | ||||
|
55 | .. sourcecode:: ipython | |||
|
56 | ||||
|
57 | In [1]: %load -n my_module.some_function | |||
|
58 | ||||
|
59 | * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle` | |||
|
60 | method, which works like ``view.use_dill()``, but causes the ``cloudpickle`` | |||
|
61 | module from PiCloud's `cloud`__ library to be used rather than dill or the | |||
|
62 | builtin pickle module. | |||
|
63 | ||||
|
64 | __ https://pypi.python.org/pypi/cloud | |||
|
65 | ||||
|
66 | * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook` | |||
|
67 | as a commandline argument to nbconvert. | |||
|
68 | ||||
|
69 | * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This | |||
|
70 | clears the output from IPython notebooks. | |||
|
71 | ||||
|
72 | * New preprocessor for nbconvert that executes all the code cells in a notebook. | |||
|
73 | To run a notebook and save its output in a new notebook:: | |||
|
74 | ||||
|
75 | ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed | |||
|
76 | ||||
|
77 | * Consecutive stream (stdout/stderr) output is merged into a single output | |||
|
78 | in the notebook document. | |||
|
79 | Previously, all output messages were preserved as separate output fields in the JSON. | |||
|
80 | Now, the same merge is applied to the stored output as the displayed output, | |||
|
81 | improving document load time for notebooks with many small outputs. | |||
|
82 | ||||
|
83 | * ``NotebookApp.webapp_settings`` is deprecated and replaced with | |||
|
84 | the more informatively named ``NotebookApp.tornado_settings``. | |||
|
85 | ||||
|
86 | * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings | |||
|
87 | between the slowest and fastest runs, since this might meant that the multiple | |||
|
88 | runs are not independent of one another. | |||
|
89 | ||||
|
90 | * It's now possible to provide mechanisms to integrate IPython with other event | |||
|
91 | loops, in addition to the ones we already support. This lets you run GUI code | |||
|
92 | in IPython with an interactive prompt, and to embed the IPython | |||
|
93 | kernel in GUI applications. See :doc:`/config/eventloops` for details. As part | |||
|
94 | of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs | |||
|
95 | in :mod:`IPython.lib.inputhook` have been deprecated in favour of | |||
|
96 | :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`. | |||
|
97 | ||||
|
98 | * 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. | |||
|
99 | ||||
|
100 | * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been | |||
|
101 | added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`, | |||
|
102 | but adds a button to explicitly run the interacted-with function, rather than | |||
|
103 | doing it automatically for every change of the parameter widgets. This should | |||
|
104 | be useful for long-running functions. | |||
|
105 | ||||
|
106 | * 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. | |||
|
107 | ||||
|
108 | * The Notebook application now offers integrated terminals on Unix platforms, | |||
|
109 | intended for when it is used on a remote server. To enable these, install | |||
|
110 | the ``terminado`` Python package. | |||
|
111 | ||||
|
112 | * Setting the default highlighting language for nbconvert with the config option | |||
|
113 | ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects | |||
|
114 | metadata stored in the :ref:`kernel spec <kernelspecs>`. | |||
|
115 | ||||
|
116 | * IPython can now be configured systemwide, with files in :file:`/etc/ipython` | |||
|
117 | or :file:`/usr/local/etc/ipython` on Unix systems, | |||
|
118 | or :file:`{%PROGRAMDATA%}\\ipython` on Windows. | |||
|
119 | ||||
|
120 | * Added support for configurable user-supplied `Jinja | |||
|
121 | <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to | |||
|
122 | directories containing template files can be specified via | |||
|
123 | ``NotebookApp.extra_template_paths``. User-supplied template directories | |||
|
124 | searched first by the notebook, making it possible to replace existing | |||
|
125 | templates with your own files. | |||
|
126 | ||||
|
127 | For example, to replace the notebook's built-in ``error.html`` with your own, | |||
|
128 | create a directory like ``/home/my_templates`` and put your override template | |||
|
129 | at ``/home/my_templates/error.html``. To start the notebook with your custom | |||
|
130 | error page enabled, you would run:: | |||
|
131 | ||||
|
132 | ipython notebook '--extra_template_paths=["/home/my_templates/"]' | |||
|
133 | ||||
|
134 | It's also possible to override a template while also `inheriting | |||
|
135 | <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that | |||
|
136 | template, by prepending ``templates/`` to the ``{% extends %}`` target of | |||
|
137 | your child template. This is useful when you only want to override a | |||
|
138 | specific block of a template. For example, to add additional CSS to the | |||
|
139 | built-in ``error.html``, you might create an override that looks like:: | |||
|
140 | ||||
|
141 | {% extends "templates/error.html" %} | |||
|
142 | ||||
|
143 | {% block stylesheet %} | |||
|
144 | {{super()}} | |||
|
145 | <style type="text/css"> | |||
|
146 | /* My Awesome CSS */ | |||
|
147 | </style> | |||
|
148 | {% endblock %} | |||
|
149 | ||||
|
150 | * Added a widget persistence API. This allows you to persist your notebooks interactive widgets. | |||
|
151 | Two levels of control are provided: | |||
|
152 | 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. | |||
|
153 | 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. | |||
|
154 | ||||
|
155 | Example code for persisting your widget state to session data:: | |||
|
156 | ||||
|
157 | %%javascript | |||
|
158 | require(['widgets/js/manager'], function(manager) { | |||
|
159 | manager.WidgetManager.set_state_callbacks(function() { // Load | |||
|
160 | return JSON.parse(sessionStorage.widgets_state || '{}'); | |||
|
161 | }, function(state) { // Save | |||
|
162 | sessionStorage.widgets_state = JSON.stringify(state); | |||
|
163 | }); | |||
|
164 | }); | |||
|
165 | ||||
|
166 | * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no | |||
|
167 | arguments displays all environment variables and values. Additionally, | |||
|
168 | :magic:`env` can be used to get or set individual environment variables. To | |||
|
169 | display an individual value, use the `%env var` syntax. To set a value, use | |||
|
170 | `env var val` or `env var=val`. Python value expansion using `$` works as usual. | |||
|
171 | ||||
|
172 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. | |||
|
173 | ||||
|
174 | ||||
|
175 | Backwards incompatible changes | |||
|
176 | ------------------------------ | |||
|
177 | ||||
|
178 | * :func:`IPython.core.oinspect.getsource` call specification has changed: | |||
|
179 | ||||
|
180 | * `oname` keyword argument has been added for property source formatting | |||
|
181 | * `is_binary` keyword argument has been dropped, passing ``True`` had | |||
|
182 | previously short-circuited the function to return ``None`` unconditionally | |||
|
183 | ||||
|
184 | * Removed the octavemagic extension: it is now available as ``oct2py.ipython``. | |||
|
185 | ||||
|
186 | * Creating PDFs with LaTeX no longer uses a post processor. | |||
|
187 | Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`. | |||
|
188 | ||||
|
189 | * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3. | |||
|
190 | ||||
|
191 | Additional changes: | |||
|
192 | ||||
|
193 | - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`) | |||
|
194 | - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less` | |||
|
195 | - Set `#header` div `margin-bottom: 0px;` | |||
|
196 | - Set `#menus` to `float: left;` | |||
|
197 | - Set `#maintoolbar .navbar-text` to `float: none;` | |||
|
198 | - Added no-padding convienence class. | |||
|
199 | - Set border of #maintoolbar to 0px | |||
|
200 | ||||
|
201 | * Accessing the `container` DOM object when displaying javascript has been | |||
|
202 | deprecated in IPython 2.0 in favor of accessing `element`. Starting with | |||
|
203 | IPython 3.0 trying to access `container` will raise an error in browser | |||
|
204 | javascript console. | |||
|
205 | ||||
|
206 | * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all | |||
|
207 | the same functionality. | |||
|
208 | ||||
|
209 | * The NotebookManager and ``/api/notebooks`` service has been replaced by | |||
|
210 | a more generic ContentsManager and ``/api/contents`` service, | |||
|
211 | which supports all kinds of files. | |||
|
212 | * The Dashboard now lists all files, not just notebooks and directories. | |||
|
213 | * The ``--script`` hook for saving notebooks to Python scripts is removed, | |||
|
214 | use :samp:`ipython nbconvert --to python {notebook}` instead. | |||
|
215 | ||||
|
216 | * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See | |||
|
217 | :mod:`rpy2.ipython.rmagic`. | |||
|
218 | ||||
|
219 | * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd` | |||
|
220 | no longer accept a ``executable`` parameter. Use the kernelspec machinery instead. | |||
|
221 | ||||
|
222 | * The widget classes have been renamed from `*Widget` to `*`. The old names are | |||
|
223 | still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed | |||
|
224 | to `IntSlider`. | |||
|
225 | * The ContainerWidget was renamed to Box and no longer defaults as a flexible | |||
|
226 | box in the web browser. A new FlexBox widget was added, which allows you to | |||
|
227 | use the flexible box model. | |||
|
228 | ||||
|
229 | * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate | |||
|
230 | `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a | |||
|
231 | `channel` key in the message dict, for both send and recv. | |||
|
232 | ||||
|
233 | ||||
|
234 | Content Security Policy | |||
|
235 | ``````````````````````` | |||
|
236 | ||||
|
237 | The Content Security Policy is a web standard for adding a layer of security to | |||
|
238 | detect and mitigate certain classes of attacks, including Cross Site Scripting | |||
|
239 | (XSS) and data injection attacks. This was introduced into the notebook to | |||
|
240 | ensure that the IPython Notebook and its APIs (by default) can only be embedded | |||
|
241 | in an iframe on the same origin. | |||
|
242 | ||||
|
243 | Override ``headers['Content-Security-Policy']`` within your notebook | |||
|
244 | configuration to extend for alternate domains and security settings.:: | |||
|
245 | ||||
|
246 | c.NotebookApp.tornado_settings = { | |||
|
247 | 'headers': { | |||
|
248 | 'Content-Security-Policy': "frame-ancestors 'self'" | |||
|
249 | } | |||
|
250 | } | |||
|
251 | ||||
|
252 | Example policies:: | |||
|
253 | ||||
|
254 | Content-Security-Policy: default-src 'self' https://*.jupyter.org | |||
|
255 | ||||
|
256 | Matches embeddings on any subdomain of jupyter.org, so long as they are served | |||
|
257 | over SSL. | |||
|
258 | ||||
|
259 | 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 | |||
|
260 | ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP:: | |||
|
261 | ||||
|
262 | c.NotebookApp.tornado_settings = { | |||
|
263 | 'headers': { | |||
|
264 | 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report" | |||
|
265 | } | |||
|
266 | } | |||
|
267 | ||||
|
268 | It simply provides the CSP report as a warning in IPython's logs. The default | |||
|
269 | CSP sets this report-uri relative to the ``base_url`` (not shown above). | |||
|
270 | ||||
|
271 | For a more thorough and accurate guide on Content Security Policies, check out | |||
|
272 | `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples. |
@@ -10,168 +10,6 b' This document describes in-flight development work.' | |||||
10 | conflicts for other Pull Requests). Instead, create a new file in the |
|
10 | conflicts for other Pull Requests). Instead, create a new file in the | |
11 | `docs/source/whatsnew/pr` folder |
|
11 | `docs/source/whatsnew/pr` folder | |
12 |
|
12 | |||
13 | Using different kernels |
|
|||
14 | ----------------------- |
|
|||
15 |
|
||||
16 | .. image:: ../_images/kernel_selector_screenshot.png |
|
|||
17 | :alt: Screenshot of 'new' dropdown showing different kernels |
|
|||
18 | :align: center |
|
|||
19 |
|
||||
20 | You can now choose a kernel for a notebook within the user interface, rather |
|
|||
21 | than starting up a separate notebook server for each kernel you want to use. The |
|
|||
22 | syntax highlighting adapts to match the language you're working in. |
|
|||
23 |
|
||||
24 | Information about the kernel is stored in the notebook file, so when you open a |
|
|||
25 | notebook, it will automatically start the correct kernel. |
|
|||
26 |
|
||||
27 | It is also easier to use the Qt console and the terminal console with other |
|
|||
28 | kernels, using the --kernel flag:: |
|
|||
29 |
|
||||
30 | ipython qtconsole --kernel bash |
|
|||
31 | ipython console --kernel bash |
|
|||
32 |
|
||||
33 | # To list available kernels |
|
|||
34 | ipython kernelspec list |
|
|||
35 |
|
||||
36 | Kernel authors should see :ref:`kernelspecs` for how to register their kernels |
|
|||
37 | with IPython so that these mechanisms work. |
|
|||
38 |
|
||||
39 | Typing unicode identifiers |
|
|||
40 | -------------------------- |
|
|||
41 |
|
||||
42 | .. image:: /_images/unicode_completion.png |
|
|||
43 |
|
||||
44 | Complex expressions can be much cleaner when written with a wider choice of |
|
|||
45 | characters. Python 3 allows unicode identifiers, and IPython 3 makes it easier |
|
|||
46 | to type those, using a feature from Julia. Type a backslash followed by a LaTeX |
|
|||
47 | style short name, such as ``\alpha``. Press tab, and it will turn into α. |
|
|||
48 |
|
||||
49 | Other new features |
|
|||
50 | ------------------ |
|
|||
51 |
|
||||
52 | * :class:`~.TextWidget` and :class:`~.TextareaWidget` objects now include a |
|
|||
53 | ``placeholder`` attribute, for displaying placeholder text before the |
|
|||
54 | user has typed anything. |
|
|||
55 |
|
||||
56 | * The :magic:`load` magic can now find the source for objects in the user namespace. |
|
|||
57 | To enable searching the namespace, use the ``-n`` option. |
|
|||
58 |
|
||||
59 | .. sourcecode:: ipython |
|
|||
60 |
|
||||
61 | In [1]: %load -n my_module.some_function |
|
|||
62 |
|
||||
63 | * :class:`~.DirectView` objects have a new :meth:`~.DirectView.use_cloudpickle` |
|
|||
64 | method, which works like ``view.use_dill()``, but causes the ``cloudpickle`` |
|
|||
65 | module from PiCloud's `cloud`__ library to be used rather than dill or the |
|
|||
66 | builtin pickle module. |
|
|||
67 |
|
||||
68 | __ https://pypi.python.org/pypi/cloud |
|
|||
69 |
|
||||
70 | * Added a .ipynb exporter to nbconvert. It can be used by passing `--to notebook` |
|
|||
71 | as a commandline argument to nbconvert. |
|
|||
72 |
|
||||
73 | * New nbconvert preprocessor called :class:`~.ClearOutputPreprocessor`. This |
|
|||
74 | clears the output from IPython notebooks. |
|
|||
75 |
|
||||
76 | * New preprocessor for nbconvert that executes all the code cells in a notebook. |
|
|||
77 | To run a notebook and save its output in a new notebook:: |
|
|||
78 |
|
||||
79 | ipython nbconvert InputNotebook --ExecutePreprocessor.enabled=True --to notebook --output Executed |
|
|||
80 |
|
||||
81 | * Consecutive stream (stdout/stderr) output is merged into a single output |
|
|||
82 | in the notebook document. |
|
|||
83 | Previously, all output messages were preserved as separate output fields in the JSON. |
|
|||
84 | Now, the same merge is applied to the stored output as the displayed output, |
|
|||
85 | improving document load time for notebooks with many small outputs. |
|
|||
86 |
|
||||
87 | * ``NotebookApp.webapp_settings`` is deprecated and replaced with |
|
|||
88 | the more informatively named ``NotebookApp.tornado_settings``. |
|
|||
89 |
|
||||
90 | * Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings |
|
|||
91 | between the slowest and fastest runs, since this might meant that the multiple |
|
|||
92 | runs are not independent of one another. |
|
|||
93 |
|
||||
94 | * It's now possible to provide mechanisms to integrate IPython with other event |
|
|||
95 | loops, in addition to the ones we already support. This lets you run GUI code |
|
|||
96 | in IPython with an interactive prompt, and to embed the IPython |
|
|||
97 | kernel in GUI applications. See :doc:`/config/eventloops` for details. As part |
|
|||
98 | of this, the direct ``enable_*`` and ``disable_*`` functions for various GUIs |
|
|||
99 | in :mod:`IPython.lib.inputhook` have been deprecated in favour of |
|
|||
100 | :meth:`~.InputHookManager.enable_gui` and :meth:`~.InputHookManager.disable_gui`. |
|
|||
101 |
|
||||
102 | * 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. |
|
|||
103 |
|
||||
104 | * The function :func:`~IPython.html.widgets.interaction.interact_manual` has been |
|
|||
105 | added which behaves similarly to :func:`~IPython.html.widgets.interaction.interact`, |
|
|||
106 | but adds a button to explicitly run the interacted-with function, rather than |
|
|||
107 | doing it automatically for every change of the parameter widgets. This should |
|
|||
108 | be useful for long-running functions. |
|
|||
109 |
|
||||
110 | * 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. |
|
|||
111 |
|
||||
112 | * The Notebook application now offers integrated terminals on Unix platforms, |
|
|||
113 | intended for when it is used on a remote server. To enable these, install |
|
|||
114 | the ``terminado`` Python package. |
|
|||
115 |
|
||||
116 | * Setting the default highlighting language for nbconvert with the config option |
|
|||
117 | ``NbConvertBase.default_language`` is deprecated. Nbconvert now respects |
|
|||
118 | metadata stored in the :ref:`kernel spec <kernelspecs>`. |
|
|||
119 |
|
||||
120 | * IPython can now be configured systemwide, with files in :file:`/etc/ipython` |
|
|||
121 | or :file:`/usr/local/etc/ipython` on Unix systems, |
|
|||
122 | or :file:`{%PROGRAMDATA%}\\ipython` on Windows. |
|
|||
123 |
|
||||
124 | * Added support for configurable user-supplied `Jinja |
|
|||
125 | <http://jinja.pocoo.org/>`_ HTML templates for the notebook. Paths to |
|
|||
126 | directories containing template files can be specified via |
|
|||
127 | ``NotebookApp.extra_template_paths``. User-supplied template directories |
|
|||
128 | searched first by the notebook, making it possible to replace existing |
|
|||
129 | templates with your own files. |
|
|||
130 |
|
||||
131 | For example, to replace the notebook's built-in ``error.html`` with your own, |
|
|||
132 | create a directory like ``/home/my_templates`` and put your override template |
|
|||
133 | at ``/home/my_templates/error.html``. To start the notebook with your custom |
|
|||
134 | error page enabled, you would run:: |
|
|||
135 |
|
||||
136 | ipython notebook '--extra_template_paths=["/home/my_templates/"]' |
|
|||
137 |
|
||||
138 | It's also possible to override a template while also `inheriting |
|
|||
139 | <http://jinja.pocoo.org/docs/dev/templates/#template-inheritance>`_ from that |
|
|||
140 | template, by prepending ``templates/`` to the ``{% extends %}`` target of |
|
|||
141 | your child template. This is useful when you only want to override a |
|
|||
142 | specific block of a template. For example, to add additional CSS to the |
|
|||
143 | built-in ``error.html``, you might create an override that looks like:: |
|
|||
144 |
|
||||
145 | {% extends "templates/error.html" %} |
|
|||
146 |
|
||||
147 | {% block stylesheet %} |
|
|||
148 | {{super()}} |
|
|||
149 | <style type="text/css"> |
|
|||
150 | /* My Awesome CSS */ |
|
|||
151 | </style> |
|
|||
152 | {% endblock %} |
|
|||
153 |
|
||||
154 | * Added a widget persistence API. This allows you to persist your notebooks interactive widgets. |
|
|||
155 | Two levels of control are provided: |
|
|||
156 | 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. |
|
|||
157 | 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. |
|
|||
158 |
|
||||
159 | Example code for persisting your widget state to session data:: |
|
|||
160 |
|
||||
161 | %%javascript |
|
|||
162 | require(['widgets/js/manager'], function(manager) { |
|
|||
163 | manager.WidgetManager.set_state_callbacks(function() { // Load |
|
|||
164 | return JSON.parse(sessionStorage.widgets_state || '{}'); |
|
|||
165 | }, function(state) { // Save |
|
|||
166 | sessionStorage.widgets_state = JSON.stringify(state); |
|
|||
167 | }); |
|
|||
168 | }); |
|
|||
169 |
|
||||
170 | * Enhanced support for :magic:`env` magic. As before, :magic:`env` with no |
|
|||
171 | arguments displays all environment variables and values. Additionally, |
|
|||
172 | :magic:`env` can be used to get or set individual environment variables. To |
|
|||
173 | display an individual value, use the `%env var` syntax. To set a value, use |
|
|||
174 | `env var val` or `env var=val`. Python value expansion using `$` works as usual. |
|
|||
175 |
|
13 | |||
176 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. |
|
14 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. | |
177 |
|
15 | |||
@@ -179,99 +17,7 b' Other new features' | |||||
179 | Backwards incompatible changes |
|
17 | Backwards incompatible changes | |
180 | ------------------------------ |
|
18 | ------------------------------ | |
181 |
|
19 | |||
182 | * :func:`IPython.core.oinspect.getsource` call specification has changed: |
|
|||
183 |
|
||||
184 | * `oname` keyword argument has been added for property source formatting |
|
|||
185 | * `is_binary` keyword argument has been dropped, passing ``True`` had |
|
|||
186 | previously short-circuited the function to return ``None`` unconditionally |
|
|||
187 |
|
||||
188 | * Removed the octavemagic extension: it is now available as ``oct2py.ipython``. |
|
|||
189 |
|
||||
190 | * Creating PDFs with LaTeX no longer uses a post processor. |
|
|||
191 | Use `nbconvert --to pdf` instead of `nbconvert --to latex --post pdf`. |
|
|||
192 |
|
||||
193 | * Used https://github.com/jdfreder/bootstrap2to3 to migrate the Notebook to Bootstrap 3. |
|
|||
194 |
|
||||
195 | Additional changes: |
|
|||
196 |
|
||||
197 | - Set `.tab-content .row` `0px;` left and right margin (bootstrap default is `-15px;`) |
|
|||
198 | - Removed `height: @btn_mini_height;` from `.list_header>div, .list_item>div` in `tree.less` |
|
|||
199 | - Set `#header` div `margin-bottom: 0px;` |
|
|||
200 | - Set `#menus` to `float: left;` |
|
|||
201 | - Set `#maintoolbar .navbar-text` to `float: none;` |
|
|||
202 | - Added no-padding convienence class. |
|
|||
203 | - Set border of #maintoolbar to 0px |
|
|||
204 |
|
||||
205 | * Accessing the `container` DOM object when displaying javascript has been |
|
|||
206 | deprecated in IPython 2.0 in favor of accessing `element`. Starting with |
|
|||
207 | IPython 3.0 trying to access `container` will raise an error in browser |
|
|||
208 | javascript console. |
|
|||
209 |
|
||||
210 | * ``IPython.utils.py3compat.open`` was removed: :func:`io.open` provides all |
|
|||
211 | the same functionality. |
|
|||
212 |
|
||||
213 | * The NotebookManager and ``/api/notebooks`` service has been replaced by |
|
|||
214 | a more generic ContentsManager and ``/api/contents`` service, |
|
|||
215 | which supports all kinds of files. |
|
|||
216 | * The Dashboard now lists all files, not just notebooks and directories. |
|
|||
217 | * The ``--script`` hook for saving notebooks to Python scripts is removed, |
|
|||
218 | use :samp:`ipython nbconvert --to python {notebook}` instead. |
|
|||
219 |
|
||||
220 | * The ``rmagic`` extension is deprecated, as it is now part of rpy2. See |
|
|||
221 | :mod:`rpy2.ipython.rmagic`. |
|
|||
222 |
|
||||
223 | * :meth:`~.KernelManager.start_kernel` and :meth:`~.KernelManager.format_kernel_cmd` |
|
|||
224 | no longer accept a ``executable`` parameter. Use the kernelspec machinery instead. |
|
|||
225 |
|
||||
226 | * The widget classes have been renamed from `*Widget` to `*`. The old names are |
|
|||
227 | still functional, but are deprecated. i.e. `IntSliderWidget` has been renamed |
|
|||
228 | to `IntSlider`. |
|
|||
229 | * The ContainerWidget was renamed to Box and no longer defaults as a flexible |
|
|||
230 | box in the web browser. A new FlexBox widget was added, which allows you to |
|
|||
231 | use the flexible box model. |
|
|||
232 |
|
||||
233 | * The notebook now uses a single websocket at `/kernels/<kernel-id>/channels` instead of separate |
|
|||
234 | `/kernels/<kernel-id>/{shell|iopub|stdin}` channels. Messages on each channel are identified by a |
|
|||
235 | `channel` key in the message dict, for both send and recv. |
|
|||
236 |
|
20 | |||
237 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. |
|
21 | .. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. | |
238 |
|
22 | |||
239 | Content Security Policy |
|
|||
240 | ``````````````````````` |
|
|||
241 |
|
||||
242 | The Content Security Policy is a web standard for adding a layer of security to |
|
|||
243 | detect and mitigate certain classes of attacks, including Cross Site Scripting |
|
|||
244 | (XSS) and data injection attacks. This was introduced into the notebook to |
|
|||
245 | ensure that the IPython Notebook and its APIs (by default) can only be embedded |
|
|||
246 | in an iframe on the same origin. |
|
|||
247 |
|
||||
248 | Override ``headers['Content-Security-Policy']`` within your notebook |
|
|||
249 | configuration to extend for alternate domains and security settings.:: |
|
|||
250 |
|
||||
251 | c.NotebookApp.tornado_settings = { |
|
|||
252 | 'headers': { |
|
|||
253 | 'Content-Security-Policy': "frame-ancestors 'self'" |
|
|||
254 | } |
|
|||
255 | } |
|
|||
256 |
|
||||
257 | Example policies:: |
|
|||
258 |
|
||||
259 | Content-Security-Policy: default-src 'self' https://*.jupyter.org |
|
|||
260 |
|
||||
261 | Matches embeddings on any subdomain of jupyter.org, so long as they are served |
|
|||
262 | over SSL. |
|
|||
263 |
|
||||
264 | 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 |
|
|||
265 | ``/api/security/csp-report``. To use it, set ``report-uri`` as part of the CSP:: |
|
|||
266 |
|
||||
267 | c.NotebookApp.tornado_settings = { |
|
|||
268 | 'headers': { |
|
|||
269 | 'Content-Security-Policy': "frame-ancestors 'self'; report-uri /api/security/csp-report" |
|
|||
270 | } |
|
|||
271 | } |
|
|||
272 |
|
||||
273 | It simply provides the CSP report as a warning in IPython's logs. The default |
|
|||
274 | CSP sets this report-uri relative to the ``base_url`` (not shown above). |
|
|||
275 |
|
|
23 | ||
276 | For a more thorough and accurate guide on Content Security Policies, check out |
|
|||
277 | `MDN's Using Content Security Policy <https://developer.mozilla.org/en-US/docs/Web/Security/CSP/Using_Content_Security_Policy>`_ for more examples. |
|
@@ -3,20 +3,20 b'' | |||||
3 | Issues closed in the 3.x development cycle |
|
3 | Issues closed in the 3.x development cycle | |
4 | ========================================== |
|
4 | ========================================== | |
5 |
|
5 | |||
6 |
Issues closed in 3.0 |
|
6 | Issues closed in 3.0 | |
7 | ---------------------- |
|
7 | ---------------------- | |
8 |
|
8 | |||
9 | GitHub stats for 2014/04/09 - 2015/01/30 |
|
9 | GitHub stats for 2014/04/09 - 2015/01/30 | |
10 |
|
10 | |||
11 | These lists are automatically generated, and may be incomplete or contain duplicates. |
|
11 | These lists are automatically generated, and may be incomplete or contain duplicates. | |
12 |
|
12 | |||
13 |
We closed |
|
13 | We closed 422 issues and merged 869 pull requests. | |
14 |
The full list can be |
|
14 | The full list can be found `on GitHub <https://github.com/ipython/ipython/milestone/3.0>` | |
15 |
|
15 | |||
16 |
The following 15 |
|
16 | The following 152 authors contributed 5697 commits. | |
17 |
|
17 | |||
18 | * Adam Hodgen |
|
18 | * Adam Hodgen | |
19 |
* |
|
19 | * A. J. Holyoake | |
20 | * Amin Bandali |
|
20 | * Amin Bandali | |
21 | * Andreas Amann |
|
21 | * Andreas Amann | |
22 | * Andrew Dawes |
|
22 | * Andrew Dawes | |
@@ -43,12 +43,12 b' The following 157 authors contributed 5697 commits.' | |||||
43 | * Dale Jung |
|
43 | * Dale Jung | |
44 | * Damián Avila |
|
44 | * Damián Avila | |
45 | * Damon Allen |
|
45 | * Damon Allen | |
46 | * damontallen |
|
|||
47 | * Daniel B. Vasquez |
|
46 | * Daniel B. Vasquez | |
48 | * Daniel Wehner |
|
47 | * Daniel Wehner | |
49 | * Dav Clark |
|
48 | * Dav Clark | |
50 | * David Hirschfeld |
|
49 | * David Hirschfeld | |
51 | * David Neto |
|
50 | * David Neto | |
|
51 | * Daniel Rocco | |||
52 | * dexterdev |
|
52 | * dexterdev | |
53 | * Dimitry Kloper |
|
53 | * Dimitry Kloper | |
54 | * dongweiming |
|
54 | * dongweiming | |
@@ -73,7 +73,7 b' The following 157 authors contributed 5697 commits.' | |||||
73 | * James Goppert |
|
73 | * James Goppert | |
74 | * James Porter |
|
74 | * James Porter | |
75 | * Jason Goad |
|
75 | * Jason Goad | |
76 |
* |
|
76 | * Jason Gors | |
77 | * Jason Grout |
|
77 | * Jason Grout | |
78 | * Jason Newton |
|
78 | * Jason Newton | |
79 | * JC |
|
79 | * JC | |
@@ -99,7 +99,6 b' The following 157 authors contributed 5697 commits.' | |||||
99 | * K.-Michael Aye |
|
99 | * K.-Michael Aye | |
100 | * Kalibri |
|
100 | * Kalibri | |
101 | * Kester Tong |
|
101 | * Kester Tong | |
102 | * KesterTong |
|
|||
103 | * Kyle Kelley |
|
102 | * Kyle Kelley | |
104 | * Kyle Rawlins |
|
103 | * Kyle Rawlins | |
105 | * LaptopOfJohn |
|
104 | * LaptopOfJohn | |
@@ -120,7 +119,6 b' The following 157 authors contributed 5697 commits.' | |||||
120 | * Nathaniel J. Smith |
|
119 | * Nathaniel J. Smith | |
121 | * ncornette |
|
120 | * ncornette | |
122 | * Nicholas Bollweg |
|
121 | * Nicholas Bollweg | |
123 | * Nicholas Bollweg (Nick) |
|
|||
124 | * Nick White |
|
122 | * Nick White | |
125 | * Nikolay Koldunov |
|
123 | * Nikolay Koldunov | |
126 | * Nile Geisinger |
|
124 | * Nile Geisinger | |
@@ -145,8 +143,7 b' The following 157 authors contributed 5697 commits.' | |||||
145 | * rgbkrk |
|
143 | * rgbkrk | |
146 | * Richard Everson |
|
144 | * Richard Everson | |
147 | * Scott Sanderson |
|
145 | * Scott Sanderson | |
148 | * Silvia |
|
146 | * Silvia Vinyes | |
149 | * silviav12 |
|
|||
150 | * Simon Guillot |
|
147 | * Simon Guillot | |
151 | * Spencer Nelson |
|
148 | * Spencer Nelson | |
152 | * Stefan Zimmermann |
|
149 | * Stefan Zimmermann | |
@@ -163,7 +160,6 b' The following 157 authors contributed 5697 commits.' | |||||
163 | * Thomas Spura |
|
160 | * Thomas Spura | |
164 | * Tobias Oberstein |
|
161 | * Tobias Oberstein | |
165 | * Torsten Bittner |
|
162 | * Torsten Bittner | |
166 | * U-Jon-PC\Jon |
|
|||
167 | * unknown |
|
163 | * unknown | |
168 | * v923z |
|
164 | * v923z | |
169 | * vaibhavsagar |
|
165 | * vaibhavsagar |
General Comments 0
You need to be logged in to leave comments.
Login now