[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Capture, template expansion and keyword for link type
From: |
Sébastien Gendre |
Subject: |
Re: Capture, template expansion and keyword for link type |
Date: |
Thu, 11 Jul 2024 22:36:21 +0200 |
User-agent: |
mu4e 1.12.1; emacs 29.4 |
Max Nikulin <manikulin@gmail.com> writes:
> See the "Link type, Available keywords" table in this section.
> `org-capture' may be executed in various Emacs buffers and available
> keywords may depend on major mode.
Is it necessary to call "org-store-link" before calling "org-capture" to
extracet the informations used by theses keywords ?
Or did I missundertant how it work ?
I found the documentation unclear about this.
Is there a way to discover the keywords that a major mode provide to a
capture template ?
Max Nikulin <manikulin@gmail.com> writes:
> Some time ago I tried %(exp) elisp snippets in templates (untested)
>
> "* [[%:link][%:description]]
> #+BEGIN_QUOTE
> %i
> #+END_QUOTE
> %(let ((bla (plist-get (plist-get org-store-link-plist :query) :bla)))
> (or bla "No bla"))"
>
> emacsclient
> 'org-protocol:/capture?template=s&title=Hello&body=World&url=http:%2F%2Fexample.com&bla=foo'
A new parameter added to the org-protocol url is only accessible through
the ":query" key ? It will not create a new "%:keywoard" automatically ?
What I would love to do, is creating a Firefox extension that can
extract different metadata from known well known web site and pass them
to an Org-mode capture through org-protocol.
For example, for a book, extracting author, title, year, etc.
And then, I could simply create a capture template that would use the
keywords "%:author", "%:title", etc.
I was also thinking, instead of a Firefox extension, creating an Elisp
function that take a web page URL as parameter, extract the metadata
from the web page and then call Org-capture providing the keywords
"%:author", "%:title", etc, to the template.
But I don't know how to do the last part and I cant found documentation
about it. And with this second solution, I don't know how to make it
work with org-protocol. As an org-protocol call result directly in an
Org-capture call. And extracting metadata from Firefox give more
flexibility on manually selecting information to extract on the web page.
signature.asc
Description: PGP signature
- Capture, template expansion and keyword for link type, Sébastien Gendre, 2024/07/11
- Capture, template expansion and keyword for link type, Sébastien Gendre, 2024/07/11
- Re: Capture, template expansion and keyword for link type, Ihor Radchenko, 2024/07/11
- Re: Capture, template expansion and keyword for link type, Max Nikulin, 2024/07/11
- Re: Capture, template expansion and keyword for link type,
Sébastien Gendre <=
- Re: Capture, template expansion and keyword for link type, Max Nikulin, 2024/07/12
- Re: Capture, template expansion and keyword for link type, Sébastien Gendre, 2024/07/12
- Re: Capture, template expansion and keyword for link type, Max Nikulin, 2024/07/14