I am making a programming language, and I was wondering how you could change the text color of a file. In a JS file, the text color is different for each word. Is that possible for a custom file extension?
Hi @OmegaOrbitals2, if you would like to change syntax highlighting in the Replit IDE, you can create a custom theme https://replit.com/themes.
Other than that, having a different colour for each word inside a file sounds very unique and would need a custom file reader to display that (maybe someone could create a Replit extension that could do this, a bounty opportunity maybe?).
Also I know you can use escape codes to get certain text colours in Python console, but that’s only in the console - https://replit.com/talk/learn/ANSI-Escape-Codes-in-Python/22803?order=new.
I hope this is a step in the right direction.
Oh, so there is no way to do this for everyone? Like they can see the syntax highlighting without having to download anything?
Once you create your theme, you can share it with others so they can use it. For example, I created my own theme to match my brand colours - https://replit.com/theme/@robsd/rd-349ab895.
What I meant was automatically, without having them to download anything at all. For example, if you create a file called main.poo
it does it automatically.
You will be able to do custom syntax highlighting soon using replit extensions. (You might want to sign up for the beta). What you want, is called syntax highlighting, and replit uses code mirror for it. It is probably best that while we wait for the extension api to let us use custom syntax highlighting, you learn codemirror.
NOOOO I accidentally set as solution… I wanted to keep this open for further discussion…