mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
Add initial support for Wolfram Language
Partial fix for #223 * jupyter-wolfram-language.el: New file.
This commit is contained in:
parent
308a4779d8
commit
f9722a181c
1 changed files with 44 additions and 0 deletions
44
jupyter-wolfram-language.el
Normal file
44
jupyter-wolfram-language.el
Normal file
|
@ -0,0 +1,44 @@
|
|||
;;; jupyter-wolfram-language.el --- Jupyter support for Wolfram -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2020 Nathaniel Nicandro
|
||||
|
||||
;; Author: Nathaniel Nicandro <nathanielnicandro@gmail.com>
|
||||
;; Created: 12 Mar 2020
|
||||
|
||||
;; 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, 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., 59 Temple Place - Suite 330,
|
||||
;; Boston, MA 02111-1307, USA.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Support methods for integration with Wolfram Language
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'jupyter-mime)
|
||||
|
||||
(cl-defmethod jupyter-insert :around ((plist cons)
|
||||
&context (jupyter-lang wolfram-language)
|
||||
&optional metadata)
|
||||
"Fontify docstrings after inserting inspect messages."
|
||||
(cl-destructuring-bind (data metadata)
|
||||
(jupyter-normalize-data plist metadata)
|
||||
(when (and (equal (plist-get data :text/html) "")
|
||||
(plist-get data :text/plain))
|
||||
(plist-put data :text/html nil))
|
||||
(cl-call-next-method data metadata)))
|
||||
|
||||
(provide 'jupyter-wolfram-language)
|
||||
|
||||
;;; jupyter-wolfram-language.el ends here
|
Loading…
Add table
Reference in a new issue