The ability to specify script type -> syntax highlighters for embedded languages.
<script id="vertex-shader" type="foo-glsl">
void main() {
gl_Position = ...
}
</script>
<script>
window.onload = function() {...
</script>
It's a common
pattern. That first script tag should really have GLSL syntax highlighting and completion not JavaScript like the second
I was trying to research what standards if any there are for specifying GLSL code in HTML. Googles produced very little info. I found:
<script id="2d-vertex-shader" type="x-shader/x-vertex">
and
<script type="x-shader/x-fragment" id="shader-fs" src="util/fs"></script>
You posted:
<script id="vertex-shader" type="foo-glsl">
It's really not obvious what the standard is here or if there is a standard for this.
Any help would be greatly appreciated.