WebClip
A Firefox extension to help me save bits of online text to Emacs org-mode.
The personal quirks I demanded from this extension are:
- Group bits from an article under the same heading.
- Have a workaround to select the relevant link in rss readers, or other aggregators.
For 1:
I use 2 capture templates in Emacs, one for the first bit I save in a specific page and another for the next ones. This allows me to create a heading when I save the first bit, and then just append text to it. You can define the names of these templates in the extension options. The templates I use in Emacs are:
(setq org-capture-templates
'(
("n"
"New"
entry
(file+headline
"/path/to/clips.org"
"clips")
"\n\n* %:description\n[[%:link][⦿]]\n\n%i"
:immediate-finish t :jump-to-captured nil)
("a"
"Append"
plain
(file
"/path/to/clips.org")
"\n\n%i"
:immediate-finish t :jump-to-captured nil)
)
)This will make something that looks like this:
For 2:
In a normal page, it would be ok to send its link and title as the link and title of the article you are reading. In an aggregator, like an rss reader, you would have dozens of different articles under the same meaningless link and title. To solve this, you have the option to define a node from where to grab the link/title via css selectors (see extension options) in a specific page.
For example, in my TinyTinyRSS instance, the link/title can be found in .Selected .cdmHeader .titleWrap .title
Instructions
- Clone
./build.sh(will zip the extension and place the native manifest and application where firefox can find them, only works in Linux but would require small changes to work in other systems, see mdn)- Install add-on from file in
about:addons - Start the emacs server:
(server-start)
(require 'org-protocol)- Make your capture templates
Usage
Open a page in Firefox, select text, press Alt+Space (you can redefine this combo in manifest.json)
