ref: 7a95a17d006e08e02f638b15caba2a56ce590741 roman/src/romanpkg/main.nim -rw-r--r-- 3.7 KiB
Allow toggling read status from post selection

This commit changes many of the main types to be ref objects. This
allows their state to be updated from afar. It was necessary here to
let a post be altered from within a termask promptList and have the
changes immediately shown in the list of choices.
Show helpful message when managing no subscriptions
Add support for editing subscription title

This commit adds a new dependency on the noise library, a Nim
implementation of linenoise. This is being used instead of rdstdin in
the Nim standard library (which wraps linenoise) because it's nice to
give the user the current name as a default when editing, which rdstdin
doesn't allow.
Use generic version of promptList for choosing feed
Implement manage subcommand with unsubscribe support
Properly load posts when subscribed to one feed (fixes #19)
Better use of sequtils procs mapIt/filterIt
Use async/await to download feed contents simultaneously

It turns out that most of the bottleneck in loading the feeds is in
parsing them. This cannot be done in parallel yet because of the
external dependency on html2text.py. I'm going to prioritize
nim-html2text (https://git.sr.ht/~reesmichael1/nim-html2text) now so
that this dependency can be removed and the feeds can be parsed in
Add support for Atom feeds

This commit re-introduces the subscribe subcommand, which in turn forced
a browse subcommand. It also adds a classification based on feed type,
since roman now needs to know if feeds are RSS feeds or Atom feeds.
Immediately update read status on reading a post (closes #4)
Use formatted names for displaying link selections

This change required us to genericize the promptList function, which in
turn forced us to go back to using pure tables (instead of strtabs) for
the hash maps passed to promptList, effectively undoing 8a33f484.
Use strtabs instead of Table[string, string]
Clean up some redundant exception handling
Remove accidentally included echo
Fix sorting of subscribed feeds
Return user to post selection after closing post
Load configuration values from config file

This is a large commit! The types were all moved out of their own
modules into a common types module to avoid circular dependencies with
the config object. It also adds a default config file and starts the
process of moving some of the hardcoded defaults into the file.
Return user to feed selection after viewing a post

This commit adds a new error type, InterruptError, to handle the user
asking us nicely to exit during the selection. This lets us check if
this has been raised after each selection, and if not, return the user
to the beginning. It also fixes a few bugs in the menu paging
Show number of unread posts in feed selection
Revert to using a menu selector and add menu paging

There are still some edge cases that will break (for example, the pager
will break on lines that are longer than the terminal width), and the
instructions interface needs improvement, but this is sufficient for an
initial commit!
Simplify workflow of asking for user input