Add simple function to directly render html from a file
This is simpler than opening the file in a buffer and calling shr-render-buffer, with some buffer maneuvring afterwards.master
parent
cedaae00e8
commit
eafebe1cb9
|
@ -20,6 +20,7 @@
|
|||
(require 'calc-forms)
|
||||
(require 'ert)
|
||||
(require 's)
|
||||
(require 'shr)
|
||||
|
||||
(autoload 'async-start "async")
|
||||
(autoload 'lispy-mode "lispy")
|
||||
|
@ -454,6 +455,13 @@ Does not replace CRLF with CRCRLF, and so on."
|
|||
(file-exists-p (concat project "/.git"))))
|
||||
projectile-known-projects))))
|
||||
|
||||
(defun db/shr-render-file (file)
|
||||
"Display the HTML rending of the contents of FILE."
|
||||
(interactive "f")
|
||||
(unless (file-readable-p file)
|
||||
(user-error "Cannot read file: %s" file))
|
||||
(shr-render-buffer (find-file-noselect file)))
|
||||
|
||||
|
||||
;; Base45 Decoding
|
||||
|
||||
|
|
Loading…
Reference in New Issue