Have a clever Org Protocol capture template? Share it with the community! #51
Replies: 2 comments
-
|
This template with key name ("capture"
"Org Protocol Capture"
entry
(file "")
(function (lambda ()
(string-join
'("* %:description"
":PROPERTIES:"
":CREATED: %U"
":END:"
"%:annotation"
"%i"
""
"%?")
"\n")))
:prepend t
:empty-lines 1) |
Beta Was this translation helpful? Give feedback.
-
|
This template with key name This capture template will prompt you to enter the source code language (default ("capture-source"
"Org Protocol Source"
entry
(file "")
(function (lambda ()
(string-join
(list "* Source: %:description"
":PROPERTIES:"
":CREATED: %U"
":END:"
"%:link"
(concat "#+BEGIN_SRC %^{Language|elisp|"
(string-join (list "awk"
"C"
"cpp"
"shell"
"clojure"
"css"
"ditaa"
"eshell"
"F90"
"forth"
"gnuplot"
"sed"
"dot"
"java"
"haskell"
"julia"
"latex"
"lisp"
"lua"
"makefile"
"matlab"
"max"
"js"
"ocaml"
"octave"
"org"
"perl"
"plantuml"
"processing"
"python"
"R"
"ruby"
"sass"
"scheme"
"sql"
"sqlite"
"swift"
"kotlin")
"|")
"}")
"%i"
"#+END_SRC"
""
"%?")
"\n")))
:prepend t
:empty-lines 1)The following JavaScript saved as a bookmark address in a web browser can exercise the above javascript:location.href='org-protocol://capture?template=capture-source&url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection());With said web browser bookmark in place, the following steps can be taken to capture/clip source code from a web page.
An Org capture window akin to looking like this should show up in Emacs.
A similar effect can be achieved using Captee. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Org Protocol capture templates are embarrassingly customizable. Have one that you want to show off? Please share it here!
Also for reference:
Beta Was this translation helpful? Give feedback.
All reactions