diff options
Diffstat (limited to 'custom')
-rw-r--r-- | custom/jao-custom-eww.el | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/custom/jao-custom-eww.el b/custom/jao-custom-eww.el index 1b766c9..cdd5c8d 100644 --- a/custom/jao-custom-eww.el +++ b/custom/jao-custom-eww.el @@ -157,33 +157,6 @@ (pop-to-buffer buff) (goto-char (point-min)))) -;;; rdrview -;; https://jiewawa.me/2024/04/another-way-of-integrating-mozilla-readability-in-emacs-eww/ -(define-minor-mode eww-rdrview-mode - "Toggle whether to use `rdrview' to make eww buffers more readable." - :lighter " R" - (if eww-rdrview-mode - (progn - (setq eww-retrieve-command '("rdrview" "-T" "title,sitename,body" "-H")) - (add-hook 'eww-after-render-hook #'eww-rdrview-update-title)) - (progn - (setq eww-retrieve-command nil) - (remove-hook 'eww-after-render-hook #'eww-rdrview-update-title)))) - -(defun eww-rdrview-update-title () - "Change title key in `eww-data' with first line of buffer. -It should be the title of the web page as returned by `rdrview'" - (save-excursion - (goto-char (point-min)) - (plist-put eww-data :title (string-trim (thing-at-point 'line t)))) - (eww--after-page-change)) - -(defun eww-rdrview-toggle-and-reload () - "Toggle `eww-rdrview-mode' and reload page in current eww buffer." - (interactive) - (if eww-rdrview-mode (eww-rdrview-mode -1) - (eww-rdrview-mode 1)) - (eww-reload)) ;;; auto-readable (defvar jao-eww-auto-readable-urls (regexp-opt '("guardian.co.uk" "theguardian.com" "github.com" "eldiario.es"))) @@ -193,6 +166,7 @@ It should be the title of the web page as returned by `rdrview'" (eww-readable))) (add-hook 'eww-after-render-hook #'jao-eww-autoread) + ;;; package (use-package shr :custom ((shr-width nil) @@ -210,12 +184,7 @@ It should be the title of the web page as returned by `rdrview'" (eww-download-directory jao-sink-dir) (eww-header-line-format " %u") (eww-form-checkbox-selected-symbol "☒") - (eww-buffer-name-length 180) - ;; (eww-readable-urls '("guardian\\.co\\.uk" - ;; "theguardian\\.com" - ;; "eldiario\\.es" - ;; "theconversation")) - ) + (eww-buffer-name-length 180)) :config (with-eval-after-load "org" (require 'ol-eww nil t)) |