mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-04 16:51:38 -05:00
ein-markdown-mode
This commit is contained in:
parent
5124e88065
commit
a26f83e768
11 changed files with 8174 additions and 28 deletions
1
Cask
1
Cask
|
@ -17,7 +17,6 @@
|
|||
(depends-on "deferred")
|
||||
(depends-on "company")
|
||||
(depends-on "polymode")
|
||||
(depends-on "markdown-mode")
|
||||
(depends-on "julia-mode")
|
||||
(depends-on "undo-tree")
|
||||
(depends-on "ess")
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
(require 'python)
|
||||
(require 'julia-mode)
|
||||
(require 'ess-r-mode)
|
||||
(require 'markdown-mode)
|
||||
|
||||
(let* ((support-path (f-dirname load-file-name))
|
||||
(root-path (f-parent (f-parent support-path))))
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
;;; Code:
|
||||
|
||||
(declare-function rst-shift-region "rst")
|
||||
(declare-function markdown-mode "markdown-mode")
|
||||
|
||||
(require 'ein-notebook)
|
||||
|
||||
|
@ -270,7 +269,6 @@ callback (`websocket-callback-debug-on-error') is enabled."
|
|||
(error (insert (format "`ein:dev-sys-info' produce: %S" err))))
|
||||
(insert "```\n")
|
||||
(goto-char (point-min))
|
||||
(markdown-mode)
|
||||
(pop-to-buffer buffer))))
|
||||
|
||||
(defun ein:dev-print-sys-info (&optional stream)
|
||||
|
|
8151
lisp/ein-markdown-mode.el
Normal file
8151
lisp/ein-markdown-mode.el
Normal file
File diff suppressed because it is too large
Load diff
|
@ -60,10 +60,14 @@ Draw boundaries for table (default)::
|
|||
"Parse HTML-STRING and return a dom object which
|
||||
can be handled by the xml module."
|
||||
(with-temp-buffer
|
||||
(erase-buffer)
|
||||
(insert html-string)
|
||||
(if (fboundp 'libxml-parse-html-region)
|
||||
(libxml-parse-html-region (point-min) (point-max)))))
|
||||
(when (fboundp 'libxml-parse-html-region)
|
||||
(cl-loop with result
|
||||
repeat 3
|
||||
do (setq result
|
||||
(libxml-parse-html-region (point-min) (point-max)))
|
||||
until result
|
||||
finally return result))))
|
||||
|
||||
(defalias 'ein:xml-node-p 'listp)
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
(request "20191211.0")
|
||||
(deferred "0.5")
|
||||
(polymode "20190426.1729")
|
||||
(markdown-mode "20171116.756")
|
||||
(kubernetes "20200114.0")
|
||||
(dash "2.13.0")
|
||||
(s "1.11.0")))
|
||||
|
|
|
@ -13,15 +13,16 @@
|
|||
(defsubst poly-ein--neuter-markdown-mode ()
|
||||
"Consolidate fragility here."
|
||||
(unless (eq 'ein:notebook-mode (caar minor-mode-map-alist))
|
||||
;; move `ein:notebook-mode' to the head of `minor-mode-map-alist'
|
||||
(when-let ((entry (assq 'ein:notebook-mode minor-mode-map-alist)))
|
||||
(setf minor-mode-map-alist
|
||||
(cons entry
|
||||
(assq-delete-all 'ein:notebook-mode minor-mode-map-alist)))))
|
||||
(when (eq major-mode 'markdown-mode)
|
||||
(poly-ein--remove-hook "markdown" after-change-functions)
|
||||
(poly-ein--remove-hook "markdown" jit-lock-after-change-extend-region-functions)
|
||||
(poly-ein--remove-hook "markdown" window-configuration-change-hook)
|
||||
(poly-ein--remove-hook "markdown" syntax-propertize-extend-region-functions)))
|
||||
(when (eq major-mode 'ein:markdown-mode)
|
||||
(poly-ein--remove-hook "ein:markdown" after-change-functions)
|
||||
(poly-ein--remove-hook "ein:markdown" jit-lock-after-change-extend-region-functions)
|
||||
(poly-ein--remove-hook "ein:markdown" window-configuration-change-hook)
|
||||
(poly-ein--remove-hook "ein:markdown" syntax-propertize-extend-region-functions)))
|
||||
|
||||
(defun poly-ein--narrow-to-inner (modifier f &rest args)
|
||||
(if (or pm-initialization-in-progress (not poly-ein-mode))
|
||||
|
@ -126,11 +127,6 @@
|
|||
(add-function :filter-args (symbol-function 'jit-lock-after-change)
|
||||
#'poly-ein--span-start-end)
|
||||
|
||||
(if (fboundp 'markdown-unfontify-region-wiki-links)
|
||||
(fset 'markdown-unfontify-region-wiki-links #'ignore)
|
||||
(with-eval-after-load "markdown-mode"
|
||||
(fset 'markdown-unfontify-region-wiki-links #'ignore)))
|
||||
|
||||
(add-function :before-until
|
||||
(symbol-function 'pm--synchronize-points)
|
||||
(lambda (&rest args) poly-ein-mode)))
|
||||
|
@ -172,7 +168,7 @@ TYPE can be 'body, nil."
|
|||
(error-message-string err))
|
||||
"python")))
|
||||
(what (cond ((ein:codecell-p cell) lang)
|
||||
((ein:markdowncell-p cell) "markdown")
|
||||
((ein:markdowncell-p cell) "ein:markdown")
|
||||
(t "fundamental")))
|
||||
(mode (pm-get-mode-symbol-from-name what))
|
||||
(_ (not (equal mode (ein:oref-safe cm 'mode)))))
|
||||
|
@ -297,7 +293,8 @@ TYPE can be 'body, nil."
|
|||
(buffer-live-p src-buf)
|
||||
(buffer-live-p dest-buf))
|
||||
(cl-destructuring-bind (point window-start region-begin pos-visible _)
|
||||
(with-current-buffer src-buf (list (point) (window-start)
|
||||
(with-current-buffer src-buf (list (point)
|
||||
(window-start)
|
||||
(and switch (region-active-p) (mark))
|
||||
(pos-visible-in-window-p)
|
||||
(when switch (deactivate-mark))))
|
||||
|
|
|
@ -94,8 +94,7 @@ In \\[111\\]:
|
|||
some input
|
||||
%s" regexp)))))
|
||||
|
||||
(defmacro eintest:gene-test-cell-insert-output-pyout-and-display-data
|
||||
(name regexps outputs)
|
||||
(defmacro eintest:gene-test-cell-insert-output-pyout-and-display-data (name regexps outputs)
|
||||
(declare (indent defun))
|
||||
(let ((test-pyout
|
||||
(intern (format "ein:cell-insert-output-pyout-%s" name)))
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
(require 'ein-cell)
|
||||
(require 'ein-testing-cell)
|
||||
|
||||
|
||||
;;; ein:cell-from-json
|
||||
|
||||
(defun eintest:cell-from-json (data &rest args)
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
(require 'ein-output-area)
|
||||
|
||||
(defun ein:testing-insert-html--fix-urls-do-test (source desired)
|
||||
(setq source (ein:xml-parse-html-string source))
|
||||
(setq desired (ein:xml-parse-html-string desired))
|
||||
(ein:insert-html--fix-urls source 8888)
|
||||
(should (equal source desired)))
|
||||
(let ((s (ein:xml-parse-html-string source))
|
||||
(d (ein:xml-parse-html-string desired)))
|
||||
(ein:insert-html--fix-urls s 8888)
|
||||
(should (equal s d))))
|
||||
|
||||
(defmacro ein:testing-insert-html--fix-urls-deftests (args-list)
|
||||
`(progn
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
(custom-set-variables '(company-frontends nil)
|
||||
'(python-indent-guess-indent-offset-verbose nil)
|
||||
'(ein:jupyter-use-containers nil))
|
||||
'(ein:jupyter-use-containers nil)
|
||||
'(ein:output-area-inlined-images t))
|
||||
|
||||
(require 'python)
|
||||
(require 'ein-dev)
|
||||
|
|
Loading…
Add table
Reference in a new issue