Code Monkey home page Code Monkey logo

hackernews-tui's People

Contributors

0x6b avatar adrianvollmer avatar aome510 avatar byron avatar huyz avatar lucasfa avatar parasew avatar rashil2000 avatar vishalsodani avatar vladdoster avatar zakwanhisham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hackernews-tui's Issues

`v0.8.0` crashes on startup, fails to create log file

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.

[Feature Request] Add flag to use entire url

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.

Default to opening story in browser if there is no article

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

How to configure proxy?

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.

Release v0.1!

TODO list upon the release of the version v0.1:

  • research theme for better user experience.
  • add README.md for the application specification.
  • release on crates.io
  • release on archlinux aur

"Failed to get stories" on FreeBSD

Hello,

Would you have any idea why the client fails to get stories on an ec2 FreeBSD machine, yet a curl works just fine please?

Installed via cargo install hackernews_tui --locked

Thanks!

Screenshot 2023-12-21 at 14 11 03 Screenshot 2023-12-21 at 14 11 29

Wont read hn-tui.toml

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?

Implement link parser

Feature request

  • add support for link parser:
    • the parser will look for external links in the current view and allow users to open a link (e.g. via f {link_id}).
    • instead of displaying the full link, only show a link prefix (e.g first 20 characters).

Support adding config file

Add support for parsing a config file (possibly in .config/hackernews-tui.conf) into a global config struct.

Release v0.2!

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).

The greatest TUI client so far, bat the progress [bar] is absolute must!

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!

Add loading screen

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:

Add navigation for comment view

Feature Request

  • add support for navigating in the comment tree view. It may involve:
    • j to move down a leftmost child.
    • k to move up to the parent
    • l 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.

Could not compile `hackernews_tui` due to errors

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.

image

vi mode

Hi,

@aome510 any plans for this one?

Anyone around interested in?

Thanks a lot

Feature request: open the app at a specific comment view

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?

'open' command on Linux

Currently, the url_open_command has a hard-coded default of open:

url_open_command: Command {
command: "open".to_string(),
options: vec![],
},

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.

Prepare for V0.4!

  • add documentation for file configuring.
  • add documentation for page_scrolling, story_pooling.
  • update cargo.toml and change version variable in main.rs.

Include useful font-highlighting similar to circumflex

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:

  • highlight headlines with Ask HN, Tell HN, Show HN and Launch HN

Comments:

  • colored comment depth indicators
  • indent, italicize and dim quotes
  • highlight code snippets
  • highlight @username mentions
  • color reference numbers such as [0] [1] [2] ...

Add more supports for story view

  • add story searching, sorting, and navigating functions in a StoryView.
  • implement StoryView for the most popular stories, the newest stories, etc:
    • all stories View
    • ask stories View
    • show stories View
    • job stories View

Error:failed to execute command

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].

Performance tuning?

The current implementation doesn't involve any explicit lifetime annotations. A lot of workarounds involves cloning and copying data.

TODO:

  • Benchmark the code and find ways to improve the performance.
  • Add cache.
  • Speed-up HN API call time.
  • Reduce the number of packages needed to build the application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.