Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include useful font-highlighting similar to circumflex #51

Closed
4 of 6 tasks
jtrv opened this issue Dec 13, 2021 · 3 comments
Closed
4 of 6 tasks

Include useful font-highlighting similar to circumflex #51

jtrv opened this issue Dec 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@jtrv
Copy link

jtrv commented Dec 13, 2021

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] ...
@aome510 aome510 added the enhancement New feature or request label Dec 13, 2021
@aome510
Copy link
Owner

aome510 commented Dec 13, 2021

Hi @JacobTravers. Thank you for the ideas. Definitely will try those.

Also circumflex looks really great. Thanks again for the great reference 😄

@bensadeh
Copy link

Thanks for the mention, @JacobTravers & @aome510 😊,

The highlighting in clx is a mix between simple search + replace of certain keywords, as well as some regular expressions for more complicated patterns. I have gathered most of them here, maybe it can help you for inspiration/implementation of similar features.

(By the way, hackernews-TUI is really impressive, glad to see more people interested in the niche of HN readers in the Terminal!)

aome510 added a commit that referenced this issue Dec 17, 2021
Part 1 of #51.

## Brief description of changes
- rewrite the parser function for parsing HN comment (as HTML text)
- add font highlighting for `CommentView` that adds highlight/color to
   + italic
   + quote paragraph
   + single code block surrounded by ``
   + multi-line code block
- add font highlighting for `StoryView` that adds highlight/color to story's categories (`Show HN`, `Ask HN`, etc) and implement a parser for parsing story title
- make link ID in comment text starts from `1` and change the corresponding `open_link_*` commands in `CommentView`
- add more component styles
@aome510
Copy link
Owner

aome510 commented Dec 17, 2021

@JacobTravers FYI, I have implemented most of the font highlight functionalities for StoryView and CommentView along with a better looking UI.

You can check them out with the latest version of the main branch. Any feedbacks are highly appreciated!
There are still a few big things I want to do before releasing new versions (documentation, highlight for ArticleView, etc).

Also, I decided not to implement highlighting for user mention and reference numbers as they are quite subject to false positives.

@aome510 aome510 closed this as completed Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants