2018-11-28 22:09:43 -05:00
========================================================================
EIN -- Emacs IPython Notebook |build-status| |melpa-dev| |melpa-stable|
========================================================================
2019-05-14 10:02:40 -04:00
--- or **E** \ IN **I** \ s not only for pytho\ **N** \ .
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
.. COMMENTARY (see Makefile)
2018-11-28 22:09:43 -05:00
.. |build-status|
image:: https://secure.travis-ci.org/millejoh/emacs-ipython-notebook.png?branch=master
:target: http://travis-ci.org/millejoh/emacs-ipython-notebook
:alt: Build Status
.. |melpa-dev|
image:: http://melpa.milkbox.net/packages/ein-badge.svg
:target: http://melpa.milkbox.net/#/ein
:alt: MELPA development version
.. |melpa-stable|
image:: http://melpa-stable.milkbox.net/packages/ein-badge.svg
:target: http://melpa-stable.milkbox.net/#/ein
:alt: MELPA stable version
.. _Jupyter: http://jupyter.org
2019-05-16 15:01:45 -04:00
.. _Babel: https://orgmode.org/worg/org-contrib/babel/intro.html
.. _Org: https://orgmode.org
.. _[tkf]: http://tkf.github.io
.. _[gregsexton]: https://github.com/gregsexton/ob-ipython
2018-11-28 22:09:43 -05:00
Install
=======
2019-03-16 13:18:12 -04:00
Install from MELPA_ (recommended) or `` make install `` from github source.
2018-11-28 22:09:43 -05:00
Usage
=====
2019-05-14 10:02:40 -04:00
Start EIN using **one** of the following:
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
- Open an `` .ipynb `` file normally in emacs and press `` C-c C-o `` , or,
- `` M-x ein:run `` launches a jupyter process from emacs, or,
- `` M-x ein:login `` to a running jupyter server
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
Use `` C-u M-x ein:login `` for services such as `` mybinder.org `` requiring cookie authentication.
2018-11-28 22:09:43 -05:00
2019-05-16 15:01:45 -04:00
Alternatively, ob-ein_.
2018-11-28 22:09:43 -05:00
.. _Cask: https://cask.readthedocs.io/en/latest/guide/installation.html
.. _MELPA: http://melpa.org/#/
2019-03-09 10:12:52 -05:00
It doesn't work
---------------
2019-03-28 14:41:44 -05:00
2019-03-29 12:11:12 -04:00
EIN is tested on GNU Emacs versions
.. CI VERSION (see Makefile)
2019-05-16 15:01:45 -04:00
and later. We presently do not recommend the `spacemacs layer`_ .
2019-03-09 10:12:52 -05:00
2019-03-16 13:18:12 -04:00
You may also try to self-diagnose:
First invoke `` M-x ein:dev-start-debug `` . Then reproduce the error.
2019-03-09 10:12:52 -05:00
2019-03-29 12:11:12 -04:00
High level diagnostics appear in `` M-x ein:log-pop-to-all-buffer `` .
2019-03-09 10:12:52 -05:00
2019-03-29 12:11:12 -04:00
Low level diagnostics appear in `` M-x ein:log-pop-to-request-buffer `` .
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
If you cannot resolve the problem, file an issue using `` M-x ein:dev-bug-report-template `` .
2019-03-09 10:12:52 -05:00
2019-03-16 13:18:12 -04:00
.. _spacemacs layer: https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/ipython-notebook
2019-03-09 10:12:52 -05:00
.. _auto-complete: https://github.com/auto-complete/auto-complete
.. _company-mode: https://github.com/company-mode/company-mode
.. _jupyterhub: https://github.com/jupyterhub/jupyterhub
2018-11-28 22:09:43 -05:00
2019-05-14 10:02:40 -04:00
I want to use Elpy, ESS, LSP, julia-mode
========================================
2019-03-29 12:11:12 -04:00
Enable `polymode`_ via::
M-x customize-group RET ein
Toggle Ein:Polymode
2019-06-10 00:18:45 -04:00
2019-05-16 15:01:45 -04:00
ob-ein
======
Configuration:
::
2018-11-28 22:09:43 -05:00
2019-05-16 15:01:45 -04:00
M-x customize-group RET org-babel
Org Babel Load Languages:
Insert (ein . t)
For example, '((emacs-lisp . t) (ein . t))
2019-03-09 10:12:52 -05:00
2019-05-16 15:01:45 -04:00
Snippet:
2019-03-09 10:12:52 -05:00
2019-05-16 15:01:45 -04:00
::
2019-03-09 10:12:52 -05:00
2019-05-16 15:01:45 -04:00
#BEGIN_SRC ein-python :session localhost :results raw drawer
import numpy, math, matplotlib.pyplot as plt
%matplotlib inline
x = numpy.linspace(0, 2*math.pi)
plt.plot(x, numpy.sin(x))
2019-03-09 10:12:52 -05:00
#+END_SRC
2018-11-28 22:09:43 -05:00
2019-05-16 15:01:45 -04:00
The `` :session `` is the notebook url, e.g., `` http://localhost:8888/my.ipynb `` , or simply `` localhost `` , in which case org evaluates anonymously. A port may also be specified, e.g., `` localhost:8889 `` .
*Language* can be `` ein-python `` , `` ein-r `` , or `` ein-julia `` . **The relevant** `jupyter kernel`_ **must be installed before use** . Additional languages can be configured via::
M-x customize-group RET ein
Ob Ein Languages
2019-03-09 13:45:10 -05:00
2019-03-29 12:11:12 -04:00
.. _polymode: https://github.com/polymode/polymode
.. _ob-ipython: https://github.com/gregsexton/ob-ipython
2019-03-09 10:12:52 -05:00
.. _scimax: https://github.com/jkitchin/scimax
2019-03-29 12:11:12 -04:00
.. _ob-ein details: http://millejoh.github.io/emacs-ipython-notebook/#org-mode-integration
2019-05-16 15:01:45 -04:00
.. _jupyter kernel: https://github.com/jupyter/jupyter/wiki/Jupyter-kernels
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
Connected Buffers
=================
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
Use `` M-x ein:connect-to-notebook `` to submit code from an arbitrary buffer to a running jupyter kernel. See `connected buffer details`_ .
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
.. _connected buffer details: http://millejoh.github.io/emacs-ipython-notebook/#connected-buffer
2018-11-28 22:09:43 -05:00
2019-03-29 12:11:12 -04:00
Keymap (C-h m)
==============
2018-11-28 22:09:43 -05:00
::
.. KEYS NOTEBOOK (see Makefile)
Links
=====
2019-03-09 10:12:52 -05:00
* `Complete documentation <http://millejoh.github.io/emacs-ipython-notebook/> `_
2018-11-28 22:09:43 -05:00
2019-03-09 10:12:52 -05:00
* `Wiki <https://github.com/millejoh/emacs-ipython-notebook/wiki> `_
2018-11-28 22:09:43 -05:00
2019-03-09 10:12:52 -05:00
+ `Screenshots <https://github.com/millejoh/emacs-ipython-notebook/wiki/Screenshots> `_
+ `Tips <https://github.com/millejoh/emacs-ipython-notebook/wiki/Tips> `_
2018-11-28 22:09:43 -05:00
License
=======
Emacs IPython Notebook is licensed under GPL v3.
See COPYING for details.