Dynamic syntax highlighting is highlighting of code that the user can change. There is only one place where this happens, and that is the online editor.
Code snippets, iterations, and the like are static as the user can't change their code on the fly. If you'd like to know more of how we handle static syntax highlighting, check the static syntax highlighting docs.
Dynamic syntax highlighting is done using the CodeMirror library.
When adding support for your language, there are three options:
To enable CodeMirror support for your language, start a topic on the forum. We (Exercism) will then create a Pull Request that enables CodeMirror support for your language on the website.
To use an existing plugin, it needs to be published on NPM.
If the plugin isn't published on NPM, you can either:
The CodeMirror website has a list of community-built language plugins.
The next step is to Enable language.
If you'd like to create plugin, you have two options for hosting:
You could consider forking the codemirror/lang-example repository which implements CodeMirror support for a simple language.
Once you have a repo, follow the language package instructions to implement the plugin.
You'll then need to publish the plugin on NPM. The next step is to Enable the language.
Your language's syntax (closely) resembles another language's syntax, in which case you could consider using the syntax highlighting of that language for your language. To do so, configure the track using the other language's CodeMirror plugin. See the Enable language section for more information.