Following on from various Meta posts about code snippets being misused (like this one and this other one), a few days ago the Code Snippet WYSIWYG button's title
was changed from "Code snippet" to "JavaScript snippet":
JavaScript Snippet image
The problem is that it isn't only used for JavaScript code. Myself and many others use the code snippet functionality a lot when answering HTML and CSS questions which feature no JavaScript at all. The phrase JavaScript snippet simply doesn't work in those cases.
Perhaps this should be renamed to "HTML/CSS/JavaScript snippet" or "Website code snippet" instead - something which doesn't make it sound like its only use is for JavaScript code.
In answers, perhaps the button could be hidden completely when the question isn't tagged with html, css or javascript, as well as jquery, d3, knockout.js or angularjs which are options within the code snippet interface.
* {
transition: 0.5s;
}
html, body {
height: 100%;
margin: 0;
}
body {
font-size: 108px;
text-align: center;
}
body:hover {
background: black;
}
body:hover span {
color: white;
}
<span>☹</span>
3 Answers 3
My suggestion:
- Live demo (HTML/CSS/JS only)
It makes clear what languages are supported, and is a clear indication that this is not just a "code snippet" or "code block" feature but an actual demonstration tool that will require language support to run.
It's also pithy. :)
-
5This. Why obscure what it really is behind words like Client-side? Last I checked, I could run Java applets on the client, flash on the client, etc (although not as much as before, of course).Qix - MONICA WAS MISTREATED– Qix - MONICA WAS MISTREATED2015年07月08日 19:15:04 +00:00Commented Jul 8, 2015 at 19:15
-
2+1. Explicit is better than implicit, as the Python folks like to say.Mark Amery– Mark Amery2015年07月10日 10:08:27 +00:00Commented Jul 10, 2015 at 10:08
-
Looks like this has now been accepted, so I've gone ahead and accepted this answer. Nice idea!James Donnelly– James Donnelly2015年07月14日 09:39:27 +00:00Commented Jul 14, 2015 at 9:39
-
Whooo get inLightness Races in Orbit– Lightness Races in Orbit2015年07月14日 09:45:54 +00:00Commented Jul 14, 2015 at 9:45
(FWIW, I prefer Lightness Races in Orbit's to this. This is much clunkier.)
Wording suggestions:
- Client-side web snippet (HTML, CSS, JS)
- Runnable client-side web snippet (HTML, CSS, JS)
- Live client-side web snippet (HTML, CSS, JS)
I wouldn't hide the button if the question isn't tagged, because a lot of people (possibly most) write the question first then add tags.
But a check as of when they're posting would make sense. That's been requested in various forms here, here, and here (at least).
-
It might be useful in a small number of non-front end situations as well. I can think of some questions like "How do I duplicate this HTML/CSS functionality in some GUI framework?" as one.kylieCatt– kylieCatt2015年07月08日 12:29:55 +00:00Commented Jul 8, 2015 at 12:29
-
1Perhaps we could move the tag entry box to the top when writing a new question to encourage tags first?Matt Wilko– Matt Wilko2015年07月08日 13:11:23 +00:00Commented Jul 8, 2015 at 13:11
-
@MattWilko: I think that's a good idea regardless. I've said it before, too!Lightness Races in Orbit– Lightness Races in Orbit2015年07月08日 13:12:50 +00:00Commented Jul 8, 2015 at 13:12
Back in the day the convention was to call this DHTML. It meant HTML, CSS & Javascript running in a browser environment. The D stands for Dynamic. I still think it's a very useful term.
-
1It is indeed a really usefull term, and one I'm particulary fond of. The problem is that in my experience lots of people don't have a clue of what it means. Perhaps we bring it back to life?tfrascaroli– tfrascaroli2015年07月10日 08:31:45 +00:00Commented Jul 10, 2015 at 8:31
You must log in to answer this question.
Explore related questions
See similar questions with these tags.
Insert self-contained runnable working client side website code snippet
Web snippet (but not for languages like PHP)
C
,C++
,Java
andPython
would go a long way.runnable
then have a<select>
tag for each code block's language?