
Show HN: Fltrdr – A TUI Text Reader for the Terminal - octobanana
https://github.com/octobanana/fltrdr
======
octobanana
For the past month, I've been working on this terminal text reader project for
fun. It started out as a project to learn more about how to structure and
implement a text-based user interface with vi inspired features. It's written
in C++17 and is released under the MIT license. I wanted to share it here in
case someone may find it interesting.

Fltrdr, or flat-reader, is an interactive text reader for the terminal. It is
flat in the sense that the reader is word-based. It creates a horizontal
stream of words, ignoring all newline characters and reducing sequential
whitespace. Its purpose is to facilitate reading, scanning, and searching
text. The program also has a play mode that moves the reader forward one word
at a time, along with a configurable words per minute (WPM) setting.

It is highly customizable, with a configuration file to persist your settings.
The colourscheme can be changed to match your environments theme using either
24-bit, 8-bit, or 4-bit colours, depending on what your terminal supports. The
characters used for the text border and progress bar can be set to a character
or unicode-character of your choice. Some of the UI elements, such as the
border, progress bar, and status bar can be individually shown/hidden to
create a more minimalistic display.

I'm open to any feedback or suggestions!

This blog post from the other week contains videos of it in action:
[https://octobanana.com/blog/terminal-text-reader-
demo](https://octobanana.com/blog/terminal-text-reader-demo)

It can be found here on GitHub:
[https://github.com/octobanana/fltrdr](https://github.com/octobanana/fltrdr)

It can also be found here on my personal site:
[https://octobanana.com/software/fltrdr](https://octobanana.com/software/fltrdr)

~~~
nmstoker
Thanks for posting this.

One bit of feedback: I think the video should be linked more prominently and
from the README - I guessed that might be what it was for the description is a
bit vague and abstract and "seeing is believing"

~~~
octobanana
That's a good idea, thanks! I'll make an updated video of it and add a link to
it in the README.md.

~~~
fouc
alternatively, make an animated gif to replace the static image.

an animated gif made from a portion of that second video on that blog post
would be pretty good I think.

------
JdeBP
* It is interesting to see this written in "modern" C++.

* Those input handlers (you have three) are terrible; pattern matching is the wrong way to go about this.

* You could no doubt get more imaginative with the progress bar using block characters.

* Users will no doubt ask for the ability to suspend such a program; which, note, has to properly tear the whole UI down and set it back up again.

* Users will also no doubt want this to work properly with the full range of Unicode text; you have not accounted for differing character widths, that I can see. Note that there exist zero-width characters and double-width characters.

* vi sentence, paragraph, and section motions are of course actually {, }, (, ), [[, and ]].

Some help:

* [https://unix.stackexchange.com/a/499139/5132](https://unix.stackexchange.com/a/499139/5132)

* [https://unix.stackexchange.com/a/444270/5132](https://unix.stackexchange.com/a/444270/5132)

* [http://jdebp.eu./Softwares/nosh/guide/commands/TERM.xml](http://jdebp.eu./Softwares/nosh/guide/commands/TERM.xml)

* [http://jdebp.eu./Softwares/nosh/guide/commands/TerminalCapab...](http://jdebp.eu./Softwares/nosh/guide/commands/TerminalCapabilities.xml)

* [https://github.com/jdebp/nosh/blob/master/source/ECMA48Decod...](https://github.com/jdebp/nosh/blob/master/source/ECMA48Decoder.cpp#L290)

* [https://github.com/jdebp/nosh/blob/master/source/TUIInputBas...](https://github.com/jdebp/nosh/blob/master/source/TUIInputBase.cpp#L281)

* [https://github.com/neovim/libtermkey/blob/master/driver-csi....](https://github.com/neovim/libtermkey/blob/master/driver-csi.c)

* [https://vt100.net/emu/dec_ansi_parser](https://vt100.net/emu/dec_ansi_parser)

------
SkyMarshal
What does it read? Text files? Web sites? Maybe I missed it but I don’t see
this mentioned on the github page.

~~~
octobanana
It works best with any plain ASCII text. What I've been doing is taking PDF's
and using `pdftotext` and `iconv` to convert documents into plain text. I'll
add more information on this in the README.md to make it more clear what it
reads.

------
yuchi
Thanks for sharing! I’ve been searching for months for an idea to try out
Rust, and now I think I found it!

In case would you offend if I tried to port it?

~~~
octobanana
I'd be stoked if you did, It would be interesting to see how the program would
look in Rust.

------
kissgyorgy
a demo would be nice, something with
[https://asciinema.org](https://asciinema.org) or similar so we can get a feel
of how it works without installing it.

~~~
octobanana
This blog post from last week has two videos of it in action. The first one
demos some of the features, while the second reads a bit of a book
uninterrupted for 2 minutes.

[https://octobanana.com/blog/terminal-text-reader-
demo](https://octobanana.com/blog/terminal-text-reader-demo)

------
lsh
what is a 'TUI' ?

~~~
cutety
Text-based User Interface

[https://en.wikipedia.org/wiki/Text-
based_user_interface](https://en.wikipedia.org/wiki/Text-based_user_interface)

