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
Daniel Borchmann 12 months ago
parent cedaae00e8
commit eafebe1cb9
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
  1. 8
      site-lisp/db-utils.el

@ -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…
Cancel
Save