From 33b8a7c60839b2a83a5d0d2c3c85ca147c9a5f74 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 1 Sep 2025 12:52:06 -0500 Subject: wip webclipper and org-capture issues --- modules/org-capture-config.el | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'modules/org-capture-config.el') 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. -- cgit v1.2.3