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

Enhancement: Determine syntax highlighting based on filename on Codeblocks #180

Open
brianespinosa opened this issue May 16, 2022 · 4 comments

Comments

@brianespinosa
Copy link
Contributor

brianespinosa commented May 16, 2022

It would be great if when defining a codeblock and putting a filename, that our codeblocks could determine the language for syntax highlighting based on the filename alone.

This of course might be challenging if codeblocks are looking for these frontmatter values in an array.

@pomber
Copy link
Contributor

pomber commented May 16, 2022

Do you mean

``` hello.py
print("Hello, world!")
```

should be highlighted as python? Or you have something different on your mind?

@pomber pomber closed this as completed May 16, 2022
@pomber pomber reopened this May 16, 2022
@brianespinosa
Copy link
Contributor Author

@pomber yes, that is 100% what I am thinking.

@pomber
Copy link
Contributor

pomber commented Jun 21, 2022

can you find/build a map from filename to language? I'll be happy to add the logic to the code

@brianespinosa
Copy link
Contributor Author

This might be more than we need relative to available language syntax highlighting... but I think we might be able to start with this? https://gist.github.com/ppisarczyk/43962d06686722d26d176fad46879d41

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

2 participants