Skip to content

Instantly share code, notes, and snippets.

@jsrjenkins
Last active July 28, 2023 06:18
Show Gist options
  • Save jsrjenkins/7c58299a5c53778767152464234fed45 to your computer and use it in GitHub Desktop.
Save jsrjenkins/7c58299a5c53778767152464234fed45 to your computer and use it in GitHub Desktop.
Org Capture for Conkeror
;; place this snippit in your .init.el or with your the other
;; org-capture templates to capture web pages.
(setq org-capture-templates
'(("w" "Web Notes" entry ;; 'w' for 'org-protocol'
file+headline "~/org/notes.org" "WWW")
"* %^{Title}\n\n Source: %u, %c\n\n %i") ))
// org-protocol: allows you to capture the url, title and selection
// and insert it into your notes.org file
// you will need to setup org-capture-templates to receive it.
function org_capture (url, title, selection, window) {
var cmd_str =
'emacsclient \"org-protocol:/capture:/w/'+url+'/'+title+'/'+selection+'\"';
if (window != null) {
window.minibuffer.message('Issuing ' + cmd_str);
}
shell_command_blind(cmd_str);
}
interactive("org-capture", "Clip url, title, and selection to capture via org-protocol",
function (I) {
org_capture(encodeURIComponent(I.buffer.display_uri_string),
encodeURIComponent(I.buffer.top_frame.getSelection()),
I.window);
});
// capture with C-c c
define_key(content_buffer_normal_keymap, "C-c c", "org-capture");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment