HackerTrans
TopNewTrendsCommentsPastAskShowJobs

1buran

no profile record

Submissions

Pigment – colorize JSON as you wanted

github.com
1 points·by 1buran·2년 전·1 comments

comments

1buran
·2년 전·discuss
Hey gophers!

I'am glad to share with you my little experiment of writing lexers, it's was such funny so i decided share the result with community :)

Meet Pigment! It may be useful for writing internal/personal scripts require showing the JSON data, when you faced with lack of flexibility of existing libs (not all support custom color themes, styling - bold, underline etc) or no need all their features (e.g. huge lib which can be colorize 20+ different data format, but you need only the one - json).

Demo: https://imgur.com/ojdMg7W Project home: https://github.com/1buran/pigment
1buran
·2년 전·discuss
Thanks!
1buran
·2년 전·discuss
> This is project was created when I needed something like REPL for http request in terminal, there are many great tools exist: Postman, Insomnia, httpie, curl etc but i wanted something little bit different, something lightweight, simple and fast, something like REPL when I can quickly modify request, send it and see the response with all the details. I wanted such utility with minimal magic, ideally without any black magic under the hood.

> The project has no ambitious goals. It is not killer of Postman or httpie or curl. I hope you may find it useful.

https://github.com/1buran/rHttp?tab=readme-ov-file#introduct...
1buran
·2년 전·discuss
interesting thought... i've never think about TUI in this perspective
1buran
·2년 전·discuss
Thanks!
1buran
·2년 전·discuss
https://wikipedia.org/wiki/REPL in context of http interaction maybe it's not has full REPL possibilities but it is kinda of REPL..

I'm not good in invention of project names!
1buran
·2년 전·discuss
> An interactive terminal environment that requires no mousing around seems nice for certain tasks

Definitely agree!
1buran
·2년 전·discuss
Hello! First of all, I'm glad to say you thank for feedback!

> Like I don't see how the author proposes Enter for navigating in the parameters but no way to get back when you want to edit something you've went before.

Current key bindings for navigation:

Shift+right next item Shift+left prev item

Enter set value (and move to the next one)

In demo I used Enter for moving because vhs doesn't support shift+right/left combinations, also there is historical reason of use enter - bubbletea examples =)

Anyway the current key bindings is not ideal, I'd say more: it may conflict with particular terminal key bindings of someone who has the same key binding for another things, so to solve this problem I want make all them configurable like I did recently for colors - every color value may be overridden in config, I want the same for key bindings.