hermes: fanfiction browser/tracker (part 0, creation)

This year I have been reading a lot of fanfiction. Starting at the end of February I've read an average of 110k words a day (had I written this post two weeks ago it would've been 120k). Keeping track of what I was reading and where in each story I was quickly grew annoying and I moved through a number of solutions.

Attempt 1: Chrome

My initial strategy of opening an individual tab per story quickly hit limitations. I started dumping extra URLs into a flat text file, but this was cumbersome to update and hard to search. I regularly use the OneTab extension which made it easy to do bulk saves/loads but individual changes were not so easy. When traveling without internet I could write a simple bash for loop to echo a bunch of per-chapter URLs and use OneTab to open them all up so no internet access would be required during reading. This works surprisingly well. The key issue though was moving from device to device lost me my place.

Attempt 2: links

My first attempt at addressing the problem was to use links, a text mode browser. This worked a lot better and drastically reduced memomry usage -- I could simply open several copies of links in tmux on a server somewhere and ssh into it to continue reading. Since I have an ssh client for every device I use anyway all the requirements were met -- though this did mean there was no easy "offline" mode. In those cases I continued to use chrome.

What went wrong? When the terminal resizes, links has a weird way of tracking where to scroll to. I still haven't figured it out but I suspect it has a percent-completion value and it simply scrolls to that regardless of the fact that 10% of a thin terminal is a lot less than 10% of a wide terminal.

Attempt 3: vim

vim knows what line you're editing. It tracks it perfectly through terminal resizes. So naturally it was my next choice to address my issues. It keeps the same benefits as links+tmux+ssh while adding an extra processing step. I wrote a small (~10 line) bash script which leveraged wget, xidel, and liberal amounts of sed and tr, to convert raw html into a flat text file. I could either have each paragraph map to a single line in the file and have vim handle wrapping, or default to some lowest common denominator width with a quick application of `fold` -- I chose to go with the latter since I have an effective minimum width anyway. This also allowed me to download all chapters at once effectively giving me the only remaining benefit of chrome.

A few things added to the experience which I bound to a function key to enter "reading" mode. This disabled cursorcolumn and made the current line underlined. The scrolloff was set to something high so the current line was always in the center of the screen.

There were a few main irks left with this setup. I had to explicitly run a script to grab the content, had to manually run a processing step and possibly rerun it on the original source when I wanted to make a change, and place tracking wasn't as automatic as I wanted. I had also taken to shrinking and centering my terminal on wider screens to center the text and knew that could be done automatically.

Attempt 4: hermes

TODO: fill me in

originally posted 2016-11-07