httpref icon indicating copy to clipboard operation
httpref copied to clipboard

Better reference formatting

Open dnnrly opened this issue 2 years ago • 12 comments

Is your feature request related to a problem? Please describe.

Formatting of the output in this tool is rather cumbersome. It would be great if we could use a modern CLI formatting library to do something better, perhaps using something like this: https://github.com/charmbracelet/lipgloss

Describe the solution you'd like Better control over the look and feel of the output. Perhaps some additional configuration to customise it for user needs.

dnnrly avatar Oct 02 '22 22:10 dnnrly

@dnnrly could you assign me? I will.tinker with it in the coming days and see if I can add some knobs like:

  • format options (json/yaml)
  • Golang template printing (similar to docker ps --format)

I will also fig deeper into lipgloss to see if it fits the bill

georgettica avatar Oct 03 '22 22:10 georgettica

I think I understand what you mean by reference formatting (without looking at lipgloss too much)

I think I can whip up a PR and some pictures and I'll ping you here

georgettica avatar Oct 03 '22 22:10 georgettica


To be clear, will start the effort after being assigned :/

georgettica avatar Oct 03 '22 22:10 georgettica

I don't typically assign issues as I've had problems with people not completing them before. But I've had some good quality PRs from you before so happy to.

dnnrly avatar Oct 04 '22 07:10 dnnrly

❤️

georgettica avatar Oct 04 '22 08:10 georgettica

created a PR to fix the make test, can extend it to be across the whole binaries used https://github.com/dnnrly/httpref/pull/37

georgettica avatar Oct 05 '22 14:10 georgettica

will take inspiration from https://github.com/aarol/goclean/blob/master/view.go, unless you have a better way of formatting

georgettica avatar Oct 05 '22 14:10 georgettica

will take inspiration from https://github.com/aarol/goclean/blob/master/view.go, unless you have a better way of formatting

Yes, this is exactly the sort of thing I was thinking.

dnnrly avatar Oct 05 '22 14:10 dnnrly

so I spoke to a friend who is a UI/UX expert, but I might create the base for him before he shows up and cleans it up color/UX wise.

wanted to let you know I didn't forget it and found some minutes to work on it

georgettica avatar Oct 08 '22 14:10 georgettica

Nah, you're good. You've already done loads. Getting a designer involved is good. We need to focus on make it as easy and useful as possible.

dnnrly avatar Oct 08 '22 16:10 dnnrly

yeah, but if I get him on it it'll look better and I will learn some design elements (which is always a good thing)

georgettica avatar Oct 10 '22 10:10 georgettica

@dnnrly , this is the coloring I got to so far.

now each element can be updated individually.

also added a global state to allow for the width to be updated on the fly (using dates and not bool as I heard a talk about it a while ago (can be moved back to bool if you want)

georgettica avatar Oct 14 '22 12:10 georgettica