ob-jupyter.el: Update documentation

* ob-jupyter.el (org-babel-jupyter-session-clients)
(org-babel-jupyter-session-key)
(org-babel-edit-prep:jupyter)
(org-babel-jupyter-aliases-from-kernelspecs): Do it.
This commit is contained in:
Nathaniel Nicandro 2020-04-03 15:15:00 -05:00
parent 51b7ddc57a
commit 4399d25cdb

View file

@ -62,8 +62,8 @@
(defvar org-babel-jupyter-session-clients (make-hash-table :test #'equal) (defvar org-babel-jupyter-session-clients (make-hash-table :test #'equal)
"A hash table mapping session names to Jupyter clients. "A hash table mapping session names to Jupyter clients.
A key into this table can be constructed for the src-block at `org-babel-jupyter-src-block-session' returns a key into this
`point' using `org-babel-jupyter-src-block-session'.") table for the source block at `point'.")
(defvar org-babel-header-args:jupyter '((kernel . :any) (defvar org-babel-header-args:jupyter '((kernel . :any)
(async . ((yes no)))) (async . ((yes no))))
@ -91,11 +91,10 @@ A key into this table can be constructed for the src-block at
'ob-jupyter (intern (concat "org-babel-execute:" lang))))) 'ob-jupyter (intern (concat "org-babel-execute:" lang)))))
(defun org-babel-jupyter-session-key (params) (defun org-babel-jupyter-session-key (params)
"Return the session key based on the keys in PARAMS. "Return a string that is the concatenation of the :session and :kernel PARAMS.
PARAMS is the arguments alist as returned by PARAMS is the arguments alist as returned by
`org-babel-get-src-block-info' and should contain a :kernel key `org-babel-get-src-block-info'. The returned string can then be
and a valid :session key. The session key is used to access the used to identify unique Jupyter Org babel sessions."
clients in `org-babel-jupyter-session-clients'."
(let ((session (alist-get :session params)) (let ((session (alist-get :session params))
(kernel (alist-get :kernel params))) (kernel (alist-get :kernel params)))
(unless (and session kernel (unless (and session kernel
@ -185,9 +184,9 @@ path."
Enable `jupyter-repl-interaction-mode' in the edit buffer Enable `jupyter-repl-interaction-mode' in the edit buffer
associated with the session found in INFO. associated with the session found in INFO.
If the session corresponds to a connection to a notebook server, If the session is a Jupyter TRAMP file name, the
the `default-directory' is set to the root of the directory that `default-directory' of the edit buffer is set to the root
the notebook serves." directory the notebook serves."
(let* ((params (nth 2 info)) (let* ((params (nth 2 info))
(session (alist-get :session params)) (session (alist-get :session params))
(client-buffer (org-babel-jupyter-initiate-session session params))) (client-buffer (org-babel-jupyter-initiate-session session params)))
@ -605,8 +604,8 @@ SPECS defaults to `jupyter-available-kernelspecs'. Optional
argument REFRESH has the same meaning as in argument REFRESH has the same meaning as in
`jupyter-available-kernelspecs'. `jupyter-available-kernelspecs'.
Note, spaces or uppercase characters in the language alias are Note, spaces or uppercase characters in the kernel language name
converted into dashes or lowercase characters in the language are converted into dashes or lowercase characters in the language
alias, e.g. alias, e.g.
Wolfram Language -> jupyter-wolfram-language" Wolfram Language -> jupyter-wolfram-language"