diff options
| author | Craig Jennings <c@cjennings.net> | 2025-09-01 12:52:06 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-09-01 12:52:06 -0500 |
| commit | 33b8a7c60839b2a83a5d0d2c3c85ca147c9a5f74 (patch) | |
| tree | 8ce714b621cdbdf22d22ad0b1b8ded0fbe708016 /modules/org-capture-config.el | |
| parent | aacc66f27442e08a7586dd30307f067c2994b7f8 (diff) | |
| download | dotemacs-33b8a7c60839b2a83a5d0d2c3c85ca147c9a5f74.tar.gz dotemacs-33b8a7c60839b2a83a5d0d2c3c85ca147c9a5f74.zip | |
wip webclipper and org-capture issues
Diffstat (limited to 'modules/org-capture-config.el')
| -rw-r--r-- | modules/org-capture-config.el | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el index b035752b5..55a12e2f8 100644 --- a/modules/org-capture-config.el +++ b/modules/org-capture-config.el @@ -17,7 +17,6 @@ ;;; Code: - ;; ---------------------------- Org Webpage Clipper ---------------------------- ;; Allows saving a copy of the page eww is visiting for offline reading. ;; In other words, it's a "Pocket/Instapaper" that keeps the article in Emacs. @@ -110,13 +109,34 @@ Captured On: %U" (file+headline inbox-file "Shopping List") "* %?") ;; requires cj/org-web-clipper function defined above - ("w" "Web Page Clipper" entry - (file+headline inbox-file "To Read") - "* %a\nURL: %L\nCaptured On:%U\n%(cj/org-webpage-clipper)\n" - :prepend t :immediate-finish t) + ("w" "Web Page Clipper" plain + (function cj/org-roam-capture-webclip) + "" :immediate-finish t) )) ;; end setq ) ;; end use-package org-protocol +;; -------------------------- Org-Roam-Capture-Webclip ------------------------- + +(defun cj/org-roam-capture-webclip () + "Capture current webpage as an org-roam node with webclipped tag." + (let* ((url (plist-get org-store-link-plist :link)) + (title (or (plist-get org-store-link-plist :description) "")) + (body (cj/org-webpage-clipper))) + (org-roam-capture- :node (org-roam-node-create :title title) + :templates '(("w" "webclip" plain "%?" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" + "#+TITLE: ${title} +#+FILETAGS: webclipped +#+ROAM_KEY: ${url} +URL: ${url} +Captured On: %U + +${body}") + :unnarrowed t + :immediate-finish t)) + :props =(:url ,url + :body ,body)))) + ;; ---------------------------- Simple Task Capture ---------------------------- ;; the simplest way to capture a task. Also a simple way to write this function. |
