2019-12-16 19:23:08 -05:00
|
|
|
;;; lang/org/contrib/jupyter.el -*- lexical-binding: t; -*-
|
|
|
|
;;;###if (featurep! +jupyter)
|
|
|
|
|
2019-12-18 10:18:58 -05:00
|
|
|
(use-package! ob-jupyter
|
2019-12-16 19:23:08 -05:00
|
|
|
:defer t
|
|
|
|
:init
|
|
|
|
(after! ob-async
|
|
|
|
(pushnew! ob-async-no-async-languages-alist "jupyter-python" "jupyter-julia"))
|
|
|
|
|
2019-12-22 00:02:26 -05:00
|
|
|
(after! org-src
|
|
|
|
(dolist (lang '(python julia R))
|
|
|
|
(cl-pushnew (cons (format "jupyter-%s" lang) lang)
|
|
|
|
org-src-lang-modes :key #'car)))
|
|
|
|
|
2019-12-16 19:23:08 -05:00
|
|
|
(add-hook! '+org-babel-load-functions
|
|
|
|
(defun +org-babel-load-jupyter-h (lang)
|
2019-12-18 10:18:58 -05:00
|
|
|
(when (string-prefix-p "jupyter-" (symbol-name lang))
|
2019-12-22 00:02:26 -05:00
|
|
|
(require 'jupyter)
|
|
|
|
(let* ((lang-name (symbol-name lang))
|
|
|
|
(lang-tail (string-remove-prefix "jupyter-" lang-name)))
|
|
|
|
(and (not (assoc lang-tail org-src-lang-modes))
|
|
|
|
(require (intern (format "ob-%s" lang-tail))
|
|
|
|
nil t)
|
|
|
|
(add-to-list 'org-src-lang-modes (cons lang-name (intern lang-tail)))))
|
2019-12-18 10:18:58 -05:00
|
|
|
(with-demoted-errors "Jupyter: %s"
|
2019-12-19 15:25:29 -05:00
|
|
|
(require lang nil t)
|
2020-07-13 01:46:15 -04:00
|
|
|
(require 'ob-jupyter nil t)))))
|
|
|
|
:config
|
|
|
|
(require 'tramp))
|