mirror of
https://github.com/aome510/hackernews-TUI.git
synced 2026-04-26 09:25:56 +03:00
[PR #94] [MERGED] Implement Rust native article view as fallback on failed article_parse_command #102
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hackernews-TUI#102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/aome510/hackernews-TUI/pull/94
Author: @0x6b
Created: 8/26/2023
Status: ✅ Merged
Merged: 8/28/2023
Merged by: @aome510
Base:
main← Head:rust-native-article-view📝 Commits (7)
adcd78aImplement Rust native article view as fallback on failedarticle_parse_command1d03f33Useanyhow::Contextinstead ofmap_err28d89b5Pass reference to the client around7a550c5Update to documentation for article parse commanda884812Update error message while constructing article view5e2c836Apply cargo fmt1c2f779Move a paragraph up for clarity📊 Changes
10 files changed (+473 additions, -77 deletions)
View changed files
📝
Cargo.lock(+351 -23)📝
docs/config.md(+10 -5)📝
hackernews_tui/Cargo.toml(+3 -0)📝
hackernews_tui/src/client/mod.rs(+66 -26)📝
hackernews_tui/src/view/article_view.rs(+16 -9)📝
hackernews_tui/src/view/async_view.rs(+11 -7)📝
hackernews_tui/src/view/comment_view.rs(+7 -3)📝
hackernews_tui/src/view/link_dialog.rs(+2 -1)📝
hackernews_tui/src/view/story_view.rs(+1 -1)📝
hackernews_tui/src/view/utils.rs(+6 -2)📄 Description
First of all, thank you for bringing this great TUI for us!
Summary
Implement Rust native article view as fallback on failed
article_parse_command.Context
Current implementation will display a link to the
config.mdfile if thearticle_parse_commandfails. Almost all of new users will see this error. Instead, we can use thereadable-readabilityto provide similar capability as a fallback method. This might be more user friendly and nice default behavior.Dependency Added
readable-readabilityScreenshots
https://news.ycombinator.com/item?id=37214693
article_mdPlease note that it's not perfect for some pages as below, but I think it'd be acceptable.
https://news.ycombinator.com/item?id=25607320
article_mdFinal Words
Quick and not-so-scientific benchmarking shows that the native implementation is faster than the
article_md, separate Node.js CLI, on my setup. This is just a proposal. I'm not sure if it's a good idea to add a new dependency to the project. Feel free to close this PR if you don't like it. If you like it, I'd add commits to update relevant documentation. Thank you!🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.