multiple (highlight) languages in one file ((PHP +) HTML + CSS + JS)
-
Hello Everybody!
As the topic title says, is there a way to select multiple languages of a file like a web page containing PHP, HTML, CSS and JavaScript.
If I choose PHP or HTML as language, the job is almost done, since these styles include JavaScript highlighting.
The problem here is the CSS, which is not highlighted at all.
So there are two methods I am thinking of:
- a) competely create a new user defined language (UDL) from scratch --> the hard way
- b) hope that someone already did this before and download his/her style --> the easy way
- somehow include CSS as a “sub-language” into PHP or HTML - no idea if this is possible or how to do that if it is
Does anybody have a solution?
Many thanks in advance. -
creating an UDL lexer for HTML, PHP, CSS and JavaScript is nearly impossible
as you can’t specify when a new lexer needs to jump in.The lexer can be modified to support another lexer as seen
in the code itself.I have no idea how complicated, in terms of lexing, css is, but in theory we could
use python script plugin and indicators to do this.Cheers
Claudia