command-line-interface-pages / v2-tooling

Tools for handling v2.*.* syntax
6 stars 3 forks source link

Add different render modes #10

Closed EmilyGraceSeville7cf closed 1 year ago

EmilyGraceSeville7cf commented 1 year ago

closes #4 closes #9 closes #11 closes #12

ToDo

TlDr-like and DocOpt-like modes rely heavily on regex parsing, while CLIP does more real and more complex parsing, that's why escaping mnemonics works here.

Screenshots

image

image

Notes

Note that this tool is a just working prototype. The real render will be written later in Go with proper parsing and more capabilities. It's the pain in the ass to support such things those mix Bash, Sed and AWK, but yeah, it's a good way to break your brain and prove that you can do some crazy stuff. It's more like a challenge.

EmilyGraceSeville7cf commented 1 year ago

@kbdharun, @los-romka, @navarroaxel, @blueglyph, @rwv, @Lereena, @waldyrious can u check TlDr-like mode? Usage examples:

clip-view -r tldr [
clip-view -r tldr-colorful [

I am interested in feedback about TlDr-like render quality.

kbdharun commented 1 year ago

How do I test it locally? Can you show some samples?

blueglyph commented 1 year ago

I don't see any clip-view command.

EmilyGraceSeville7cf commented 1 year ago

How do I test it locally? Can you show some samples?

@kbdharun, clone this repo locally and run smth like this: clip-view -r tldr /home/emilyseville7cfg/Documents/mine/other/cli-pages/common/[.clip. *.clip is a page to render. Extension is required when dealing with local files. Remote pages are cached when used for infinite amount of time until u explicitly clear cache.

EmilyGraceSeville7cf commented 1 year ago

I don't see any clip-view command.

@blueglyph, it is here. Add it to PATH before using it from any place. 😄

blueglyph commented 1 year ago

Oh, I was in a hurry and took the main branch apparently, that's why I couldn't see the script.

Here's what it looks like here, I'd say that blue is a bad colour choice because it will always be difficult to read. Same for bright red. Just my opinion, others may like it.

That's with Manjaro Cinnamon. Both commands seem to give the same result.

image

On Windows with MinGW the blue is brighter.

image

EmilyGraceSeville7cf commented 1 year ago

Here's what it looks like here, I'd say that blue is a bad colour choice because it will always be difficult to read. Same for bright red. Just my opinion, others may like it.

Yay, it's hard to read definitely (for me too). I think the solution can be a theme support, to colorize everything at once as it takes some time to setup all environment variables to customize colors. :) I think the current color settings should be available too as one of default themes (but default theme can be changed to something else). Blue can be replaced with cyan.

blueglyph commented 1 year ago

Yeah, it's not obvious with terminal colours. There are only a few possibilities and it's subjective. These days there are about as many people using a light theme than a dark theme.

Shells often have definitions like LS_COLORS but I don't think you can count on it.

For ex. the Rust implementation of tldr, Tealdeer, uses a configuration file. https://github.com/dbrgn/tealdeer/blob/main/docs/src/config.md https://github.com/dbrgn/tealdeer/blob/main/docs/src/config_style.md

EmilyGraceSeville7cf commented 1 year ago

image

Please also test my own CLIP mode. Example: clip-view sed.