Skip to content

Commit fe6c826

Browse files
claudeCarreau
authored andcommitted
Modernize developer-guide pages for third-party tools
how_ipython_works.rst: - Terminal IPython has done tab completion with prompt_toolkit, not readline, since 5.0. - Point octave_kernel/bash_kernel at pypi.org (pypi.python.org was retired in 2018) and zeromq.org at https. wrapperkernels.rst: - Fix the 'cusor_pos' typo in the do_complete/do_inspect signatures. - Link the messaging spec directly to the jupyter_client docs instead of bouncing through the local two-line orphan stub. - Python 3's input(), not raw_input(); https Octave link; Oct2Py docs moved from the retired blink1073.github.io page to Read the Docs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017opRcTs1YU21naKjRQrzs4
1 parent d0a0bcb commit fe6c826

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

docs/source/development/how_ipython_works.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ the terminal. It does something like this::
1212
exec(code)
1313

1414
Of course, it's much more complex, because it has to deal with multi-line
15-
code, tab completion using :mod:`readline`, magic commands, and so on. But the
15+
code, tab completion using `prompt_toolkit
16+
<https://python-prompt-toolkit.readthedocs.io/>`__, magic commands, and so on. But the
1617
model is like that: prompt the user for some code, and when they've entered it,
1718
exec it in the same process. This model is often called a REPL, or
1819
Read-Eval-Print-Loop.
@@ -24,7 +25,7 @@ All the other interfaces—the Notebook, the Qt console, ``jupyter console`` in
2425
the terminal, and third party interfaces—use the IPython Kernel. This is a
2526
separate process which is responsible for running user code, and things like
2627
computing possible completions. Frontends communicate with it using JSON
27-
messages sent over `ZeroMQ <http://zeromq.org/>`_ sockets; the protocol they use is described in
28+
messages sent over `ZeroMQ <https://zeromq.org/>`_ sockets; the protocol they use is described in
2829
:ref:`jupyterclient:messaging`.
2930

3031
The core execution machinery for the kernel is shared with terminal IPython:
@@ -49,9 +50,9 @@ the target language:
4950
.. image:: figs/other_kernels.png
5051

5152
Wrapper kernels are easier to write quickly for languages that have good Python
52-
wrappers, like `octave_kernel <https://pypi.python.org/pypi/octave_kernel>`_, or
53+
wrappers, like `octave_kernel <https://pypi.org/project/octave_kernel/>`_, or
5354
languages where it's impractical to implement the communications machinery, like
54-
`bash_kernel <https://pypi.python.org/pypi/bash_kernel>`_. Native kernels are
55+
`bash_kernel <https://pypi.org/project/bash_kernel/>`_. Native kernels are
5556
likely to be better maintained by the community using them, like
5657
`IJulia <https://github.com/JuliaLang/IJulia.jl>`_ or `IHaskell <https://github.com/gibiansky/IHaskell>`_.
5758

docs/source/development/wrapperkernels.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Making simple Python wrapper kernels
55

66
You can now re-use the kernel machinery in IPython to easily make new kernels.
77
This is useful for languages that have Python bindings, such as `Octave
8-
<http://www.gnu.org/software/octave/>`_ (via
9-
`Oct2Py <http://blink1073.github.io/oct2py/>`_), or languages
8+
<https://www.gnu.org/software/octave/>`_ (via
9+
`Oct2Py <https://oct2py.readthedocs.io/>`_), or languages
1010
where the REPL can be controlled in a tty using `pexpect <https://pexpect.readthedocs.io/en/latest/>`_,
1111
such as bash.
1212

@@ -57,12 +57,13 @@ following methods and attributes:
5757
:param dict user_expressions: Mapping of names to expressions to evaluate
5858
after the code has run. You can ignore this if you need to.
5959
:param bool allow_stdin: Whether the frontend can provide input on request
60-
(e.g. for Python's :func:`raw_input`).
60+
(e.g. for Python's :func:`input`).
6161

6262
Your method should return a dict containing the fields described in
6363
:ref:`execution_results`. To display output, it can send messages
6464
using :meth:`~ipykernel.kernelbase.Kernel.send_response`.
65-
See :doc:`messaging` for details of the different message types.
65+
See :ref:`jupyterclient:messaging` for details of the different message
66+
types.
6667

6768
To launch your kernel, add this at the end of your module::
6869

@@ -114,11 +115,11 @@ Optional steps
114115

115116
You can override a number of other methods to improve the functionality of your
116117
kernel. All of these methods should return a dictionary as described in the
117-
relevant section of the :doc:`messaging spec <messaging>`.
118+
relevant section of the :ref:`messaging spec <jupyterclient:messaging>`.
118119

119120
.. class:: MyBetterKernel
120121

121-
.. method:: do_complete(code, cusor_pos)
122+
.. method:: do_complete(code, cursor_pos)
122123

123124
Code completion
124125

@@ -129,7 +130,7 @@ relevant section of the :doc:`messaging spec <messaging>`.
129130

130131
:ref:`msging_completion` messages
131132

132-
.. method:: do_inspect(code, cusor_pos, detail_level=0)
133+
.. method:: do_inspect(code, cursor_pos, detail_level=0)
133134

134135
Object introspection
135136

0 commit comments

Comments
 (0)