[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: Generic "read-mode" filter [SNIPPET INCLUDED] [UPDATE]



Hi There.
> > Some weeks or months ago, someone on the list complained about emacs-w3m
> > not having a 'reader-mode', such as exists in firefox (and other
> > browsers?). The idea is an option to remove all distracting material
> > from a page so the user can concentrate on reading content.
> > ......
> > Instead of offering it as a patch, I decided to present it as a snippet,
> > but IMO it should be added to the default filters for the project if the
> > project deems it desirable.

I have been using those 3 filters for several weeks.

My var w3m-filter-configuration has this value:
--8<---------------cut here---------------start------------->8---
((t "filter for stackexchange.com" "\\`http[s]?://www.stackexchange\\.com/" w3m-filter-stackexchange)
 (t "filter for youtube.com" "\\`http[s]?://www.youtube\\.com/" w3m-filter-youtube)
 (t "generic page header filter" "\\`http[s]?://" w3m-filter-generic-page-header)
 (t
  ("Strip Google's click-tracking code from link urls" "Google の click-tracking コードをリンクの url から取り除きます")
  "\\`https?://[a-z]+\\.google\\." w3m-filter-google-click-tracking)
 (t
  ("Align table columns vertically to shrink the table width in Google" "Google 検索結果のテーブルを縦方向で揃えて幅を狭めます")
  "\\`http://\\(www\\|images\\|news\\|maps\\|groups\\)\\.google\\." w3m-filter-google-shrink-table-width)
 (t
  ("Add name anchors that w3m can handle in all pages" "すべてのページに w3m が扱える name アンカーを追加します")
  #1="" w3m-filter-add-name-anchors)
 (t
  ("Substitute disabled attr with readonly attr in forms" "フォーム中の disabled 属性を readonly 属性で代用します")
  #1# w3m-filter-subst-disabled-with-readonly)
 (nil
  ("Render <tfoot>...</tfoot> after <tbody>...</tbody>" "テーブル内の <tfoot> を <tbody> の後に描画します")
  #1# w3m-filter-fix-tfoot-rendering)
 (t "Filter top and bottom cruft for rt.com" "\\`https://www.rt\\.com/"; w3m-filter-rt)
 (t "Filter for slashdot" "\\`http[s]?://\\([a-z]+\\.\\)?slashdot\\.org/" w3m-filter-slashdot)
 (t "GNOME Bugzilla - ignore <pre class=\"bz_comment_text\">
   in order to fold long lines" "\\`https://bugzilla\\.gnome\\.org/show_bug\\.cgi\\?id="; w3m-filter-gnome-bugzilla)
 (nil
  ("Remove garbage in http://www.geocities.co.jp/*"; "http://www.geocities.co.jp/* でゴミを取り除きます")
  "\\`http://www\\.geocities\\.co\\.jp/"; w3m-filter-geocities-remove-garbage)
 (nil
  ("Remove ADV in http://*.hp.infoseek.co.jp/*"; "http://*.hp.infoseek.co.jp/* で広告を取り除きます")
  "\\`http://[a-z]+\\.hp\\.infoseek\\.co\\.jp/"; w3m-filter-infoseek-remove-ads)
 (nil
  ("Remove ADV in http://linux.ascii24.com/linux/*"; "http://linux.ascii24.com/linux/* で広告を取り除きます")
  "\\`http://linux\\.ascii24\\.com/linux/"; w3m-filter-ascii24-remove-ads)
 (nil "A filter for Google" "\\`http://\\(www\\|images\\|news\\|maps\\|groups\\)\\.google\\." w3m-filter-google)
 (nil "A filter for Amazon" "\\`https?://\\(?:www\\.\\)?amazon\\.\\(?:com\\|co\\.\\(?:jp\\|uk\\)\\|fr\\|de\\)/" w3m-filter-amazon)
 (nil
  ("A filter for Mixi.jp" "ミクシィ用フィルタ")
  "\\`https?://mixi\\.jp" w3m-filter-mixi)
 (nil "A filter for http://eow.alc.co.jp/*/UTF-8*"; "\\`http://eow\\.alc\\.co\\.jp/[^/]+/UTF-8"; w3m-filter-alc)
 (nil
  ("A filter for Asahi Shimbun" "朝日新聞用フィルタ")
  "\\`http://www\\.asahi\\.com/"; w3m-filter-asahi-shimbun)
 (nil "A filter for http://imepita.jp/NUM/NUM*"; "\\`http://imepita\\.jp/[0-9]+/[0-9]+"; w3m-filter-imepita)
 (nil "A filter for http://allatanys.jp/*"; "\\`http://allatanys\\.jp/"; w3m-filter-allatanys)
 (nil "A filter for Wikipedia" "\\`http://.*\\.wikipedia\\.org/"; w3m-filter-wikipedia)
 (nil
  ("Remove inline frames in all pages" "すべてのページでインラインフレームを取り除きます")
  #1# w3m-filter-iframe))
  --8<---------------cut here---------------end--------------->8---

Probably It should be a function:
w3m-filter-configuration-remove-function-from-list for removing one of the filters
(with some ido help for the function names)

Thanks Boruch for sharing your filters.
Best Regards