Plugin for language mix HTML, JS, CSS + 2 ECMA code blocks? 关注
i'm struggling with a template engine file for generating html-files from a desktop app (based on QT, if this helps ...).
such a template generation file consists of a form block on top (setting up a form presented inside of the app mentioned above for configuring some values for the desired HTML output). this block is a ECMA-262 script wrapped in php style <?ggf .... ?> tags. e.g.
<?ggf
form.addLineEdit("htmltitle","HTML Page Title",0,"");
form.addCheckBox("parseanchor","DNA",true);
form.addLine(); ....
then a processing section is following to work with the form values from above. it's also based on ECMA -262 and wrapped in <?ggs ... ?> tags. e.g.
<?ggs
function writeUserdata(v)
{
var s;
s=document.expandVariables(v);
document.write(document.encode(document.removeTags(s),true));
}
....
after this section the html assembly for the output starts with plain HTML, JS and CSS code and <?ggs ... ?> injections for retrieving values / variables calculated above. e.g.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title><?ggs document.write(document.expandVariables(htmlTitle)); ?></title>
is there a way to create a language / syntax coloring template/plugin in/for phpstorm?
any tipps or hints for pointing me in the right direction is very appreciated. thanks a lot in advance!
best
thomas
请先登录再写评论。
it's not an easy task: https://plugins.jetbrains.com/docs/intellij/custom-language-support-tutorial.html
thank you, Konstantin Annikov!
this indeed doesn't look very easy and as java is involved i'm out of luck here.
is there a way to make phpstorm recognize these script parts between the <?ggf> and <?ggs> tags as ecma?
You can use instructions here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000643090/comments/115000531470
thanks again!
this looks promising. i'll give it a test shot asap and let you know.