aome510 / hackernews-tui Goto Github PK
View Code? Open in Web Editor NEWA Terminal UI to browse Hacker News
License: MIT License
A Terminal UI to browse Hacker News
License: MIT License
Right now I use https://hn.algolia.com/ to browse the most popular stories of the past week or month.
Would be awesome if these could be added as well to hackernews-TUI.
I set http and https proxy before invoke hacknews_tui
export https_proxy=http://127.0.0.1:6152;export http_proxy=http://127.0.0.1:6152
But it did not work. I didn't find how to config http proxy in config file either.
Hi,
thanks a lot for just the greatest HN TUI! fantastic work! The only thing is lacking and, IMHO, it's a major issue (but very easy to add): the loading progress visualisation.
Otherwise it feels like your brain is itching inside, lol :) Almost physical thing!
Or if by some reason there is one and I'm missing it... Just let me know :)
Thanks!
Feature request
f {link_id}
).I am unable to open the article view inside the terminal.
The description tells me to configure the 'article_parse_command' option as described on the link:
https://github.com/aome510/hackernews-TUI/blob/main/config.md#article-parse-command
But that blob doesn't exist.
What am I doing wrong?
TODO list upon the release of the version v0.1
:
README.md
for the application specification.crates.io
aur
On both machines I have (Void-Linux & NetBSD) I cannot get it to load my theme configuration from the hn-tui.toml
file.
This is my ~/.config/hn-tui.toml
(which I shamelessly borrowed directly from another user - yes, it works for them).
# hn-tui.toml
allow_unicode = false
page_scrolling = true
scroll_offset = 3
url_open_command = "firefox"
article_parse_command = {command = "mercury-parser", options = ["--format", "markdown"]}
[story_pooling]
enable = true
delay = 2
allows = ["front_page"]
[client]
client_timeout = 32
[client.story_limit]
search = 10
front_page = 20
story = 20
ask_hn = 15
show_hn = 15
job = 15
[theme]
background = "#d9d5ba"
shadow = "#000000"
view = "#f6f6ef"
primary = "#4a4a48"
secondary = "#a5a5a5"
tertiary = "#d9dfba"
title_primary = "#000000"
title_secondary = "#ffff00"
highlight = "#6c6c6c"
highlight_inactive = "#0000ff"
highlight_text = "#c3bbbb"
link_text = "#4fbbfd"
link_id_bg = "#ffff00"
search_highlight_bg = "#ffff00"
status_bar_bg = "#ff6600"
code_block_bg = "#c8c8c8"
[keymap.global_keymap]
open_help_dialog = "?"
quit = "C-q"
close_dialog = "esc"
goto_previous_view = "C-p"
goto_front_page_view = "C-f"
goto_search_view = "C-s"
goto_all_stories_view = "C-z"
goto_ask_hn_view = "C-x"
goto_show_hn_view = "C-c"
goto_jobs_view = "C-v"
[keymap.story_view_keymap]
next_story = "j"
prev_story = "k"
goto_story = "g"
next_page = "n"
prev_page = "p"
toggle_sort_by = "d"
open_article_in_browser = "o"
open_article_in_article_view = "O"
open_story_in_browser = "s"
goto_story_comment_view = "enter"
[keymap.search_view_keymap]
to_navigation_mode = "esc"
to_search_mode = "i"
[keymap.comment_view_keymap]
next_comment = "j"
prev_comment = "k"
next_top_level_comment = "n"
prev_top_level_comment = "p"
next_leq_level_comment = "l"
prev_leq_level_comment = "h"
down = "down"
up = "up"
page_down = "page_down"
page_up = "page_up"
open_comment_in_browser = "c"
open_link_in_browser = "f"
open_link_in_article_view = "F"
reload_comment_view = "r"
[keymap.article_view_keymap]
down = "j"
up = "k"
page_down = "d"
page_up = "u"
top = "t"
bottom = "b"
open_article_in_browser = "o"
open_link_in_browser = "f"
open_link_in_article_view = "F"
open_link_dialog = "l"
link_dialog_focus_next = "j"
link_dialog_focus_prev = "k"
toggle_raw_markdown_mode = "T"
Even when running:
$ hackernews_tui -c ~/.config/hn-tui.toml
It still loads the default config. Any reason why it wouldn't be reading this file and just loading the default config?
page_scrolling
, story_pooling
.cargo.toml
and change version
variable in main.rs
.The current implementation doesn't involve any explicit lifetime annotations. A lot of workarounds involves cloning and copying data.
TODO:
Prepare for the upcoming release v0.2
.
There will be a lot of changes and improvements compared to the last version (v0.1.2.1
).
At the moment, I am able to set a solid color as background:
[theme.palette]
background = "#333333"
Is it possible to have a transparent one?
Add support for parsing a config file (possibly in .config/hackernews-tui.conf
) into a global config struct.
HN API calls + parsing for a comment view of a story with many comments can be quite slow. A loading screen should be added to avoid possible confusion to users.
Suggestions:
Currently, the url_open_command
has a hard-coded default of open
:
hackernews-TUI/hackernews_tui/src/config/mod.rs
Lines 51 to 54 in 3da2bc0
That is (AFAIK) a MacOS-ism. On most Linux systems, the equivalent command is xdg-open
. Since we're compiling separate binaries for each anyways, could the default be set to xdg-open
when targeting Linux? This would provide a much more sane default for Linux users.
thread 'main' panicked at 'failed to create application's log file: No such file or directory (os error 2)', hackernews_tui/src/main.rs:132:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace`
It's crashing because the $HOME/.cache
directory does not exist, which is where it wants to create the log file.
After doing:
$ mkdir ~/.cache
...v0.8.0
starts up without issues.
This app looks amazing. I'm often reading HN with an RSS client and I'm thinking of a way to open the comments with hackernews_tui
. Have you considered introducing an optional positional argument that takes a URL and opens the appropriate view directly?
Feature Request
j
to move down a leftmost child.k
to move up to the parentl
to move to the right neighbor.h
to move to the left neighbor.n
to move to the next root comment.p
to move the previous root comment.multipler {motion}
repeat the motion
multiplier
times.t
move to top.b
move to bottom.Change to use algolia APIs instead of HN default apis
This app is great however the one place I feel like it could be a bit better is highlighting. If hn-tui had highlighting to help with human-parsing and making things a little easier on the eyes, or making certain pieces of information more easily apparent or navigable, it would be perfect! This is a feature request for additional highlighting and labeling in the ways that circumflex provides it.
to list out all the different text-highlighting:
Categories:
Ask HN
, Tell HN
, Show HN
and Launch HN
Comments:
code snippets
StoryView
.StoryView
for the most popular stories, the newest stories, etc:
Consider the case where the user has to open the link directly from terminal feed reader like newsboat. Currently a wrapper script to get ID from the url and pass as arg to hackernews-TUI. It would be nice to have a flag to pass entire link as arg. Thank you.
Feature request: support the XDG Base Directory specification by checking $XDG_CONFIG_HOME/hackernews_tui/hn-tui.toml
first, and then falling back to the ~/.config
if it doesn't exist.
Hi,I tried to installed hackernews_tui
using cargo but it gave out compilation error.
Here are the my prompt:
cargo install hackernews_tui
Here are some of the error:
expected `toml::value::Value`, found `toml::Value`
On my machine, I use rust nightly. I attached here the image of some of the error. Thank you.
When opening in article view, it gives the error, failed to execute command:
article_md --format html [url of the article].
Please make sure you have configured the "article_parse_command" option as described in the following link.
The link leads to nowhere. I also can't open articles in the web browsers. Do I need to configure a command line based web browser like Lynx to do that?
I am on the latest version of the app installed via Cargo. The OS is Manjaro [it is capable of installing via Arch repos but cargo gets even earlier updates for Rust applications, hence I chose it over the AUR].
I'm used to hitting a particular keyboard shortcut to open in my browser the article associated with a story. But some stories, e.g. "Ask HN" don't have an associated article. In that case, I would prefer for the story page to be open in the browser. That way, I don't have to switch mental model (and keyboard shortcut) whenever I get to an "internal" story.
In other words, "Open in browser the article associated with the focused story" should default to "Open in browser the focused story" if there is no article associated with the story
Currently on my computer hackernews_tui shows just 19 articles on "front page". How can I make it show more articles?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.