reader: Web page readability on the CLI

reader is for your command line what the “readability” view is for modern browsers: A lightweight tool offering better readability of web pages on the CLI.

reader: Web page readability on the CLI

With reader I implemented a lightweight tool that makes it possible to have the readability view most people know from modern browsers on the command line. reader parses a web page for its actual content and displays it in nicely highlighted text. In addition, reader renders embedded images from that page as colored block-renders on the terminal as well.

I borrowed most parts of the code from my other projects like Gomphotherium, Journalist, and Canard, where I’ve been doing similar things for Mastodon toots and RSS items. However, reader now allows to use these features bundled in a single command line tool that can be easily integrated into other tools and workflows.

For example, it’s possible to open a website that you’re currently browsing with w3m by pressing ! and running reader $W3M_URL | less -R. It is also possible to integrate reader into VIM/NeoVim by including the following function and mappings in your init.vim:

function s:vertopen_url()
  normal! "uyiW
  let mycommand = "reader " . @u
  execute "vertical terminal " . mycommand
endfunction
noremap <Plug>vertopen_url : call <SID>vertopen_url()<CR>
nmap gx <Plug>vertopen_url

By moving the cursor on a link and pressing g, followed by x VIM will open a new view containing the reader-rendered web page.

reader is open source software and can be downloaded from GitHub. Pre-built releases are available for Linux, OpenBSD, FreeBSD, NetBSD, macOS and Windows.

reader on GitHub

Enjoyed this? Support me via Monero, Bitcoin, Lightning, or Ethereum!  More info.