[TxMt] Editing Kid templates

Michael Sheets mummer at whitefalls.org
Sun Dec 18 01:18:07 UTC 2005


> python =
> {	name = 'source.python.embedded.html';
> 	begin = '(?:^\s*)<\?python(?!.*\?>)';
> 	end = '\?>(?:\s*$\n)?';
> 	patterns = (
> 		{	name = 'comment.line.number-sign.ruby';
> 			match = '#.*?(?=-?%>)';
> 		},
> 		{	include = 'source.python'; },
> 	);
> };

That's a repository rule, you have to include it in the main grammar  
at some point. Look above and you'll see the php repository item  
included at some point.

<http://macromates.com/textmate/manual/language_grammars.html#rule_keys>

Provided that the python part of <?python is required it could be  
included in the default HTML syntax, PHP doesn't require the php so  
it catches <? ?>, but if this is before it it'd work.

In response to the later email, the order of repository items doesn't  
matter. But the order they are included in the syntax does matter.



More information about the textmate mailing list