add eww page to collection
This commit is contained in:
parent
a301634140
commit
9efeff0dd9
|
|
@ -224,6 +224,25 @@
|
||||||
".html")))
|
".html")))
|
||||||
(concat timestamp "_" (file-name-sans-extension full-path) extension)))
|
(concat timestamp "_" (file-name-sans-extension full-path) extension)))
|
||||||
|
|
||||||
|
(defun collect/add-eww-page-to-collection ()
|
||||||
|
"Add the current eww page to a specified collection."
|
||||||
|
(interactive)
|
||||||
|
(if (eq major-mode 'eww-mode)
|
||||||
|
(progn
|
||||||
|
(eww-copy-page-url)
|
||||||
|
(let* ((url (read-string "Enter URL to add: " (current-kill 0)))
|
||||||
|
(collections (collect/get-collections))
|
||||||
|
(selected-collection (completing-read "Select collection to add to: "
|
||||||
|
(mapcar #'car collections) nil t))
|
||||||
|
(target-dir (cdr (assoc selected-collection collections))))
|
||||||
|
(if (and url (file-directory-p target-dir))
|
||||||
|
(progn
|
||||||
|
(message "Adding webpage to collection...")
|
||||||
|
(collect/add-webpage-to-collection-internal url target-dir selected-collection))
|
||||||
|
(message "Invalid URL or collection directory."))))
|
||||||
|
(message "This function can only be used in eww-mode.")))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-collect)
|
(provide 'module-collect)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue