From e782ef1d977adaf5317bca5f41db30b8699052a3 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 16 Dec 2019 19:23:08 -0500 Subject: [PATCH] lang/org: add +jupyter feature, deprecate +ipython And disable +pandoc by default Relevant to #2198 --- init.example.el | 4 ++-- modules/lang/org/README.org | 9 ++++++--- modules/lang/org/contrib/jupyter.el | 13 +++++++++++++ modules/lang/org/packages.el | 2 ++ 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 modules/lang/org/contrib/jupyter.el diff --git a/init.example.el b/init.example.el index 52398c67faf..f1210d1a8b0 100644 --- a/init.example.el +++ b/init.example.el @@ -131,8 +131,8 @@ (org ; organize your plain life in plain text +dragndrop ; drag & drop files/images into org buffers ;;+hugo ; use Emacs for hugo blogging - +ipython ; ipython/jupyter support for babel - +pandoc ; export-with-pandoc support + ;;+jupyter ; ipython/jupyter support for babel + ;;+pandoc ; export-with-pandoc support ;;+pomodoro ; be fruitful with the tomato technique +present) ; using org-mode for presentations ;;perl ; write code no one else can comprehend diff --git a/modules/lang/org/README.org b/modules/lang/org/README.org index 34c06010e1e..1111cd47741 100644 --- a/modules/lang/org/README.org +++ b/modules/lang/org/README.org @@ -35,8 +35,8 @@ intuitive out of the box: org files to reveal.js slideshows. + Drag-and-drop support for images (with inline preview) and media files (drops a file icon and a short link) (requires =+dragndrop= flag). -+ Integration with pandoc, ipython, reveal.js, beamer, and others (requires - flags). ++ Integration with pandoc, ipython, jupyter, reveal.js, beamer, and others + (requires flags). + Export-to-clipboard functionality, for copying text into formatted html, markdown or rich text to the clipboard (see ~+org/export-to-clipboard~ and ~+org/export-to-clipboard-as-rich-text~). @@ -57,7 +57,8 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode + =+gnuplot= Installs gnuplot & gnuplot-mode, which enables rendering images from gnuplot src blocks or plotting tables with ~org-plot/gnuplot~ (bound to =SPC m b p=, by default). -+ =+ipython= Enables ipython+babel integration. ++ =+ipython= (**DEPRECATED**) Enables ipython integration for babel. ++ =+jupyter= Enables Jupyter integration for babel. + =+pandoc= Enables pandoc integration into the Org exporter. + =+pomodoro= Enables a pomodoro timer for clocking time on tasks. + =+present= Enables integration with reveal.js, beamer and org-tree-slide, so @@ -96,6 +97,8 @@ https://www.mfoot.com/blog/2015/11/22/literate-emacs-configuration-with-org-mode + [[https://github.com/bruceravel/gnuplot-mode][gnuplot-mode]] + =+ipython= + [[https://github.com/gregsexton/ob-ipython][ob-ipython]] ++ =+jupyter= + + [[https://github.com/dzop/emacs-jupyter][jupyter]] + =+pandoc= + [[https://github.com/kawabata/ox-pandoc][ox-pandoc]] + =+pomodoro= diff --git a/modules/lang/org/contrib/jupyter.el b/modules/lang/org/contrib/jupyter.el new file mode 100644 index 00000000000..d744d02c3d4 --- /dev/null +++ b/modules/lang/org/contrib/jupyter.el @@ -0,0 +1,13 @@ +;;; lang/org/contrib/jupyter.el -*- lexical-binding: t; -*- +;;;###if (featurep! +jupyter) + +(use-package! ob-jupyter + :defer t + :init + (after! ob-async + (pushnew! ob-async-no-async-languages-alist "jupyter-python" "jupyter-julia")) + + (add-hook! '+org-babel-load-functions + (defun +org-babel-load-jupyter-h (lang) + (and (string-prefix-p "jupyter-" (symbol-name lang)) + (require 'ob-jupyter nil t))))) diff --git a/modules/lang/org/packages.el b/modules/lang/org/packages.el index 43899dba1ef..5213640f1fc 100644 --- a/modules/lang/org/packages.el +++ b/modules/lang/org/packages.el @@ -46,6 +46,8 @@ (package! gnuplot-mode)) (when (featurep! +ipython) (package! ob-ipython)) +(when (featurep! +jupyter) + (package! jupyter)) (when (featurep! +pomodoro) (package! org-pomodoro)) (when (featurep! +present)