Show HN: Fltrdr – A Vi Inspired Text Reader for the Terminal
octobanana.comThis looks like a dupe of https://news.ycombinator.com/item?id=19195819. Also, please don't do promotional voting and especially not booster comments in the threads! Our software picks up most of it and HN users figure it out too, and then they get mad and flag things (or worse).
The majority of the program has been redesigned and rewritten since the initial post 50 days ago, so I thought it would be alright to make another one. The Show HN rules say that 'A major overhaul is probably ok'. Would that still classify this as a dupe? Honestly, I was just excited of the progress made and what I had learned, and wanted to share/discuss it with others.
I didn't engage in any kind of promotional voting. It's free software given away under the MIT license. I don't gain anything from other people using it.
Ok, that does sound like a reasonable resubmission of a Show HN. Sorry I didn't understand that! I'll take off the dupe tag.
However, these comments are obviously promotional and there were votes to match:
https://news.ycombinator.com/item?id=19629221
https://news.ycombinator.com/item?id=19629229
https://news.ycombinator.com/item?id=19629238
If you didn't arrange that, someone else must have. We banned those accounts of course.
Hello! My name is Brett. For the past couple years I've been teaching myself how to program and engineer software, with a focus on C++ and Linux.
Lately, I've been interested in learning how text-based user interface (TUI) programs such as vi, vim, or less are implemented. I decided the best way to learn would be to build and implement my own TUI program, without relying on existing TUI frameworks/libraries. I went with the core idea of the program being a text reader, and decided to call it Fltrdr.
Fltrdr, or flat-reader, is a TUI text reader that runs in the terminal. It is flat in the sense that the reader is word-based. New line characters and sequential whitespace is stripped from the input text, leaving the reader with a stream of words. The words are then presented one or more at a time, moving one word forward at a user defined words per minute (WPM) variable speed.
For the past two months, I've continued to build upon Fltrdr, learning much along the way. It's written in C++17 and is distributed under the MIT License. I wanted to share the progress that has been made since the initial release, and some of the challenges that I've encountered along the way.
Supporting Unicode text was the most challenging feature. At the start, I knew very little about Unicode, and even less about what a code unit, code point, or grapheme cluster was. After a lot of research, I ended up gaining a decent understanding of what needed to be done to support inputting, manipulating, and rendering UTF-8 text, including full-width CJK Unified Ideographs. I ended up using parts of the ICU library to provide certain UTF-8 algorithms to build a non-memory-owning string view class, an owning-memory string class, and a non-memory-owning string view regex iterator. A majority of the program had to be rewritten to support this, all the way down to the keyboard/mouse input handler.
Another highly requested feature was the ability to save and restore where when last left off reading a piece of text, which is now implemented in the latest release. It works by taking an SHA256 hash of the content, and uses the hash as the file name. The current reader state is then dumped as regular commands into the file. These commands are the same ones that may be placed in the configuration file, or inputted into the programs command prompt. This process reuses the existing command parser. When that same content is opened again, Fltrdr will automatically check to see if a state file exists using a hash of the content, and loads the state if a matching file is found. This allows the ability to load and save the state whether the content came from a file, or stdin.
Lastly, more configuration options are available, with nearly everything being able to be customized.
I'm open to any feedback or suggestions, and I'd be happy to answer any questions!
For more details on what has changed, check out the release notes here: https://github.com/octobanana/fltrdr/releases/tag/0.3.0
It can be found here on GitHub: https://github.com/octobanana/fltrdr
It can also be found here on my personal site: https://octobanana.com/software/fltrdr
This is amazing, well done!
Very well coded and documented.
The best thing I have seen today!