cheat.sh
cheat.sh copied to clipboard
styles-demo is inaccurate/out of date
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:

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)

Two things of note:
- the format of the comments on the rainbow_dash is different
- the sas style is missing from the styles-demo output
Some thoughts on resolution:
- update shares/styles-demo.sh
- change
:styles-demoto return all styles dynamically, using a representative command output - change
:styles-demoto be a query parameter so one could docurl cheat.sh/git-pull?styles-demoand 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 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)
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
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).
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.