##// END OF EJS Templates
Pulling in content and rewriting from ipython-in-depth.
Brian E. Granger -
Show More
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -1,9 +1,149 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": ""
4 "signature": "sha256:0abf067a20ebda26a671db997ac954770350d292dff7b7d6a4ace8808f70aca1"
5 },
4 },
6 "nbformat": 3,
5 "nbformat": 3,
7 "nbformat_minor": 0,
6 "nbformat_minor": 0,
8 "worksheets": []
7 "worksheets": [
8 {
9 "cells": [
10 {
11 "cell_type": "heading",
12 "level": 1,
13 "metadata": {},
14 "source": [
15 "Keyboard Shortcut Customization"
16 ]
17 },
18 {
19 "cell_type": "markdown",
20 "metadata": {},
21 "source": [
22 "Starting with IPython 2.0 keyboard shortcuts in command and edit mode are fully customizable. These customizations are made using the IPython JavaScript API. Here is an example that makes the `r` key available for running a cell:"
23 ]
24 },
25 {
26 "cell_type": "code",
27 "collapsed": false,
28 "input": [
29 "%%javascript\n",
30 "\n",
31 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', {\n",
32 " help : 'run cell',\n",
33 " help_index : 'zz',\n",
34 " handler : function (event) {\n",
35 " IPython.notebook.execute_cell();\n",
36 " return false;\n",
37 " }}\n",
38 ");"
39 ],
40 "language": "python",
41 "metadata": {},
42 "outputs": [
43 {
44 "javascript": [
45 "\n",
46 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', {\n",
47 " help : 'run cell',\n",
48 " help_index : 'zz',\n",
49 " handler : function (event) {\n",
50 " IPython.notebook.execute_cell();\n",
51 " return false;\n",
52 " }}\n",
53 ");"
54 ],
55 "metadata": {},
56 "output_type": "display_data",
57 "text": [
58 "<IPython.core.display.Javascript at 0x10e8d1890>"
59 ]
60 }
61 ],
62 "prompt_number": 7
63 },
64 {
65 "cell_type": "markdown",
66 "metadata": {},
67 "source": [
68 "There are a couple of points to mention about this API:\n",
69 "\n",
70 "* The `help_index` field is used to sort the shortcuts in the Keyboard Shortcuts help dialog. It defaults to `zz`.\n",
71 "* When a handler returns `false` it indicates that the event should stop propagating and the default action should not be performed. For further details about the `event` object or event handling, see the jQuery docs.\n",
72 "* If you don't need a `help` or `help_index` field, you can simply pass a function as the second argument to `add_shortcut`."
73 ]
74 },
75 {
76 "cell_type": "code",
77 "collapsed": false,
78 "input": [
79 "%%javascript\n",
80 "\n",
81 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) {\n",
82 " IPython.notebook.execute_cell();\n",
83 " return false;\n",
84 "});"
85 ],
86 "language": "python",
87 "metadata": {},
88 "outputs": [
89 {
90 "javascript": [
91 "\n",
92 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) {\n",
93 " IPython.notebook.execute_cell();\n",
94 " return false;\n",
95 "});"
96 ],
97 "metadata": {},
98 "output_type": "display_data",
99 "text": [
100 "<IPython.core.display.Javascript at 0x1019baf90>"
101 ]
102 }
103 ],
104 "prompt_number": 11
105 },
106 {
107 "cell_type": "markdown",
108 "metadata": {},
109 "source": [
110 "Likewise, to remove a shortcut, use `remove_shortcut`:"
111 ]
112 },
113 {
114 "cell_type": "code",
115 "collapsed": false,
116 "input": [
117 "%%javascript\n",
118 "\n",
119 "IPython.keyboard_manager.command_shortcuts.remove_shortcut('r');"
120 ],
121 "language": "python",
122 "metadata": {},
123 "outputs": [
124 {
125 "javascript": [
126 "\n",
127 "IPython.keyboard_manager.command_shortcuts.remove_shortcut('r');"
128 ],
129 "metadata": {},
130 "output_type": "display_data",
131 "text": [
132 "<IPython.core.display.Javascript at 0x10e8d1950>"
133 ]
134 }
135 ],
136 "prompt_number": 8
137 },
138 {
139 "cell_type": "markdown",
140 "metadata": {},
141 "source": [
142 "If you want your keyboard shortcuts to be active for all of your notebooks, put the above API calls into your `<profile>/static/custom/custom.js` file."
143 ]
144 }
145 ],
146 "metadata": {}
147 }
148 ]
9 } No newline at end of file
149 }
@@ -1,92 +1,85 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:f3479d16d8a60d0aa82e5fbffd52552e5649074a7a660730ddca9d5b286692b2"
4 "signature": "sha256:33a14f36e4dad22b2fc23c59ce0e0ed96719007a09f616f240ed5f665e1b871f"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
8 "worksheets": [
8 "worksheets": [
9 {
9 {
10 "cells": [
10 "cells": [
11 {
11 {
12 "cell_type": "markdown",
12 "cell_type": "markdown",
13 "metadata": {},
13 "metadata": {},
14 "source": [
14 "source": [
15 "<img src=\"../images/ipython_logo.png\">"
15 "<img src=\"../images/ipython_logo.png\">"
16 ]
16 ]
17 },
17 },
18 {
18 {
19 "cell_type": "markdown",
19 "cell_type": "markdown",
20 "metadata": {},
20 "metadata": {},
21 "source": [
21 "source": [
22 "Back to the main [Index](../Index.ipynb)"
22 "Back to the main [Index](../Index.ipynb)"
23 ]
23 ]
24 },
24 },
25 {
25 {
26 "cell_type": "heading",
26 "cell_type": "heading",
27 "level": 1,
27 "level": 1,
28 "metadata": {},
28 "metadata": {},
29 "source": [
29 "source": [
30 "Notebook"
30 "Notebook"
31 ]
31 ]
32 },
32 },
33 {
33 {
34 "cell_type": "markdown",
34 "cell_type": "markdown",
35 "metadata": {},
35 "metadata": {},
36 "source": [
36 "source": [
37 "The IPython Notebook is a web-based interactive computing system that enables users to author documents that include live code, narrative text, LaTeX equations, HTML, images and video. These documents contain a full record of a computation and its results and can be shared on email, [Dropbox](http://dropbox.com), version control systems (like git/[GitHub](http://github.com)) or [nbviewer.ipython.org](http://nbviewer.ipython.org)."
37 "The IPython Notebook is a web-based interactive computing system that enables users to author documents that include live code, narrative text, LaTeX equations, HTML, images and video. These documents contain a full record of a computation and its results and can be shared on email, [Dropbox](http://dropbox.com), version control systems (like git/[GitHub](http://github.com)) or [nbviewer.ipython.org](http://nbviewer.ipython.org)."
38 ]
38 ]
39 },
39 },
40 {
40 {
41 "cell_type": "heading",
41 "cell_type": "heading",
42 "level": 2,
42 "level": 2,
43 "metadata": {},
43 "metadata": {},
44 "source": [
44 "source": [
45 "Tutorials"
45 "Tutorials"
46 ]
46 ]
47 },
47 },
48 {
48 {
49 "cell_type": "markdown",
49 "cell_type": "markdown",
50 "metadata": {},
50 "metadata": {},
51 "source": [
51 "source": [
52 "* [What is the IPython Notebook?](What is the IPython Notebook%3F.ipynb)\n",
52 "* [What is the IPython Notebook?](What is the IPython Notebook%3F.ipynb)\n",
53 "* [Running the Notebook Server](Running the Notebook Server.ipynb)\n",
53 "* [Running the Notebook Server](Running the Notebook Server.ipynb)\n",
54 "* [Notebook Dashboard](Notebook Dashboard.ipynb)\n",
54 "* [Notebook Dashboard](Notebook Dashboard.ipynb)\n",
55 "* [Notebook User Interface](Notebook User Interface.ipynb)\n",
55 "* [Notebook User Interface](Notebook User Interface.ipynb)\n",
56 "* [Notebook Cell Types](Notebook Cell Types.ipynb)\n",
56 "* [Custom Keyboard Shortcuts](Custom Keyboard Shortcuts.ipynb)\n",
57 "* [Working With Code Cells](Working With Code Cells.ipynb)\n",
57 "* [Working With Code Cells](Working With Code Cells.ipynb)\n",
58 "* [Basic Output](Basic Output.ipynb)\n",
58 "* [Working With Markdown Cells](Working With Markdown Cells.ipynb)\n",
59 "* [Working With Markdown Cells](Working With Markdown Cells.ipynb)\n",
60 "* [JavaScript Notebook Extensions](JavaScript Notebook Extensions.ipynb)\n",
59 "* [Notebook Security](Notebook Security.ipynb)"
61 "* [Notebook Security](Notebook Security.ipynb)"
60 ]
62 ]
61 },
63 },
62 {
64 {
63 "cell_type": "heading",
65 "cell_type": "heading",
64 "level": 2,
66 "level": 2,
65 "metadata": {},
67 "metadata": {},
66 "source": [
68 "source": [
67 "Examples"
69 "Examples"
68 ]
70 ]
69 },
71 },
70 {
72 {
71 "cell_type": "markdown",
73 "cell_type": "markdown",
72 "metadata": {},
74 "metadata": {},
73 "source": [
75 "source": [
74 "* [Custom Keyboard Shortcuts](Custom Keyboard Shortcuts.ipynb)\n",
75 "* [Importing Notebooks](Importing Notebooks.ipynb)\n",
76 "* [Importing Notebooks](Importing Notebooks.ipynb)\n",
76 "* [Connecting with the Qt Console](Connecting with the Qt Console.ipynb)\n",
77 "* [Connecting with the Qt Console](Connecting with the Qt Console.ipynb)\n",
77 "* [Typesetting Equations](Typesetting Equations.ipynb)"
78 "* [Typesetting Equations](Typesetting Equations.ipynb)"
78 ]
79 ]
79 },
80 {
81 "cell_type": "code",
82 "collapsed": false,
83 "input": [],
84 "language": "python",
85 "metadata": {},
86 "outputs": []
87 }
80 }
88 ],
81 ],
89 "metadata": {}
82 "metadata": {}
90 }
83 }
91 ]
84 ]
92 } No newline at end of file
85 }
@@ -1,445 +1,244 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": ""
3 "name": "",
4 "signature": "sha256:fdeb47a733910a12406e6a2e4f13c2c76fe50b19428feb6ba77c06652fb1d6af"
4 },
5 },
5 "nbformat": 3,
6 "nbformat": 3,
6 "nbformat_minor": 0,
7 "nbformat_minor": 0,
7 "worksheets": [
8 "worksheets": [
8 {
9 {
9 "cells": [
10 "cells": [
10 {
11 {
11 "cell_type": "heading",
12 "cell_type": "heading",
12 "level": 1,
13 "level": 1,
13 "metadata": {},
14 "metadata": {},
14 "source": [
15 "source": [
15 "User Interface"
16 "Notebook User Interface"
16 ]
17 ]
17 },
18 },
18 {
19 {
19 "cell_type": "markdown",
20 "cell_type": "markdown",
20 "metadata": {},
21 "metadata": {},
21 "source": [
22 "source": [
22 "This notebook describes the user interface of the IPython Notebook. This includes both mouse and keyboard based navigation and interaction.\n",
23 "This notebook describes the user interface of the IPython Notebook. This includes both mouse and keyboard based navigation and interaction."
23 "\n",
24 ]
24 "<div class=\"alert\" style=\"margin: 10px\">\n",
25 },
26 {
27 "cell_type": "markdown",
28 "metadata": {},
29 "source": [
30 "<div class=\"alert\">\n",
25 "As of IPython 2.0, the user interface has changed significantly. Because of this we highly recommend existing users to review this information after upgrading to IPython 2.0. All new users of IPython should review this information as well.\n",
31 "As of IPython 2.0, the user interface has changed significantly. Because of this we highly recommend existing users to review this information after upgrading to IPython 2.0. All new users of IPython should review this information as well.\n",
26 "</div>"
32 "</div>"
27 ]
33 ]
28 },
34 },
29 {
35 {
30 "cell_type": "heading",
36 "cell_type": "heading",
31 "level": 2,
37 "level": 2,
32 "metadata": {},
38 "metadata": {},
33 "source": [
39 "source": [
40 "Overview of the UI"
41 ]
42 },
43 {
44 "cell_type": "markdown",
45 "metadata": {},
46 "source": [
47 "The notebook UI has the following main areas:\n",
48 "\n",
49 "* Menu\n",
50 "* Toolbar\n",
51 "* Notebook area and cells\n",
52 "\n",
53 "IPython 2.0 has an interactive tour of these elements that can be started in the \"Help:User Interface Tour\" menu item."
54 ]
55 },
56 {
57 "cell_type": "heading",
58 "level": 2,
59 "metadata": {},
60 "source": [
34 "Modal editor"
61 "Modal editor"
35 ]
62 ]
36 },
63 },
37 {
64 {
38 "cell_type": "markdown",
65 "cell_type": "markdown",
39 "metadata": {},
66 "metadata": {},
40 "source": [
67 "source": [
41 "Starting with IPython 2.0, the IPython Notebook has a modal user interface. This means that the keyboard does different things depending on which mode the Notebook is in. There are two modes: edit mode and command mode."
68 "Starting with IPython 2.0, the IPython Notebook has a modal user interface. This means that the keyboard does different things depending on which mode the Notebook is in. There are two modes: edit mode and command mode."
42 ]
69 ]
43 },
70 },
44 {
71 {
45 "cell_type": "heading",
72 "cell_type": "heading",
46 "level": 3,
73 "level": 3,
47 "metadata": {},
74 "metadata": {},
48 "source": [
75 "source": [
49 "Edit mode"
76 "Edit mode"
50 ]
77 ]
51 },
78 },
52 {
79 {
53 "cell_type": "markdown",
80 "cell_type": "markdown",
54 "metadata": {},
81 "metadata": {},
55 "source": [
82 "source": [
56 "Edit mode is indicated by a green cell border and a prompt showing in the editor area:\n",
83 "Edit mode is indicated by a green cell border and a prompt showing in the editor area:\n",
57 "\n",
84 "\n",
58 "<img src=\"images/edit_mode.png\">\n",
85 "<img src=\"images/edit_mode.png\">\n",
59 "\n",
86 "\n",
60 "When a cell is in edit mode, you can type into the cell, like a normal text editor.\n",
87 "When a cell is in edit mode, you can type into the cell, like a normal text editor."
61 "\n",
88 ]
62 "<div class=\"alert alert-success\" style=\"margin: 10px\">\n",
89 },
63 "Enter edit mode by pressing `enter` or using the mouse to click on a cell's editor area.\n",
90 {
91 "cell_type": "markdown",
92 "metadata": {},
93 "source": [
94 "<div class=\"alert alert-success\">\n",
95 "Enter edit mode by pressing `Enter` or using the mouse to click on a cell's editor area.\n",
64 "</div>"
96 "</div>"
65 ]
97 ]
66 },
98 },
67 {
99 {
68 "cell_type": "heading",
100 "cell_type": "heading",
69 "level": 3,
101 "level": 3,
70 "metadata": {},
102 "metadata": {},
71 "source": [
103 "source": [
72 "Command mode"
104 "Command mode"
73 ]
105 ]
74 },
106 },
75 {
107 {
76 "cell_type": "markdown",
108 "cell_type": "markdown",
77 "metadata": {},
109 "metadata": {},
78 "source": [
110 "source": [
79 "Command mode is indicated by a grey cell border:\n",
111 "Command mode is indicated by a grey cell border:\n",
80 "\n",
112 "\n",
81 "<img src=\"images/command_mode.png\">\n",
113 "<img src=\"images/command_mode.png\">\n",
82 "\n",
114 "\n",
83 "When you are in command mode, you are able to edit the notebook as a whole, but not type into individual cells. Most importantly, in command mode, the keyboard is mapped to a set of shortcuts that let you perform notebook and cell actions efficiently. For example, if you are in command mode and you press `c`, you will copy the current cell - no modifier is needed.\n",
115 "When you are in command mode, you are able to edit the notebook as a whole, but not type into individual cells. Most importantly, in command mode, the keyboard is mapped to a set of shortcuts that let you perform notebook and cell actions efficiently. For example, if you are in command mode and you press `c`, you will copy the current cell - no modifier is needed."
84 "\n",
116 ]
85 "<div class=\"alert alert-error\" style=\"margin: 10px\">\n",
117 },
118 {
119 "cell_type": "markdown",
120 "metadata": {},
121 "source": [
122 "<div class=\"alert alert-error\">\n",
86 "Don't try to type into a cell in command mode; unexpected things will happen!\n",
123 "Don't try to type into a cell in command mode; unexpected things will happen!\n",
87 "</div>\n",
124 "</div>"
88 "\n",
125 ]
89 "<div class=\"alert alert-success\" style=\"margin: 10px\">\n",
126 },
90 "Enter command mode by pressing `esc` or using the mouse to click *outside* a cell's editor area.\n",
127 {
128 "cell_type": "markdown",
129 "metadata": {},
130 "source": [
131 "<div class=\"alert alert-success\">\n",
132 "Enter command mode by pressing `Esc` or using the mouse to click *outside* a cell's editor area.\n",
91 "</div>"
133 "</div>"
92 ]
134 ]
93 },
135 },
94 {
136 {
95 "cell_type": "heading",
137 "cell_type": "heading",
96 "level": 2,
138 "level": 2,
97 "metadata": {},
139 "metadata": {},
98 "source": [
140 "source": [
99 "Mouse navigation"
141 "Mouse navigation"
100 ]
142 ]
101 },
143 },
102 {
144 {
103 "cell_type": "markdown",
145 "cell_type": "markdown",
104 "metadata": {},
146 "metadata": {},
105 "source": [
147 "source": [
106 "All navigation and actions in the Notebook are available using the mouse through the menubar and toolbar, which are both above the main Notebook area:\n",
148 "All navigation and actions in the Notebook are available using the mouse through the menubar and toolbar, which are both above the main Notebook area:\n",
107 "\n",
149 "\n",
108 "<img src=\"images/menubar_toolbar.png\">"
150 "<img src=\"images/menubar_toolbar.png\">"
109 ]
151 ]
110 },
152 },
111 {
153 {
112 "cell_type": "markdown",
154 "cell_type": "markdown",
113 "metadata": {},
155 "metadata": {},
114 "source": [
156 "source": [
115 "The first idea of mouse based navigation is that **cells can be selected by clicking on them.** The currently selected cell gets a grey or green border depending on whether the notebook is in edit or command mode. If you click inside a cell's editor area, you will enter edit mode. If you click on the prompt or output area of a cell you will enter command mode.\n",
157 "The first idea of mouse based navigation is that **cells can be selected by clicking on them.** The currently selected cell gets a grey or green border depending on whether the notebook is in edit or command mode. If you click inside a cell's editor area, you will enter edit mode. If you click on the prompt or output area of a cell you will enter command mode.\n",
116 "\n",
158 "\n",
117 "If you are running this notebook in a live session (not on http://nbviewer.ipython.org) try selecting different cells and going between edit and command mode. Try typing into a cell."
159 "If you are running this notebook in a live session (not on http://nbviewer.ipython.org) try selecting different cells and going between edit and command mode. Try typing into a cell."
118 ]
160 ]
119 },
161 },
120 {
162 {
121 "cell_type": "markdown",
163 "cell_type": "markdown",
122 "metadata": {},
164 "metadata": {},
123 "source": [
165 "source": [
124 "The second idea of mouse based navigation is that **cell actions usually apply to the currently selected cell**. Thus if you want to run the code in a cell, you would select it and click the \"Play\" button in the toolbar or the \"Cell:Run\" menu item. Similarly, to copy a cell you would select it and click the \"Copy\" button in the toolbar or the \"Edit:Copy\" menu item. With this simple pattern, you should be able to do most everything you need with the mouse.\n",
166 "The second idea of mouse based navigation is that **cell actions usually apply to the currently selected cell**. Thus if you want to run the code in a cell, you would select it and click the <button><i class=\"icon-play\"></i></button> button in the toolbar or the \"Cell:Run\" menu item. Similarly, to copy a cell you would select it and click the <button><i class=\"icon-copy\"></i></button> button in the toolbar or the \"Edit:Copy\" menu item. With this simple pattern, you should be able to do most everything you need with the mouse.\n",
125 "\n",
167 "\n",
126 "Markdown and heading cells have one other state that can be modified with the mouse. These cells can either be rendered or unrendered. When they are rendered, you will see a nice formatted representation of the cell's contents. When they are unrendered, you will see the raw text source of the cell. To render the selected cell with the mouse, click the \"Play\" button in the toolbar or the \"Cell:Run\" menu item. To unrender the selected cell, double click on the cell."
168 "Markdown and heading cells have one other state that can be modified with the mouse. These cells can either be rendered or unrendered. When they are rendered, you will see a nice formatted representation of the cell's contents. When they are unrendered, you will see the raw text source of the cell. To render the selected cell with the mouse, click the <button><i class=\"icon-play\"></i></button> button in the toolbar or the \"Cell:Run\" menu item. To unrender the selected cell, double click on the cell."
127 ]
169 ]
128 },
170 },
129 {
171 {
130 "cell_type": "heading",
172 "cell_type": "heading",
131 "level": 2,
173 "level": 2,
132 "metadata": {},
174 "metadata": {},
133 "source": [
175 "source": [
134 "Keyboard Navigation"
176 "Keyboard Navigation"
135 ]
177 ]
136 },
178 },
137 {
179 {
138 "cell_type": "markdown",
180 "cell_type": "markdown",
139 "metadata": {},
181 "metadata": {},
140 "source": [
182 "source": [
141 "The modal user interface of the IPython Notebook has been optimized for efficient keyboard usage. This is made possible by having two different sets of keyboard shortcuts: one set that is active in edit mode and another in command mode.\n",
183 "The modal user interface of the IPython Notebook has been optimized for efficient keyboard usage. This is made possible by having two different sets of keyboard shortcuts: one set that is active in edit mode and another in command mode.\n",
142 "\n",
184 "\n",
143 "The most important keyboard shortcuts are `enter`, which enters edit mode, and `esc`, which enters command mode.\n",
185 "The most important keyboard shortcuts are `Enter`, which enters edit mode, and `Esc`, which enters command mode.\n",
144 "\n",
186 "\n",
145 "In edit mode, most of the keyboard is dedicated to typing into the cell's editor. Thus, in edit mode there are relatively few shortcuts:"
187 "In edit mode, most of the keyboard is dedicated to typing into the cell's editor. Thus, in edit mode there are relatively few shortcuts:\n",
146 ]
147 },
148 {
149 "cell_type": "markdown",
150 "metadata": {},
151 "source": [
152 "The `display_edit_shortcuts()` function used here is defined in the [Utilities section](#Utilities) at the bottom of this notebook."
153 ]
154 },
155 {
156 "cell_type": "code",
157 "collapsed": false,
158 "input": [
159 "display_edit_shortcuts()"
160 ],
161 "language": "python",
162 "metadata": {},
163 "outputs": [
164 {
165 "html": [
166 "<div class=\"hbox\"><div class=\"box-flex0\"><div class=\"quickhelp\"><span class=\"shortcut_key\">esc</span><span class=\"shortcut_descr\"> : command mode</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">ctrl+m</span><span class=\"shortcut_descr\"> : command mode</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">shift+enter</span><span class=\"shortcut_descr\"> : run cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">ctrl+enter</span><span class=\"shortcut_descr\"> : run cell, select below</span></div></div><div class=\"box-flex0\"><div class=\"quickhelp\"><span class=\"shortcut_key\">alt+enter</span><span class=\"shortcut_descr\"> : run cell, insert below</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">alt+-</span><span class=\"shortcut_descr\"> : split cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">meta+s</span><span class=\"shortcut_descr\"> : save notebook</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">ctrl+s</span><span class=\"shortcut_descr\"> : save notebook</span></div></div></div>"
167 ],
168 "output_type": "display_data"
169 },
170 {
171 "javascript": [
172 "var help = IPython.quick_help.build_edit_help();\n",
173 "help.children().first().remove();\n",
174 "this.append_output({output_type: 'display_data', html: help.html()});"
175 ],
176 "metadata": {},
177 "output_type": "display_data",
178 "text": [
179 "<IPython.core.display.Javascript at 0x10e8d1a50>"
180 ]
181 }
182 ],
183 "prompt_number": 17
184 },
185 {
186 "cell_type": "markdown",
187 "metadata": {},
188 "source": [
189 "There are two other keyboard shortcuts in edit mode that are not listed here:\n",
190 "\n",
188 "\n",
191 "* `tab`: trigger \"tab\" completion\n",
189 "<img src=\"images/edit_shortcuts.png\">"
192 "* `shift+tab`: open the tooltip"
193 ]
190 ]
194 },
191 },
195 {
192 {
196 "cell_type": "markdown",
193 "cell_type": "markdown",
197 "metadata": {},
194 "metadata": {},
198 "source": [
195 "source": [
199 "In command mode, the entire keyboard is available for shortcuts:"
196 "In command mode, the entire keyboard is available for shortcuts, so there are many more:\n",
197 "\n",
198 "<img src=\"images/command_shortcuts.png\">"
200 ]
199 ]
201 },
200 },
202 {
201 {
203 "cell_type": "code",
204 "collapsed": false,
205 "input": [
206 "display_command_shortcuts()"
207 ],
208 "language": "python",
209 "metadata": {},
210 "outputs": [
211 {
212 "html": [
213 "<div class=\"hbox\"><div class=\"box-flex0\"><div class=\"quickhelp\"><span class=\"shortcut_key\">enter</span><span class=\"shortcut_descr\"> : edit mode</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">shift+enter</span><span class=\"shortcut_descr\"> : run cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">ctrl+enter</span><span class=\"shortcut_descr\"> : run cell, select below</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">alt+enter</span><span class=\"shortcut_descr\"> : run cell, insert below</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">y</span><span class=\"shortcut_descr\"> : to code</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">m</span><span class=\"shortcut_descr\"> : to markdown</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">t</span><span class=\"shortcut_descr\"> : to raw</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">1</span><span class=\"shortcut_descr\"> : to heading 1</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">2</span><span class=\"shortcut_descr\"> : to heading 2</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">3</span><span class=\"shortcut_descr\"> : to heading 3</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">4</span><span class=\"shortcut_descr\"> : to heading 4</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">5</span><span class=\"shortcut_descr\"> : to heading 5</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">6</span><span class=\"shortcut_descr\"> : to heading 6</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">up</span><span class=\"shortcut_descr\"> : select previous cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">down</span><span class=\"shortcut_descr\"> : select next cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">k</span><span class=\"shortcut_descr\"> : select previous cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">j</span><span class=\"shortcut_descr\"> : select next cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">ctrl+k</span><span class=\"shortcut_descr\"> : move cell up</span></div></div><div class=\"box-flex0\"><div class=\"quickhelp\"><span class=\"shortcut_key\">ctrl+j</span><span class=\"shortcut_descr\"> : move cell down</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">a</span><span class=\"shortcut_descr\"> : insert cell above</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">b</span><span class=\"shortcut_descr\"> : insert cell below</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">x</span><span class=\"shortcut_descr\"> : cut cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">c</span><span class=\"shortcut_descr\"> : copy cell</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">v</span><span class=\"shortcut_descr\"> : paste cell below</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">z</span><span class=\"shortcut_descr\"> : undo last delete</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">d</span><span class=\"shortcut_descr\"> : delete cell (press twice)</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">shift+=</span><span class=\"shortcut_descr\"> : merge cell below</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">s</span><span class=\"shortcut_descr\"> : save notebook</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">meta+s</span><span class=\"shortcut_descr\"> : save notebook</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">ctrl+s</span><span class=\"shortcut_descr\"> : save notebook</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">l</span><span class=\"shortcut_descr\"> : toggle line numbers</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">o</span><span class=\"shortcut_descr\"> : toggle output</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">shift+o</span><span class=\"shortcut_descr\"> : toggle output</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">h</span><span class=\"shortcut_descr\"> : keyboard shortcuts</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">i</span><span class=\"shortcut_descr\"> : interrupt kernel</span></div><div class=\"quickhelp\"><span class=\"shortcut_key\">.</span><span class=\"shortcut_descr\"> : restart kernel</span></div></div></div>"
214 ],
215 "output_type": "display_data"
216 },
217 {
218 "javascript": [
219 "var help = IPython.quick_help.build_command_help();\n",
220 "help.children().first().remove();\n",
221 "this.append_output({output_type: 'display_data', html: help.html()});"
222 ],
223 "metadata": {},
224 "output_type": "display_data",
225 "text": [
226 "<IPython.core.display.Javascript at 0x10e8d1650>"
227 ]
228 }
229 ],
230 "prompt_number": 18
231 },
232 {
233 "cell_type": "markdown",
202 "cell_type": "markdown",
234 "metadata": {},
203 "metadata": {},
235 "source": [
204 "source": [
236 "Here the rough order in which we recommend learning the command mode shortcuts:\n",
205 "We recommend learning the command mode shortcuts in the following rough order:\n",
237 "\n",
206 "\n",
238 "1. Basic navigation: `enter`, `shift-enter`, `up/k`, `down/j`\n",
207 "1. Basic navigation: `enter`, `shift-enter`, `up/k`, `down/j`\n",
239 "2. Saving the notebook: `s`\n",
208 "2. Saving the notebook: `s`\n",
240 "2. Cell types: `y`, `m`, `1-6`, `t`\n",
209 "2. Cell types: `y`, `m`, `1-6`, `t`\n",
241 "3. Cell creation and movement: `a`, `b`, `ctrl+k`, `ctrl+j`\n",
210 "3. Cell creation and movement: `a`, `b`, `ctrl+k`, `ctrl+j`\n",
242 "4. Cell editing: `x`, `c`, `v`, `d`, `z`, `shift+=`\n",
211 "4. Cell editing: `x`, `c`, `v`, `d`, `z`, `shift+=`\n",
243 "5. Kernel operations: `i`, `.`"
212 "5. Kernel operations: `i`, `.`"
244 ]
213 ]
245 },
214 },
246 {
215 {
247 "cell_type": "heading",
216 "cell_type": "heading",
248 "level": 2,
217 "level": 2,
249 "metadata": {},
218 "metadata": {},
250 "source": [
219 "source": [
251 "Keyboard shortcut customization"
220 "Cell types"
252 ]
221 ]
253 },
222 },
254 {
223 {
255 "cell_type": "markdown",
224 "cell_type": "markdown",
256 "metadata": {},
225 "metadata": {},
257 "source": [
226 "source": [
258 "Starting with IPython 2.0 keyboard shortcuts in command and edit mode are fully customizable. These customizations are made using the IPython JavaScript API. Here is an example that makes the `r` key available for running a cell:"
227 "The notebook UI and notebook documents are a linear sequence of cells. There are four cell types:\n",
259 ]
260 },
261 {
262 "cell_type": "code",
263 "collapsed": false,
264 "input": [
265 "%%javascript\n",
266 "\n",
228 "\n",
267 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', {\n",
229 "* **Code cells:** Input and output of live code that is run in the kernel\n",
268 " help : 'run cell',\n",
230 "* **Markdown cells:** Narrative text with embedded LaTeX equations\n",
269 " help_index : 'zz',\n",
231 "* **Heading cells:** 6 levels of hierarchical organization and formatting\n",
270 " handler : function (event) {\n",
232 "* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n",
271 " IPython.notebook.execute_cell();\n",
272 " return false;\n",
273 " }}\n",
274 ");"
275 ],
276 "language": "python",
277 "metadata": {},
278 "outputs": [
279 {
280 "javascript": [
281 "\n",
282 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', {\n",
283 " help : 'run cell',\n",
284 " help_index : 'zz',\n",
285 " handler : function (event) {\n",
286 " IPython.notebook.execute_cell();\n",
287 " return false;\n",
288 " }}\n",
289 ");"
290 ],
291 "metadata": {},
292 "output_type": "display_data",
293 "text": [
294 "<IPython.core.display.Javascript at 0x10e8d1890>"
295 ]
296 }
297 ],
298 "prompt_number": 7
299 },
300 {
301 "cell_type": "markdown",
302 "metadata": {},
303 "source": [
304 "There are a couple of points to mention about this API:\n",
305 "\n",
233 "\n",
306 "* The `help_index` field is used to sort the shortcuts in the Keyboard Shortcuts help dialog. It defaults to `zz`.\n",
234 "More information about code and Markdown cell can be found in these tutorials:\n",
307 "* When a handler returns `false` it indicates that the event should stop propagating and the default action should not be performed. For further details about the `event` object or event handling, see the jQuery docs.\n",
308 "* If you don't need a `help` or `help_index` field, you can simply pass a function as the second argument to `add_shortcut`."
309 ]
310 },
311 {
312 "cell_type": "code",
313 "collapsed": false,
314 "input": [
315 "%%javascript\n",
316 "\n",
235 "\n",
317 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) {\n",
236 "* [Working With Code Cells](Working With Code Cells.ipynb)\n",
318 " IPython.notebook.execute_cell();\n",
237 "* [Working With Markdown Cells](Working With Markdown Cells.ipynb)"
319 " return false;\n",
320 "});"
321 ],
322 "language": "python",
323 "metadata": {},
324 "outputs": [
325 {
326 "javascript": [
327 "\n",
328 "IPython.keyboard_manager.command_shortcuts.add_shortcut('r', function (event) {\n",
329 " IPython.notebook.execute_cell();\n",
330 " return false;\n",
331 "});"
332 ],
333 "metadata": {},
334 "output_type": "display_data",
335 "text": [
336 "<IPython.core.display.Javascript at 0x1019baf90>"
337 ]
338 }
339 ],
340 "prompt_number": 11
341 },
342 {
343 "cell_type": "markdown",
344 "metadata": {},
345 "source": [
346 "Likewise, to remove a shortcut, use `remove_shortcut`:"
347 ]
238 ]
348 },
349 {
350 "cell_type": "code",
351 "collapsed": false,
352 "input": [
353 "%%javascript\n",
354 "\n",
355 "IPython.keyboard_manager.command_shortcuts.remove_shortcut('r');"
356 ],
357 "language": "python",
358 "metadata": {},
359 "outputs": [
360 {
361 "javascript": [
362 "\n",
363 "IPython.keyboard_manager.command_shortcuts.remove_shortcut('r');"
364 ],
365 "metadata": {},
366 "output_type": "display_data",
367 "text": [
368 "<IPython.core.display.Javascript at 0x10e8d1950>"
369 ]
370 }
371 ],
372 "prompt_number": 8
373 },
374 {
375 "cell_type": "markdown",
376 "metadata": {},
377 "source": [
378 "If you want your keyboard shortcuts to be active for all of your notebooks, put the above API calls into your `<profile>/static/custom/custom.js` file."
379 ]
380 },
381 {
382 "cell_type": "heading",
383 "level": 2,
384 "metadata": {},
385 "source": [
386 "Utilities"
387 ]
388 },
389 {
390 "cell_type": "markdown",
391 "metadata": {},
392 "source": [
393 "We use the following functions to generate the keyboard shortcut listings above."
394 ]
395 },
396 {
397 "cell_type": "code",
398 "collapsed": false,
399 "input": [
400 "from IPython.display import Javascript, display, HTML\n",
401 "\n",
402 "t = \"\"\"var help = IPython.quick_help.build_{0}_help();\n",
403 "help.children().first().remove();\n",
404 "this.append_output({{output_type: 'display_data', html: help.html()}});\"\"\"\n",
405 "\n",
406 "def display_command_shortcuts():\n",
407 " display(Javascript(t.format('command')))\n",
408 "\n",
409 "def display_edit_shortcuts():\n",
410 " display(Javascript(t.format('edit')))\n",
411 "\n",
412 "display(HTML(\"\"\"\n",
413 "<style>\n",
414 ".shortcut_key {display: inline-block; width: 15ex; text-align: right; font-family: monospace;}\n",
415 ".shortcut_descr {display: inline-block;}\n",
416 "div.quickhelp {float: none; width: 100%;}\n",
417 "</style>\n",
418 "\"\"\"))"
419 ],
420 "language": "python",
421 "metadata": {},
422 "outputs": [
423 {
424 "html": [
425 "\n",
426 "<style>\n",
427 ".shortcut_key {display: inline-block; width: 15ex; text-align: right; font-family: monospace;}\n",
428 ".shortcut_descr {display: inline-block;}\n",
429 "div.quickhelp {float: none; width: 100%;}\n",
430 "</style>\n"
431 ],
432 "metadata": {},
433 "output_type": "display_data",
434 "text": [
435 "<IPython.core.display.HTML at 0x10e8b0710>"
436 ]
437 }
438 ],
439 "prompt_number": 16
440 }
239 }
441 ],
240 ],
442 "metadata": {}
241 "metadata": {}
443 }
242 }
444 ]
243 ]
445 } No newline at end of file
244 }
@@ -1,129 +1,129 b''
1 {
1 {
2 "metadata": {
2 "metadata": {
3 "name": "",
3 "name": "",
4 "signature": "sha256:3676a017d63581291cf2d61ea56d09cb3e5480a4f222184d8216e3e829eb4871"
4 "signature": "sha256:1fd1c67d342de34c5edf43789ce56f80963eda3662752e7d9cbc97ac54848be8"
5 },
5 },
6 "nbformat": 3,
6 "nbformat": 3,
7 "nbformat_minor": 0,
7 "nbformat_minor": 0,
8 "worksheets": [
8 "worksheets": [
9 {
9 {
10 "cells": [
10 "cells": [
11 {
11 {
12 "cell_type": "heading",
12 "cell_type": "heading",
13 "level": 1,
13 "level": 1,
14 "metadata": {},
14 "metadata": {},
15 "source": [
15 "source": [
16 "What is the IPython Notebook?"
16 "What is the IPython Notebook?"
17 ]
17 ]
18 },
18 },
19 {
19 {
20 "cell_type": "heading",
20 "cell_type": "heading",
21 "level": 2,
21 "level": 2,
22 "metadata": {},
22 "metadata": {},
23 "source": [
23 "source": [
24 "Introduction"
24 "Introduction"
25 ]
25 ]
26 },
26 },
27 {
27 {
28 "cell_type": "markdown",
28 "cell_type": "markdown",
29 "metadata": {},
29 "metadata": {},
30 "source": [
30 "source": [
31 "The IPython Notebook is an interactive computing environment that enables users to author notebook documents that include live code, interactive widgets, plots, narrative text, equations, images and video. These documents provide a complete and self-contained record of a computation that can be converted to various formats and shared with others using email, [Dropbox](http://dropbox.com), version control systems (like git/[GitHub](http://github.com)) or [nbviewer.ipython.org](http://nbviewer.ipython.org).\n",
31 "The IPython Notebook is an interactive computing environment that enables users to author notebook documents that include live code, interactive widgets, plots, narrative text, equations, images and video. These documents provide a complete and self-contained record of a computation that can be converted to various formats and shared with others using email, [Dropbox](http://dropbox.com), version control systems (like git/[GitHub](http://github.com)) or [nbviewer.ipython.org](http://nbviewer.ipython.org).\n",
32 "\n",
32 "\n",
33 "Through IPython's kernel and messaging architecture, the Notebook allows code to be run in a range of different programming languages, including Python, R, Julia, Ruby and many others.\n",
33 "Through IPython's kernel and messaging architecture, the Notebook allows code to be run in a range of different programming languages, including Python, R, Julia, Ruby and many others.\n",
34 "\n",
34 "\n",
35 "The IPython Notebook combines three components:\n",
35 "The IPython Notebook combines three components:\n",
36 "\n",
36 "\n",
37 "* **The notebook web application**: An interactive web application for writing and running code interactively and authoring notebook documents.\n",
37 "* **The notebook web application**: An interactive web application for writing and running code interactively and authoring notebook documents.\n",
38 "* **Kernels**: Separate processes started by the notebook web application that runs users' code in a given language and returns output back to the notebook web application. The kernel also handles things like computations for interactive widgets, tab completion and introspection. \n",
38 "* **Kernels**: Separate processes started by the notebook web application that runs users' code in a given language and returns output back to the notebook web application. The kernel also handles things like computations for interactive widgets, tab completion and introspection. \n",
39 "* **Notebook documents**: Self-contained documents that contain a representation of all content visible in the notebook web application, including inputs and outputs of the computations, narrative\n",
39 "* **Notebook documents**: Self-contained documents that contain a representation of all content visible in the notebook web application, including inputs and outputs of the computations, narrative\n",
40 "text, equations, images, and rich media representations of objects. Each notebook document has its own kernel."
40 "text, equations, images, and rich media representations of objects. Each notebook document has its own kernel."
41 ]
41 ]
42 },
42 },
43 {
43 {
44 "cell_type": "heading",
44 "cell_type": "heading",
45 "level": 2,
45 "level": 2,
46 "metadata": {},
46 "metadata": {},
47 "source": [
47 "source": [
48 "Notebook web application"
48 "Notebook web application"
49 ]
49 ]
50 },
50 },
51 {
51 {
52 "cell_type": "markdown",
52 "cell_type": "markdown",
53 "metadata": {},
53 "metadata": {},
54 "source": [
54 "source": [
55 "The notebook web application enables users to:\n",
55 "The notebook web application enables users to:\n",
56 "\n",
56 "\n",
57 "* Edit code in the browser, with automatic syntax highlighting, indentation, and tab completion/introspection.\n",
57 "* Edit code in the browser, with automatic syntax highlighting, indentation, and tab completion/introspection.\n",
58 "* Run code from the browser, with the results of computations attached to the code which generated them.\n",
58 "* Run code from the browser, with the results of computations attached to the code which generated them.\n",
59 "* See the results of computations with rich media representations, such as HTML, LaTeX, PNG, SVG, PDF, etc.\n",
59 "* See the results of computations with rich media representations, such as HTML, LaTeX, PNG, SVG, PDF, etc.\n",
60 "* Create and use interactive JavaScript wigets, which bind interactive user interface controls and visualizations to reactive kernel side computations.\n",
60 "* Create and use interactive JavaScript wigets, which bind interactive user interface controls and visualizations to reactive kernel side computations.\n",
61 "* Author narrative text using the [Markdown](https://daringfireball.net/projects/markdown/) markup language.\n",
61 "* Author narrative text using the [Markdown](https://daringfireball.net/projects/markdown/) markup language.\n",
62 "* Build hierarchical documents that are organized into sections with different levels of headings.\n",
62 "* Build hierarchical documents that are organized into sections with different levels of headings.\n",
63 "* Include mathematical equations using LaTeX syntax in Markdown, which are rendered in-browser by [MathJax](http://www.mathjax.org/).\n",
63 "* Include mathematical equations using LaTeX syntax in Markdown, which are rendered in-browser by [MathJax](http://www.mathjax.org/).\n",
64 "* Start parallel computing clusters that work with IPython's interactive parallel computing libraries `IPython.parallel`."
64 "* Start parallel computing clusters that work with IPython's interactive parallel computing libraries `IPython.parallel`."
65 ]
65 ]
66 },
66 },
67 {
67 {
68 "cell_type": "heading",
68 "cell_type": "heading",
69 "level": 2,
69 "level": 2,
70 "metadata": {},
70 "metadata": {},
71 "source": [
71 "source": [
72 "Kernels"
72 "Kernels"
73 ]
73 ]
74 },
74 },
75 {
75 {
76 "cell_type": "markdown",
76 "cell_type": "markdown",
77 "metadata": {},
77 "metadata": {},
78 "source": [
78 "source": [
79 "For each notebook document that a user opens, the web application starts a kernel that runs the code for that notebook. Each kernel is capable of running code in a single programming language and there are kernels available in the following languages:\n",
79 "For each notebook document that a user opens, the web application starts a kernel that runs the code for that notebook. Each kernel is capable of running code in a single programming language and there are kernels available in the following languages:\n",
80 "\n",
80 "\n",
81 "* Python(https://github.com/ipython/ipython)\n",
81 "* Python(https://github.com/ipython/ipython)\n",
82 "* Julia (https://github.com/JuliaLang/IJulia.jl)\n",
82 "* Julia (https://github.com/JuliaLang/IJulia.jl)\n",
83 "* R (https://github.com/takluyver/IRkernel)\n",
83 "* R (https://github.com/takluyver/IRkernel)\n",
84 "* Ruby (https://github.com/minrk/iruby)\n",
84 "* Ruby (https://github.com/minrk/iruby)\n",
85 "* Haskell (https://github.com/gibiansky/IHaskell)\n",
85 "* Haskell (https://github.com/gibiansky/IHaskell)\n",
86 "* Scala (https://github.com/Bridgewater/scala-notebook)\n",
86 "* Scala (https://github.com/Bridgewater/scala-notebook)\n",
87 "* node.js (https://gist.github.com/Carreau/4279371)\n",
87 "* node.js (https://gist.github.com/Carreau/4279371)\n",
88 "* Go (https://github.com/takluyver/igo)\n",
88 "* Go (https://github.com/takluyver/igo)\n",
89 "\n",
89 "\n",
90 "The default kernel runs Python code. When it is released in the Summer/Fall of 2014, IPython 3.0 will provide a simple way for users to pick which of these kernels is used for a given notebook. \n",
90 "The default kernel runs Python code. When it is released in the Summer/Fall of 2014, IPython 3.0 will provide a simple way for users to pick which of these kernels is used for a given notebook. \n",
91 "\n",
91 "\n",
92 "Each of these kernels communicate with the notebook web application and web browser using a JSON over ZeroMQ/WebSockets message protocol that is described [here](http://ipython.org/ipython-doc/dev/development/messaging.html). Most users don't need to know about these details, but it helps to understand that \"kernels run code.\""
92 "Each of these kernels communicate with the notebook web application and web browser using a JSON over ZeroMQ/WebSockets message protocol that is described [here](http://ipython.org/ipython-doc/dev/development/messaging.html). Most users don't need to know about these details, but it helps to understand that \"kernels run code.\""
93 ]
93 ]
94 },
94 },
95 {
95 {
96 "cell_type": "heading",
96 "cell_type": "heading",
97 "level": 2,
97 "level": 2,
98 "metadata": {},
98 "metadata": {},
99 "source": [
99 "source": [
100 "Notebook documents"
100 "Notebook documents"
101 ]
101 ]
102 },
102 },
103 {
103 {
104 "cell_type": "markdown",
104 "cell_type": "markdown",
105 "metadata": {},
105 "metadata": {},
106 "source": [
106 "source": [
107 "Notebook documents contain the inputs and outputs of an interactive session as well as narrative text that accompanies the code but is not meant for execution. Rich output generated by running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation. \n",
107 "Notebook documents contain the inputs and outputs of an interactive session as well as narrative text that accompanies the code but is not meant for execution. Rich output generated by running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation. \n",
108 "\n",
108 "\n",
109 "When you run the notebook web application on your computer, notebook documents are just files on your local filesystem with a `.ipynb` extension. This allows you to use familiar workflows for organizing your notebooks into folders and sharing them with others using email, Dropbox and version control systems.\n",
109 "When you run the notebook web application on your computer, notebook documents are just files on your local filesystem with a `.ipynb` extension. This allows you to use familiar workflows for organizing your notebooks into folders and sharing them with others using email, Dropbox and version control systems.\n",
110 "\n",
110 "\n",
111 "Notebooks consist of a linear sequence of cells. There are four basic cell types:\n",
111 "Notebooks consist of a linear sequence of cells. There are four basic cell types:\n",
112 "\n",
112 "\n",
113 "* **Code cells:** Input and output of live code that is run in the kernel\n",
113 "* **Code cells:** Input and output of live code that is run in the kernel\n",
114 "* **Markdown cells:** Narrative text with embedded LaTeX equations\n",
114 "* **Markdown cells:** Narrative text with embedded LaTeX equations\n",
115 "* **Heading cells:** 6 levels of hierarchical organization\n",
115 "* **Heading cells:** 6 levels of hierarchical organization and formatting\n",
116 "* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n",
116 "* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n",
117 "\n",
117 "\n",
118 "Internally, notebook documents are [JSON](http://en.wikipedia.org/wiki/JSO) data with binary values [base64](http://en.wikipedia.org/wiki/Base64) encoded. This allows them to be read and manipulated programmatically by any programming language. Because JSON is a text format, notebook documents are version control friendly.\n",
118 "Internally, notebook documents are [JSON](http://en.wikipedia.org/wiki/JSO) data with binary values [base64](http://en.wikipedia.org/wiki/Base64) encoded. This allows them to be read and manipulated programmatically by any programming language. Because JSON is a text format, notebook documents are version control friendly.\n",
119 "\n",
119 "\n",
120 "Notebooks can be exported to different static formats including HTML, reStructeredText, LaTeX, PDF, and slide shows ([reveal.js](http://lab.hakim.se/reveal-js/#/)) using IPython's `nbconvert` utility.\n",
120 "Notebooks can be exported to different static formats including HTML, reStructeredText, LaTeX, PDF, and slide shows ([reveal.js](http://lab.hakim.se/reveal-js/#/)) using IPython's `nbconvert` utility.\n",
121 "\n",
121 "\n",
122 "Furthermore, any notebook document available from a public URL on or GitHub can be shared via http://nbviewer.ipython.org. This service loads the notebook document from the URL and renders it as a static web page. The resulting web page may thus be shared with others without their needing to install IPython."
122 "Furthermore, any notebook document available from a public URL on or GitHub can be shared via http://nbviewer.ipython.org. This service loads the notebook document from the URL and renders it as a static web page. The resulting web page may thus be shared with others without their needing to install IPython."
123 ]
123 ]
124 }
124 }
125 ],
125 ],
126 "metadata": {}
126 "metadata": {}
127 }
127 }
128 ]
128 ]
129 } No newline at end of file
129 }
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now