committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 118 additions and 0 deletions
-
1CHANGELOG.md
-
17docs/modules/literate-programming.md
-
99modules/prelude-literate-programming.el
-
1sample/prelude-modules.el
@ -0,0 +1,17 @@ |
|||
# Prelude Literate Programming |
|||
|
|||
Prelude's `prelude-literate-programming` module enables some |
|||
additional functionality for `org-mode` - the parent mode the native |
|||
markdown language of Emacs. |
|||
|
|||
It also enables viewing and interaction of Python Notebooks within Emacs. |
|||
|
|||
Here are some features it provides: |
|||
|
|||
* syntax highlighting of code blocks in Emacs Orgmode |
|||
* executing code blocks and printing their output in the org file |
|||
* viewing python notebooks within Emacs |
|||
* Using Emacs to interact with python notebooks and other remote compute engines |
|||
|
|||
It makes an attempt to enable [literate programming](http://www.literateprogramming.com/knuthweb.pdf) |
|||
from within emacs |
|||
@ -0,0 +1,99 @@ |
|||
;;; prelude-literate-programming.el --- Emacs Prelude: Literate Programming Support |
|||
;; |
|||
;; Author: Koustubh Sinkar |
|||
;; Version: 1.0.0 |
|||
;; Keywords: literate programming |
|||
|
|||
;; This file is not part of GNU Emacs. |
|||
|
|||
;;; Commentary: |
|||
|
|||
;; Prelude configuration for literate programming |
|||
|
|||
;;; License: |
|||
|
|||
;; This program is free software; you can redistribute it and/or |
|||
;; modify it under the terms of the GNU General Public License |
|||
;; as published by the Free Software Foundation; either version 3 |
|||
;; of the License, or (at your option) any later version. |
|||
;; |
|||
;; This program is distributed in the hope that it will be useful, |
|||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
;; GNU General Public License for more details. |
|||
;; |
|||
;; You should have received a copy of the GNU General Public License |
|||
;; along with GNU Emacs; see the file COPYING. If not, write to the |
|||
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|||
;; Boston, MA 02110-1301, USA. |
|||
|
|||
;;; Code: |
|||
|
|||
(defvar prelude-ipynb-packages |
|||
'(code-cells ; file mode for code-cells |
|||
ein ; Emacs Ipython Notebook (Jupyter Client) |
|||
elpy ; emacs python development environment |
|||
)) |
|||
|
|||
(defvar prelude-ob-packages |
|||
'(ob-async ; asynchronous execution of code-blocks |
|||
ob-ipython ; for python and ipython |
|||
ob-tmux ; for shell |
|||
ob-deno ; for javascript |
|||
ob-typescript |
|||
)) |
|||
|
|||
|
|||
(prelude-require-packages |
|||
(append prelude-ipynb-packages prelude-ob-packages)) |
|||
|
|||
(setq prelude-ob-loader-list |
|||
'((python . t) |
|||
(ipython . t) |
|||
(shell . t) |
|||
(js . t) |
|||
(typescript . t) |
|||
;; Include other languages here... |
|||
)) |
|||
|
|||
;; Run/highlight code using babel in org-mode |
|||
(org-babel-do-load-languages |
|||
'org-babel-load-languages prelude-ob-loader-list) |
|||
|
|||
;; Syntax highlight in #+BEGIN_SRC blocks |
|||
(setq org-src-fontify-natively t) |
|||
|
|||
;; Don't prompt before running code in org |
|||
(setq org-confirm-babel-evaluate nil) |
|||
|
|||
;; Fix an incompatibility between the ob-async and ob-ipython packages |
|||
(setq ob-async-no-async-languages-alist '("ipython")) |
|||
|
|||
(defvar org-babel-language-list |
|||
'(ob-cfengine3 |
|||
ob-clojurescript |
|||
ob-coffee |
|||
ob-dao |
|||
ob-diagrams |
|||
ob-elixir |
|||
ob-elm |
|||
ob-go |
|||
ob-graphql |
|||
ob-http |
|||
ob-ipython |
|||
ob-julia-vterm |
|||
ob-kotlin |
|||
ob-mongo |
|||
ob-prolog |
|||
ob-restclient |
|||
ob-rust |
|||
ob-sml |
|||
ob-sql-mode |
|||
ob-translate |
|||
ob-typescript |
|||
ob-uart |
|||
)) |
|||
;;; TODO Write a function to enable org-babel for each function |
|||
|
|||
(provide 'prelude-literate-programming) |
|||
;;; prelude-literate-programming.el ends here |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue