##// END OF EJS Templates
Pulling in content and rewriting from ipython-in-depth.
Pulling in content and rewriting from ipython-in-depth.

File last commit:

r17496:b0d6ca14
r17496:b0d6ca14
Show More
Notebook User Interface.ipynb
243 lines | 8.5 KiB | text/plain | TextLexer
/ examples / Notebook / Notebook User Interface.ipynb
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 {
"metadata": {
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "name": "",
"signature": "sha256:fdeb47a733910a12406e6a2e4f13c2c76fe50b19428feb6ba77c06652fb1d6af"
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 },
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "Notebook User Interface"
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "This notebook describes the user interface of the IPython Notebook. This includes both mouse and keyboard based navigation and interaction."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert\">\n",
Brian E. Granger
Work on shortcuts and examples notebook.
r14100 "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",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "</div>"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "Overview of the UI"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The notebook UI has the following main areas:\n",
"\n",
"* Menu\n",
"* Toolbar\n",
"* Notebook area and cells\n",
"\n",
"IPython 2.0 has an interactive tour of these elements that can be started in the \"Help:User Interface Tour\" menu item."
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "Modal editor"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Brian E. Granger
Work on shortcuts and examples notebook.
r14100 "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."
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Edit mode"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Edit mode is indicated by a green cell border and a prompt showing in the editor area:\n",
"\n",
Brian E. Granger
Fixing links and text of User Experience notebook.
r14098 "<img src=\"images/edit_mode.png\">\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "When a cell is in edit mode, you can type into the cell, like a normal text editor."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-success\">\n",
"Enter edit mode by pressing `Enter` or using the mouse to click on a cell's editor area.\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "</div>"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Command mode"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Command mode is indicated by a grey cell border:\n",
"\n",
Brian E. Granger
Fixing links and text of User Experience notebook.
r14098 "<img src=\"images/command_mode.png\">\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "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."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-error\">\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "Don't try to type into a cell in command mode; unexpected things will happen!\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-success\">\n",
"Enter command mode by pressing `Esc` or using the mouse to click *outside* a cell's editor area.\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "</div>"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Mouse navigation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"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",
"\n",
Brian E. Granger
Fixing links and text of User Experience notebook.
r14098 "<img src=\"images/menubar_toolbar.png\">"
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"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",
"\n",
"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."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "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",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "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."
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Keyboard Navigation"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Brian E. Granger
Work on shortcuts and examples notebook.
r14100 "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",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "The most important keyboard shortcuts are `Enter`, which enters edit mode, and `Esc`, which enters command mode.\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "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",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "<img src=\"images/edit_shortcuts.png\">"
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "In command mode, the entire keyboard is available for shortcuts, so there are many more:\n",
"\n",
"<img src=\"images/command_shortcuts.png\">"
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "We recommend learning the command mode shortcuts in the following rough order:\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
"1. Basic navigation: `enter`, `shift-enter`, `up/k`, `down/j`\n",
"2. Saving the notebook: `s`\n",
"2. Cell types: `y`, `m`, `1-6`, `t`\n",
"3. Cell creation and movement: `a`, `b`, `ctrl+k`, `ctrl+j`\n",
"4. Cell editing: `x`, `c`, `v`, `d`, `z`, `shift+=`\n",
"5. Kernel operations: `i`, `.`"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "Cell types"
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "The notebook UI and notebook documents are a linear sequence of cells. There are four cell types:\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "* **Code cells:** Input and output of live code that is run in the kernel\n",
"* **Markdown cells:** Narrative text with embedded LaTeX equations\n",
"* **Heading cells:** 6 levels of hierarchical organization and formatting\n",
"* **Raw cells:** Unformatted text that is included, without modification, when notebooks are converted to different formats using nbconvert\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "More information about code and Markdown cell can be found in these tutorials:\n",
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 "\n",
Brian E. Granger
Pulling in content and rewriting from ipython-in-depth.
r17496 "* [Working With Code Cells](Working With Code Cells.ipynb)\n",
"* [Working With Markdown Cells](Working With Markdown Cells.ipynb)"
Brian E. Granger
Adding basic examples notebook about modal editing.
r14097 ]
}
],
"metadata": {}
}
]
}