Skip to content

fritzgrabo/elfeed-webkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elfeed-webkit.el

Render elfeed entries in embedded webkit widgets.

Many feeds render well as text, some don’t. Or maybe you’re interested in a feed entry’s dynamic content that doesn’t get rendered into the feed at all (think comments). Elfeed provides b for this case, which opens an entry’s link in the browser. If you’d rather stay in Emacs and not lose the context of elfeed and its key bindings, this package allows you to render an entry’s link in an embedded webkit widget.

Webkit rendering can be toggled on/off manually, or automatically based on an entry’s tags.

Installation

If you use MELPA, an easy way to install this package is via package-install. Alternatively, download elfeed-webkit.el, put it in your load-path and require it.

If you use both MELPA and use-package, you can use this, too:

(use-package elfeed-webkit
  :ensure
  :after elfeed)

Requirements

Your Emacs needs to have been compiled with support for xwidgets. Try (featurep 'xwidget-internal) if you’re unsure.

Usage and customization Options

Toggle manually

Use M-x elfeed-webkit-toggle to toggle webkit on/off in an elfeed entry buffer. It is recommended to bind that command to a convenient key in elfeed-show-mode-map:

(use-package elfeed-webkit
  :ensure
  :bind (:map elfeed-show-mode-map
              ("%" . elfeed-webkit-toggle)))

Note that when webkit is toggled on in an elfeed entry buffer, the related keybindings from xwidget-webkit-mode-map are superimposed on elfeed-show-mode-map. Best pick a key that’s not bound in either of these maps.

Alternatively, use the elfeed-webkit-enable and elfeed-webkit-disable commands to turn webkit on or off directly.

Enable/Disable based on an entry’s tags

Elfeed entries can also be rendered with or without webkit automatically, based on an entry’s tags. This can be useful if you know that a specific feed never renders well in text, or misbehaves when rendered with webkit. See elfeed’s autotagging feature for how to apply tags to all entries of a given feed.

To set up automatic rendering with webkit based on an entry’s tags, run elfeed-webkit-auto-toggle-by-tag.

By default, entries with either a wk or webkit tag will be rendered with webkit, even if rendering with webkit is toggled off otherwise. The list of tags that triggers webkit is customizable via elfeed-webkit-auto-enable-tags.

Likewise, entries with either a no-wk or no-webkit tag will be rendered as text, even if rendering with webkit is toggled on otherwise. Again, the list of tags is customizable via elfeed-webkit-auto-disable-tags.

Here’s an example setup:

(use-package elfeed-webkit
  :ensure
  :demand ;; !
  :init
  (setq elfeed-webkit-auto-enable-tags '(webkit comics))
  :config
  (elfeed-webkit-auto-toggle-by-tag)
  :bind (:map elfeed-show-mode-map
              ("%" . elfeed-webkit-toggle)))

Keys

In a gist, elfeed-webkit uses the default keys available in elfeed entry buffers, then layers the xwidget webkit keys on top with a select few customizations.

Here are some of the more commonly used keys:

KeyFunction
nshow next item in elfeed search buffer
pshow previous item in elfeed search buffer
umark current entry unread
+add tag(s) to displayed entry
-remove tag(s) from displayed entry
grefresh displayed entry
bgo back in webkit’s browsing history
fgo forward
vvisit current webkit URL in a browser
yyank current webkit URL
aadjust size of widget to fill entire available space

As always, use C-h b to display all defined keys in a buffer.

Screenshot

screenshots/screenshot.gif

  • I start out on the *elfeed-search* buffer with a few Irreal blog posts, and with webkit rendering disabled.
  • I press RET to open the selected entry ”Completing Org Links”; it renders as text.
  • I press % to toggle on webkit rendering, then % one more time to toggle it off again.
  • I press n to go to the next entry, ”Moving to Elfeed”; it renders as text.
  • I press n to go to the next entry, ”Captee”: this entry has the webkit tag mentioned before, and automatically renders with webkit as a result.
  • I press q to quit out to *elfeed-search*.

Related work

About

Emacs: Render elfeed entries in embedded webkit widgets

Resources

License

Stars

Watchers

Forks