项目作者: sanel

项目描述 :
Read html content without clutter from Emacs
高级语言: Emacs Lisp
项目地址: git://github.com/sanel/declutter.git
创建时间: 2018-06-12T09:39:54Z
项目社区:https://github.com/sanel/declutter

开源协议:

下载


declutter - Read html content without clutter from your Emacs

declutter is a small Emacs addon that will help you with reading
online content. It will remove all distractions and present you with
readable html, straight inside your Emacs.

declutter can render content using:

Installation

declutter depends on json.el
and shr.el. shr.el
is part of Emacs since 24.4 version.

To install declutter, just copy declutter.el to $HOME/.emacs.d
folder or any other location listed in Emacs load-path variable.

In your
Emacs init file,
put:

  1. (require 'declutter)

Then, in Emacs:

M-x declutter [RET]

and enter url you’d like to visit.

Usage

By default, declutter will open *declutter* buffer and render cleaned
content in it. Actually, this is done by shr.el so all default
shortcuts for it works here as well.

declutter adds another useful function -
declutter-under-point. When you read through the article and you’d
like to open url, you place cursor over link and you have two options:

  • You can use shr-browse-url (v key) which will open article as is
  • Or you can use declutter-under-point to load that url and render
    cleaned content in *declutter* buffer.

To change rendering engine (default is outline.com API), use this:

  1. (setq declutter-engine 'lynx) ; lynx will get and render html
  2. ; or
  3. (setq declutter-engine 'rdrview) ; rdrview will get and render html
  4. ; or
  5. (setq declutter-engine 'eww) ; eww will get and render html
  6. ; or
  7. (setq declutter-engine 'txtify) ; txtify.it will get and render html

For lynx and rdrview engines, you can set a custom path to the
program binary, with declutter-engine-path. For example, if you have
rdrview installed in /opt/rdrview/bin/rdrview, set it with:

  1. (setq declutter-engine-path "/opt/rdrview/bin/rdrview")

Configuration

declutter doesn’t have many configuration options, except of
declutter-engine, declutter-engine-path and declutter-user-agent
(where you can override default user-agent string), but if you want to
set default font of rendered content or indentation, check
shr.el
options.

For example, to use default Emacs fonts and add margins, set this:

  1. (setq
  2. shr-use-fonts nil
  3. shr-indentation 2)

Note

When declutter is using txtify.it backend to
render the content, be aware that txtify.it can see what you
browse. I’m not affiliated with txtify.it in any way.

Bug reports & patches

Feel free to report any issues you find or you have suggestions for improvements.