-
-
Notifications
You must be signed in to change notification settings - Fork 571
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
How to use themes with the new Code node #1040
Comments
If you want you can install Shiki code highlighter. It supports a lot of languages and has many themes. |
@brend32 Instead of forking the repo you should consider releasing the highlighter as a standalone npm package. |
As a non-expert in this, I would prefer a way to enable themes in the framework and while the way suggested by @brend32 is helpful, it feels like there might still be a way to enable themes out of the box in Motion Canvas directly, what is your take on this @aarthificial? |
I'm not sure what you mean by
Motion Canvas ships with only one default theme. The For example, here's a CodeMirror theme for Monokai: You can install it in your project: npm i @uiw/codemirror-theme-monokai And then use it when defining your LezerHighlighter: import {parser} from '@lezer/javascript';
import {monokai} from '@uiw/codemirror-theme-monokai';
const Highlighter = new LezerHighlighter(parser, (monokai as any)[1][2].value); We could provide a helper function to make the |
This looks great! That is exactly the reason why I added the documentation label to this issue at first, could we maybe add this to the docs for the noobs in type script like myself? I feel this tiny tutorial belongs in the docs of Motion Canvas to make it an even more complete package. Thoughts? |
While a new
Code
node is fantastic I was wondering if it is possible to use some pre-defined code highlight theme from the ones available in the typical text editors, e.g. Monokai. As of now, there is a default theme coming fromLezerHighlighter
and I was not able to find any other pre-defined themes. While it is possible to set up custom themes, it would be nice to have some available by default. Am I just missing some setting?The text was updated successfully, but these errors were encountered: