From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yoni Rabkin Newsgroups: gmane.emacs.devel Subject: Re: "Readability" feature in eww Date: Sun, 02 Nov 2014 21:30:31 -0500 Message-ID: <8761ex10e0.fsf@rabkins.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414981859 2832 80.91.229.3 (3 Nov 2014 02:30:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2014 02:30:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 03 03:30:52 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xl7Pv-0005Kj-JN for ged-emacs-devel@m.gmane.org; Mon, 03 Nov 2014 03:30:51 +0100 Original-Received: from localhost ([::1]:60019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl7Pv-00026H-6I for ged-emacs-devel@m.gmane.org; Sun, 02 Nov 2014 21:30:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl7Pl-00026B-SJ for emacs-devel@gnu.org; Sun, 02 Nov 2014 21:30:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xl7Pe-0001Bx-3n for emacs-devel@gnu.org; Sun, 02 Nov 2014 21:30:41 -0500 Original-Received: from smtprelay0184.hostedemail.com ([216.40.44.184]:42589 helo=smtprelay.hostedemail.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl7Pd-0001B1-UJ for emacs-devel@gnu.org; Sun, 02 Nov 2014 21:30:34 -0500 Original-Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id BE8B32691CE for ; Mon, 3 Nov 2014 02:30:32 +0000 (UTC) X-Session-Marker: 796F6E69407261626B696E732E6E6574 X-HE-Tag: oil58_791d3b04ddb37 X-Filterd-Recvd-Size: 2233 Original-Received: from yrk-ThinkPad-T410.rabkins.net (c-75-69-93-148.hsd1.nh.comcast.net [75.69.93.148]) (Authenticated sender: yoni@rabkins.net) by omf06.hostedemail.com (Postfix) with ESMTPA for ; Mon, 3 Nov 2014 02:30:32 +0000 (UTC) X-Ethics: Use GNU In-Reply-To: (Lars Magne Ingebrigtsen's message of "Mon, 03 Nov 2014 01:41:14 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.40.44.184 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:176247 Archived-At: Lars Magne Ingebrigtsen writes: > It occurred to me that it would probably make sense for eww to have a > "readability" feature a couple of hours ago, so I implemented a take on > it and committed it. > > The `R' command in eww will try to find the parts of the current page > where most of the text is, and only display that part. This makes all > the menus and stuff disappear, and you don't have to page forever to > find the actual article on newspaper sites. > > This is a heuristic, of course, so it can be tweaked endlessly. The > current algorithm just gives most words a positive score, HTML markup a > negative score, and words inside tags a negative score. For such a > simple algorithm, it seems to give pretty good results. > > But tweaking is necessary for it to be ... better. If anybody has ideas > for tweaks or better algorithms, please be my guest and have at it. One thing I've found significantly increases readability for me is far simpler: I disable color in `eww-tag-body'. Rendering color, especially background color, doesn't necessarily make sense when you use a purely textual display. I always work with a dark background, so when Eww renders a full white background and, say, light blue text the page becomes unreadable. I could send in a patch which makes color rending in the body optional; it's definitely how I will be using Eww going forward. -- "Cut your own wood and it will warm you twice"