Sublime Forum

Seeking advice, Syntax Definition for CGILua

#1

I’m wanting to create a new syntax definition for CGILua Lua Pages which is similar to PHP.

Just messing around I had managed to get Lua embedded in HTML working.

<h1><?= luavariable ?></h1>

However, it seems I also need to do the opposite as well:

<? if something then ?>
<some html here>
<? end ?>

it doesn’t highlight the embedded HTML because it’s handling it all as Lua until it reaches the “end”.
Do I need to add detection of embedded HTML in Lua, or create a new syntax for it? Or is this an issue of scope, or both?

I’ve got AAAPackageDev and after a bit of hackish command-line-fu managed to get python working for it in Linux Mint.

What I’m wondering at this point is, what is the best way to go about this? Like with other embedded scripts it seems to require modification to the HTML.tmLanguage.

I just want to make sure I do this in the appropriate way for creating a package that can be shared.

0 Likes