Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any idea how to get GLSL syntax highlighting working in markdown? #34

Open
greggman opened this issue Dec 17, 2019 · 3 comments
Open

any idea how to get GLSL syntax highlighting working in markdown? #34

greggman opened this issue Dec 17, 2019 · 3 comments

Comments

@greggman
Copy link

In markdown code blocks can be highlighted in VSCode. Example text

# Markdown

Some text here with *italics* and **bold**
and [links](#foo).

Some JavaScript

```js
console.log('hello world');
```

Some **C#**

```csharp
class Foo {
  void process() {
    System.Console.WriteLine("Hello World!");
  }
}
```

Some **C++**

```cpp
#include <stdio.h>
int main(int argc, const char** argv) {
  printf("hello world\n");
  return 0;
}
```

Some **GLSL**

```glsl
in vec4 position;
uniform mat4 matrix;
void main() {
  gl_Position = matrix * position;
}
```

And the result in my VSCode looks like this

Screen Shot 2019-12-17 at 16 28 00

You can see above JavaScript, C++, C# are all syntax highlighted but not GLSL

Note that if I make a .glsl file then the syntax is highlighted

Screen Shot 2019-12-17 at 16 32 24

Any idea how to get VS code to use GLSL highlighting for GLSL blocks in markdown?

@greggman
Copy link
Author

found this example

https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example

@treert
Copy link

treert commented Jul 15, 2021

build a vscode plugin,inject glsl to markdown.
Maybe Usefull
https://marketplace.visualstudio.com/items?itemName=onemore.codeblock-syntax-highlight

@Zylann
Copy link

Zylann commented Jun 26, 2022

I've been trying several GLSL extensions to have this working but so far none work. Would be really useful to support this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants