cheat.sh icon indicating copy to clipboard operation
cheat.sh copied to clipboard

styles-demo is inaccurate/out of date

Open dougharris opened this issue 4 years ago • 4 comments

Calling :styles-demo appears to simply dump the file share/styles-demo.txt. It seems to be missing some styles and doesn't accurately demonstrate some styles.

Here's a screenshot of styles-demo: static-demo

Here's a screenshot generated with the small script at the bottom of styles demo. (In this case, I tested with git-pull and changed head to tail since the first five lines of the output were all comments) dynamic-demo

Two things of note:

  1. the format of the comments on the rainbow_dash is different
  2. the sas style is missing from the styles-demo output

Some thoughts on resolution:

  • update shares/styles-demo.sh
  • change :styles-demo to return all styles dynamically, using a representative command output
  • change :styles-demo to be a query parameter so one could do curl cheat.sh/git-pull?styles-demo and the get dynamic output for all existing styles, like in the script

Edit: FWIW, I'm on MacOS using iTerm2 with a light background

dougharris avatar Jan 22 '21 14:01 dougharris

@dougharris thnka you for the suggestions; all of them seem to be reasonable. You mentioned some script, did you want to attach it and forgot to do it? Or I did get you wrong?

change :styles-demo to be a query parameter so one could do curl cheat.sh/git-pull?styles-demo and the get dynamic output for all existing styles, like in the script

cheat.sh/git-pull?styles-demo should be then something like do=styles-demo or action=styles-demo, otherwise it will be interpreted as as set of short options (think of -styledmo in UNIX/Linux cli)

chubin avatar Apr 25 '21 06:04 chubin

The script I referred to is the bit at the bottom of the current output of :styles-demo:

You can test color styles with other cheat sheets using this script:

    c="python/Advanced"
    for s in $(curl -s cheat.sh/:styles); do
      echo
      echo --------
      echo $s
      echo --------
      curl -s cheat.sh/$c?style=$s | head -5
    done

dougharris avatar Apr 25 '21 16:04 dougharris

I'm not familiar enough with the underlying code of cheat.sh to distinguish between do= and action=, but let me elaborate on what I meant by that suggestion.

My thinking is that you could some way to indicate both (a) that you want a styles demo and (b) which cheat sheet you'd like displayed in the styles demo.

So by requesting cheat.sh/git-pull?styles-demo, it'd show the styles demo using the output of cheat.sh/git-pull (which is sort of what that script included in the output does).

dougharris avatar Apr 25 '21 16:04 dougharris

Yes, I understood this; I just wanted to say that if you specify options without any parameter (param=), they are interpreted as a set of short options (s, t, y, etc.). And I completely agree with the rest.

chubin avatar Apr 25 '21 19:04 chubin