Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20cd990

Browse files
committed
major doc update for 1.0 release
- added links to example notebooks on nbviewer - removde unnecessary file and parts of files - put old htmlnotebook.html redirect (for Notebook Help urls in 0.13.x) - moved working_remotely to public_server - re-arrangement of notebook connection stuff - more cross-referencing of documentation sections - made links to magic command explanation in tutorial - and many more changes...
1 parent 9f3e416 commit 20cd990

9 files changed

Lines changed: 345 additions & 401 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<meta http-equiv="Refresh" content="0; url=notebook.html" />
4+
<title>Notebook page has move</title>
5+
</head>
6+
<body>
7+
<p>The notebook page has moved to <a href="notebook.html">this link</a>.</p>
8+
</body>
9+
</html>

docs/source/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@
157157

158158
# Additional templates that should be rendered to pages, maps page names to
159159
# template names.
160-
#html_additional_pages = {}
160+
html_additional_pages = {
161+
'interactive/htmlnotebook': 'htmlnotebook.html',
162+
}
161163

162164
# If false, no module index is generated.
163165
#html_use_modindex = True

docs/source/install/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Dependencies for the IPython HTML notebook
319319
==========================================
320320

321321
The IPython notebook is a notebook-style web interface to IPython and can be
322-
started withe command ``ipython notebook``.
322+
started with the command ``ipython notebook``.
323323

324324
pyzmq
325325
-----

docs/source/interactive/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Using IPython for interactive work
1212
qtconsole
1313
notebook
1414
nbconvert
15-
working_remotely
15+
public_server
1616

1717

docs/source/interactive/notebook.rst

Lines changed: 225 additions & 323 deletions
Large diffs are not rendered by default.

docs/source/interactive/working_remotely.rst renamed to docs/source/interactive/public_server.rst

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
.. _working_remotely.txt
22
3-
Working remotely
4-
================
3+
Running a notebook server
4+
=========================
55

66

7-
The IPython Notebook web app is based on a server-client structure.
8-
This server uses a two-process kernel architecture based on ZeroMQ_, as well
9-
as Tornado_ for serving HTTP requests. Other clients may connect to the same
10-
underlying IPython kernel; see below.
7+
The :ref:`IPython notebook <htmlnotebook>` web-application is based on a
8+
server-client structure. This server uses a :ref:`two-process kernel
9+
architecture <ipythonzmq>` based on ZeroMQ_, as well as Tornado_ for serving
10+
HTTP requests. By default, a notebook server runs on http://127.0.0.1:8888/
11+
and is accessible only from `localhost`. This document describes how you can
12+
:ref:`secure a notebook server <notebook_security>` and how to :ref:`run it on
13+
a public interface <notebook_public_server>`.
1114

1215
.. _ZeroMQ: http://zeromq.org
1316

@@ -16,10 +19,10 @@ underlying IPython kernel; see below.
1619

1720
.. _notebook_security:
1821

19-
Security
20-
--------
22+
Notebook security
23+
-----------------
2124

22-
You can protect your Notebook server with a simple single password by
25+
You can protect your notebook server with a simple single password by
2326
setting the :attr:`NotebookApp.password` configurable. You can prepare a
2427
hashed password using the function :func:`IPython.lib.security.passwd`:
2528

@@ -65,41 +68,15 @@ self-signed. If you want to have a fully compliant certificate that will not
6568
raise warnings, it is possible (but rather involved) to obtain one,
6669
as explained in detail in `this tutorial`__.
6770

68-
.. __: http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-
69-
secure-sertificate-for-free.ars
71+
.. __: http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars
7072

7173
Keep in mind that when you enable SSL support, you will need to access the
7274
notebook server over ``https://``, not over plain ``http://``. The startup
7375
message from the server prints this, but it is easy to overlook and think the
7476
server is for some reason non-responsive.
7577

7678

77-
Connecting to an existing kernel
78-
---------------------------------
79-
80-
The notebook server always prints to the terminal the full details of
81-
how to connect to each kernel, with messages such as the following::
82-
83-
[IPKernelApp] To connect another client to this kernel, use:
84-
[IPKernelApp] --existing kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json
85-
86-
This long string is the name of a JSON file that contains all the port and
87-
validation information necessary to connect to the kernel. You can then, for
88-
example, manually start a Qt console connected to the *same* kernel with::
89-
90-
$ ipython qtconsole --existing
91-
kernel-3bb93edd-6b5a-455c-99c8-3b658f45dde5.json
92-
93-
If you have only a single kernel running, simply typing::
94-
95-
$ ipython qtconsole --existing
96-
97-
will automatically find it. (It will always find the most recently
98-
started kernel if there is more than one.) You can also request this
99-
connection data by typing ``%connect_info``; this will print the same
100-
file information as well as the content of the JSON data structure it
101-
contains.
102-
79+
.. _notebook_public_server:
10380

10481
Running a public notebook server
10582
--------------------------------
@@ -152,8 +129,8 @@ modifying ``ipython_notebook_config.py``)::
152129
Using a different notebook store
153130
--------------------------------
154131

155-
By default, the Notebook app stores the notebook documents that it saves as
156-
files in the working directory of the Notebook app, also known as the
132+
By default, the notebook server stores the notebook documents that it saves as
133+
files in the working directory of the notebook server, also known as the
157134
``notebook_dir``. This logic is implemented in the
158135
:class:`FileNotebookManager` class. However, the server can be configured to
159136
use a different notebook manager class, which can
@@ -178,9 +155,9 @@ Known issues
178155
------------
179156

180157
When behind a proxy, especially if your system or browser is set to autodetect
181-
the proxy, the Notebook app might fail to connect to the server's websockets,
182-
and present you with a warning at startup. In this case, you need to configure
183-
your system not to use the proxy for the server's address.
158+
the proxy, the notebook web application might fail to connect to the server's
159+
websockets, and present you with a warning at startup. In this case, you need
160+
to configure your system not to use the proxy for the server's address.
184161

185162
For example, in Firefox, go to the Preferences panel, Advanced section,
186163
Network tab, click 'Settings...', and add the address of the notebook server

docs/source/interactive/tutorial.rst

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,27 @@ You don't need to know anything beyond Python to start using IPython – just ty
88
commands as you would at the standard Python prompt. But IPython can do much
99
more than the standard prompt. Some key features are described here. For more
1010
information, check the :ref:`tips page <tips>`, or look at examples in the
11-
`IPython cookbook <http://wiki.ipython.org/index.php?title=Cookbook>`_.
11+
`IPython cookbook <https://github.com/ipython/ipython/wiki/Cookbook%3A-Index>`_.
1212

1313
If you've never used Python before, you might want to look at `the official
1414
tutorial <http://docs.python.org/tutorial/>`_ or an alternative, `Dive into
1515
Python <http://diveintopython.org/toc/index.html>`_.
1616

17+
The four most helpful commands
18+
===============================
19+
20+
The four most helpful commands, as well as their brief description, is shown
21+
to you in a banner, every time you start IPython:
22+
23+
========== =========================================================
24+
command description
25+
========== =========================================================
26+
? Introduction and overview of IPython's features.
27+
%quickref Quick reference.
28+
help Python's own help system.
29+
object? Details about 'object', use 'object??' for extra details.
30+
========== =========================================================
31+
1732
Tab completion
1833
==============
1934

@@ -31,16 +46,19 @@ including docstrings, function definition lines (for call arguments) and
3146
constructor details for classes. To get specific information on an object, you
3247
can use the magic commands ``%pdoc``, ``%pdef``, ``%psource`` and ``%pfile``
3348

49+
.. _magics_explained:
50+
3451
Magic functions
3552
===============
3653

3754
IPython has a set of predefined 'magic functions' that you can call with a
3855
command line style syntax. There are two kinds of magics, line-oriented and
39-
cell-oriented. Line magics are prefixed with the ``%`` character and work much
56+
cell-oriented. **Line magics** are prefixed with the ``%`` character and work much
4057
like OS command-line calls: they get as an argument the rest of the line, where
41-
arguments are passed without parentheses or quotes. Cell magics are prefixed
42-
with a double ``%%``, and they are functions that get as an argument not only
43-
the rest of the line, but also the lines below it in a separate argument.
58+
arguments are passed without parentheses or quotes. **Cell magics** are
59+
prefixed with a double ``%%``, and they are functions that get as an argument
60+
not only the rest of the line, but also the lines below it in a separate
61+
argument.
4462

4563
The following examples show how to call the builtin ``timeit`` magic, both in
4664
line and cell mode::
@@ -58,34 +76,41 @@ The builtin magics include:
5876
- Functions that work with code: ``%run``, ``%edit``, ``%save``, ``%macro``,
5977
``%recall``, etc.
6078
- Functions which affect the shell: ``%colors``, ``%xmode``, ``%autoindent``,
61-
etc.
62-
- Other functions such as ``%reset``, ``%timeit`` or ``%paste``.
79+
``%automagic``, etc.
80+
- Other functions such as ``%reset``, ``%timeit``, ``%%file``, ``%load``, or
81+
``%paste``.
6382

64-
You can always call them using the % prefix, and if you're calling a line magic
65-
on a line by itself, you can omit even that (cell magics must always have the
66-
``%%`` prefix)::
83+
You can always call them using the ``%`` prefix, and if you're calling a line
84+
magic on a line by itself, you can omit even that::
6785

6886
run thescript.py
6987

88+
You can toggle this behavior by running the ``%automagic`` magic. Cell magics
89+
must always have the ``%%`` prefix.
90+
7091
A more detailed explanation of the magic system can be obtained by calling
7192
``%magic``, and for more details on any magic function, call ``%somemagic?`` to
7293
read its docstring. To see all the available magic functions, call
7394
``%lsmagic``.
7495

96+
.. seealso::
97+
98+
`Cell magics`_ example notebook
99+
75100
Running and Editing
76101
-------------------
77102

78-
The %run magic command allows you to run any python script and load all of its
79-
data directly into the interactive namespace. Since the file is re-read from
80-
disk each time, changes you make to it are reflected immediately (unlike
81-
imported modules, which have to be specifically reloaded). IPython also includes
82-
:ref:`dreload <dreload>`, a recursive reload function.
103+
The ``%run`` magic command allows you to run any python script and load all of
104+
its data directly into the interactive namespace. Since the file is re-read
105+
from disk each time, changes you make to it are reflected immediately (unlike
106+
imported modules, which have to be specifically reloaded). IPython also
107+
includes :ref:`dreload <dreload>`, a recursive reload function.
83108

84-
%run has special flags for timing the execution of your scripts (-t), or for
85-
running them under the control of either Python's pdb debugger (-d) or
109+
``%run`` has special flags for timing the execution of your scripts (-t), or
110+
for running them under the control of either Python's pdb debugger (-d) or
86111
profiler (-p).
87112

88-
The %edit command gives a reasonable approximation of multiline editing,
113+
The ``%edit`` command gives a reasonable approximation of multiline editing,
89114
by invoking your favorite editor on the spot. IPython will execute the
90115
code you type in there as if it were typed interactively.
91116

@@ -153,11 +178,12 @@ visited directories and allows you to go to any previously visited one.
153178
Configuration
154179
=============
155180

156-
Much of IPython can be tweaked through configuration. To get started, use the
157-
command ``ipython profile create`` to produce the default config files. These
158-
will be placed in :file:`~/.ipython/profile_default` or
159-
:file:`~/.config/ipython/profile_default`, and contain comments explaining what
160-
the various options do.
181+
Much of IPython can be tweaked through :ref:`configuration <config_overview>`.
182+
To get started, use the command ``ipython profile create`` to produce the
183+
default config files. These will be placed in
184+
:file:`~/.ipython/profile_default` or
185+
:file:`~/.config/ipython/profile_default`, and contain comments explaining
186+
what the various options do.
161187

162188
Profiles allow you to use IPython for different tasks, keeping separate config
163189
files and history for each one. More details in :ref:`the profiles section
@@ -173,7 +199,4 @@ as the IPython shell is constructed, before any other code or scripts you have
173199
specified. The files will be run in order of their names, so you can control the
174200
ordering with prefixes, like ``10-myimports.py``.
175201

176-
.. note::
177-
178-
Automatic startup files are new in IPython 0.12. Use InteractiveShellApp.exec_files
179-
in :file:`ipython_config.py` for similar behavior in 0.11.
202+
.. include:: ../links.txt

docs/source/links.txt

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
.. _ipython_github_repo: http://github.com/ipython/ipython/
2424
.. _ipython_downloads: http://ipython.org/download.html
2525
.. _ipython_pypi: http://pypi.python.org/pypi/ipython
26+
.. _nbviewer: http://nbviewer.ipython.org
2627

2728
.. _ZeroMQ: http://zeromq.org
2829

@@ -46,7 +47,7 @@
4647
.. _numpy: http://numpy.scipy.org
4748
.. _scipy: http://www.scipy.org
4849
.. _scipy_conference: http://conference.scipy.org
49-
.. _matplotlib: http://matplotlib.sourceforge.net
50+
.. _matplotlib: http://matplotlib.org
5051
.. _pythonxy: http://www.pythonxy.com
5152
.. _ETS: http://code.enthought.com/projects/tool-suite.php
5253
.. _EPD: http://www.enthought.com/products/epd.php
@@ -72,4 +73,29 @@
7273
.. _indefero: http://www.indefero.net
7374
.. _git: http://git-scm.com
7475
.. _github: http://github.com
75-
.. _MarkDown: http://daringfireball.net/projects/markdown/
76+
.. _Markdown: http://daringfireball.net/projects/markdown/syntax
77+
78+
.. _Running Code in the IPython Notebook: notebook_p1_
79+
.. _notebook_p1: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Part%25201%2520-%2520Running%2520Code.ipynb
80+
81+
.. _Basic Output: notebook_p2_
82+
.. _notebook_p2: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Part%202%20-%20Basic%20Output.ipynb
83+
84+
.. _Plotting with Matplotlib: notebook_p3_
85+
.. _notebook_p3: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Part%203%20-%20Plotting%20with%20Matplotlib.ipynb
86+
87+
.. _Markdown Cells: notebook_p4
88+
.. _notebook_p4: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Part%204%20-%20Markdown%20Cells.ipynb
89+
90+
.. _Rich Display System: notebook_p5_
91+
.. _notebook_p5: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Part%205%20-%20Rich%20Display%20System.ipynb
92+
93+
.. _notebook_custom_display: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Custom%20Display%20Logic.ipynb
94+
95+
.. _Frontend/Kernel Model: notebook_two_proc_
96+
.. _notebook_two_proc: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Frontend-Kernel%20Model.ipynb
97+
98+
.. _Cell magics: notebook_cell_magics_
99+
.. _notebook_cell_magics: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/1.x/examples/notebooks/Cell%20Magics.ipynb
100+
101+

docs/source/overview.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ interactive and exploratory computing. To support this goal, IPython
1818
has three main components:
1919

2020
* An enhanced interactive Python shell.
21-
* A decoupled two-process communication model, which allows for multiple
22-
clients to connect to a computation kernel, most notably the web-based
23-
:ref:`notebook <htmlnotebook>`
21+
* A decoupled :ref:`two-process communication model <ipythonzmq>`, which
22+
allows for multiple clients to connect to a computation kernel, most notably
23+
the web-based :ref:`notebook <htmlnotebook>`
2424
* An architecture for interactive parallel computing.
2525

2626
All of IPython is open source (released under the revised BSD license).
@@ -197,7 +197,7 @@ Decoupled two-process model
197197

198198
IPython has abstracted and extended the notion of a traditional
199199
*Read-Evaluate-Print Loop* (REPL) environment by decoupling the *evaluation*
200-
into its own process. We call this process a kernel: it receives execution
200+
into its own process. We call this process a **kernel**: it receives execution
201201
instructions from clients and communicates the results back to them.
202202

203203
This decoupling allows us to have several clients connected to the same
@@ -222,6 +222,10 @@ You can read more about using :ref:`ipython qtconsole <qtconsole>`, and
222222
<messaging>` which documents the protocol for communication between kernels
223223
and clients.
224224

225+
.. seealso::
226+
227+
`Frontend/Kernel Model`_ example notebook
228+
225229

226230
Interactive parallel computing
227231
==============================
@@ -283,3 +287,4 @@ IPython is known to work on the following operating systems:
283287

284288
See :ref:`here <install_index>` for instructions on how to install IPython.
285289

290+
.. include:: links.txt

0 commit comments

Comments
 (0)