diff options
author | Thang Pham <phamducthang1234@gmail.com> | 2021-03-17 02:53:08 +0900 |
---|---|---|
committer | Thang Pham <phamducthang1234@gmail.com> | 2021-03-17 02:53:08 +0900 |
commit | ccaf08b18c9d08e14f2a602cf4cb4bb3222b0999 (patch) | |
tree | d0e9ed5c816425b2859458fdeb6db3eaf52b2b4a | |
parent | 41e9eb8cc9b8f73800be7a0217af604a09ac5665 (diff) |
prepare for v0.2!v0.2
-rw-r--r-- | Cargo.lock | 22 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 15 | ||||
-rw-r--r-- | examples/assets/comment_view.png | bin | 176983 -> 172895 bytes | |||
-rw-r--r-- | examples/assets/story_search_view.png | bin | 0 -> 206588 bytes | |||
-rw-r--r-- | examples/assets/story_view.png | bin | 192637 -> 192311 bytes | |||
-rw-r--r-- | src/hn_client.rs | 2 |
7 files changed, 23 insertions, 18 deletions
@@ -361,7 +361,7 @@ dependencies = [ [[package]] name = "hackernews_tui" -version = "0.1.2" +version = "0.2.0" dependencies = [ "anyhow", "cursive", @@ -453,9 +453,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a" +checksum = "538c092e5586f4cdd7dd8078c4a79220e3e168880218124dcbce860f0ea938c6" [[package]] name = "lock_api" @@ -498,9 +498,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a" +checksum = "2182a122f3b7f3f5329cb1972cee089ba2459a0a80a56935e6e674f096f8d839" dependencies = [ "libc", "log", @@ -714,9 +714,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54fd1046a3107eb58f42de31d656fee6853e5d276c455fd943742dce89fc3dd3" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ "aho-corasick", "memchr", @@ -892,9 +892,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd9bc7ccc2688b3344c2f48b9b546648b25ce0b20fc717ee7fa7981a8ca9717" +checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f" dependencies = [ "proc-macro2", "quote", @@ -1018,9 +1018,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "wasi" @@ -1,6 +1,6 @@ [package] name = "hackernews_tui" -version = "0.1.2" +version = "0.2.0" authors = ["Thang Pham <phamducthang1234@gmail.com>"] edition = "2018" license = "MIT" @@ -1,10 +1,10 @@ # hackernews-TUI `hackernews_tui` is a Terminal UI to browse Hacker News written in Rust. -The application consists of the following views: -- `Story View` displaying a list of stories in front page of Hacker News. +The application mainly consists of the following views: +- `Story View - Front Page` displaying a list of stories in front page of Hacker News. - `Comment View` displaying a list of comments in a story. -- `Search View` displaying a list of stories satisfying certain conditions. +- `Story Search View` displaying a search bar and a list of stories matching the search query. ## Installation ### Using cargo @@ -14,15 +14,18 @@ Run `yay -S hackernews_tui` to install the application as an AUR package. ## Examples -Story View: -![Example of a Story View](https://raw.githubusercontent.com/aome510/hackernews-TUI/main/examples/assets/story_view.png) +Story View - Front Page: +![Example of a Story View - Front Page](https://raw.githubusercontent.com/aome510/hackernews-TUI/main/examples/assets/story_view.png) Comment View: ![Example of a Comment View](https://raw.githubusercontent.com/aome510/hackernews-TUI/main/examples/assets/comment_view.png) +Story Search View +![Example of a Story Search View](https://raw.githubusercontent.com/aome510/hackernews-TUI/main/examples/assets/story_search_view.png) + ## Documentation ### Keyboard shortcuts -In `Story View`, `Comment View` or `Search View`, press `<alt-h>` to see a list of supported keyboard shortcuts and their functionalities. +In each `View`, press `<alt-h>` to see a list of supported keyboard shortcuts and their functionalities. ## Roadmap/TODO List TBA... diff --git a/examples/assets/comment_view.png b/examples/assets/comment_view.png Binary files differindex 1953209..a971c5d 100644 --- a/examples/assets/comment_view.png +++ b/examples/assets/comment_view.png diff --git a/examples/assets/story_search_view.png b/examples/assets/story_search_view.png Binary files differnew file mode 100644 index 0000000..bc5a92e --- /dev/null +++ b/examples/assets/story_search_view.png diff --git a/examples/assets/story_view.png b/examples/assets/story_view.png Binary files differindex 823485b..c95d278 100644 --- a/examples/assets/story_view.png +++ b/examples/assets/story_view.png diff --git a/src/hn_client.rs b/src/hn_client.rs index c0c6163..9c08493 100644 --- a/src/hn_client.rs +++ b/src/hn_client.rs @@ -74,7 +74,9 @@ struct StoryResponse { /// CommentResponse represents the story data received from HN_ALGOLIA APIs struct CommentResponse { id: u32, + #[serde(deserialize_with = "parse_null_default")] parent_id: u32, + #[serde(deserialize_with = "parse_null_default")] story_id: u32, #[serde(default)] |