tldr-pages / tldr

📚 Collaborative cheatsheets for console commands
https://tldr.sh
Other
50.1k stars 4.09k forks source link

pages*: fix placeholder highlight #13035

Closed sebastiaanspeck closed 2 months ago

sebastiaanspeck commented 2 months ago
tldr-bot commented 2 months ago

Hello! I've noticed something unusual when checking this PR:

Is this intended? If so, just ignore this comment. Otherwise, please double-check the commits.

tldr-bot commented 2 months ago

Hello! I've noticed something unusual when checking this PR:

Is this intended? If so, just ignore this comment. Otherwise, please double-check the commits.

reinhart1010 commented 2 months ago

Any rationale for this?

kbdharun commented 2 months ago

Any rationale for this?

This PR seems to be similar to #13030, I believe Sebastiaan is trying to move the -- symbols inside the placeholder so that they don't have a different color/style. I too am not sure if this is necessary (we enclose the symbols inside the placeholder if we are showing both long and short options).

sebastiaanspeck commented 2 months ago

The rationale for this is indeed to show the complete placeholder with the same color/styling, instead of showing -- with a different style from the actual option. image image

vitorhcl commented 2 months ago

Hmm I don't know, I have mixed feels about this.

This style is more consistent with {{-short-option|--long-option}}.

In the other hand, the coloring indicates the only value that can be changed for this placeholder, to properly follow this example, is the actual word(s).

Also, maybe it can clutter a bit the example if, for example, a considerable number of long options is in the same placeholder?

sebastiaanspeck commented 2 months ago

Hmm I don't know, I have mixed feels about this.

This style is more consistent with {{-short-option|--long-option}}.

In the other hand, the coloring indicates the only value that can be changed for this placeholder, to properly follow this example, is the actual word(s).

Also, maybe it can clutter a bit the example if, for example, a considerable number of long options is in the same placeholder?

What about {{--option1|--option2}}?

tldr-bot commented 2 months ago

Hello! I've noticed something unusual when checking this PR:

Is this intended? If so, just ignore this comment. Otherwise, please double-check the commits.

acuteenvy commented 2 months ago

In the other hand, the coloring indicates the only value that can be changed for this placeholder, to properly follow this example, is the actual word(s).

Which is why, in my opinion, the two correct ways to write it are --{{a|b}} and {{--a|--b}}. I personally like the first one better.

vitorhcl commented 2 months ago

It would be good to document this in the style guide