4

I was taking a look at this question. As the OP originally had it, they included the relevant JavaScript, and had a JS Fiddle to execute the code.

Subsequently, an edit was made that removed the Fiddle, and moved the code in the question into a Snippet. That's good that we can now run it locally without having to go to Fiddle, however there was a TON of extra irrelevant code added.

I'm not arguing the merits of snippets, or whether this edit was right or wrong. In this example, all that was needed was solely the JavaScript. However, in another example, there could be a combination, but having all the code could be too much to process.

What I would like to discuss/propose is the possibility of making the different sections (JavaScript/CSS/HTML) collapsible within the snippet definition. We've had some similar discussions in the past, and other answers have been provided. Yet, if it is possible, I think we can go further to improve the usefulness of Snippets.

2
  • 3
    We already support collapsing the snippet if you set hide: true in the markdown, so it shouldn't be difficult to implement. But the real problem seems to be that "there was a TON of extra irrelevant code added". That should be edited out. Don't use collapsing to hide code that shouldn't be there taking up space in the first place.
    – Cody Gray Mod
    Commented Dec 9, 2016 at 13:56
  • @CodyGray I commented in the question, and we had our discussion there. I do NOT want to make the focus of this question another discussion of that subject. However, I do think that if extra code is required to create the snippet, then perhaps that shouldn't be used, and we should continue using fiddles?
    – krillgar
    Commented Dec 9, 2016 at 14:08

0

You must log in to answer this question.

Browse other questions tagged .