Warning, /frameworks/syntax-highlighting/data/syntax/djangotemplate.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language
0003 [
0004         <!ENTITY name    "[A-Za-z_:][\w.:_-]*">
0005         <!ENTITY entref  "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
0006 ]>
0007 <language name="Django HTML Template" version="7" kateversion="5.53" section="Markup" extensions="*.htm;*.html" mimetype="text/html"  author="Matthew Marshall (matthew@matthewmarshall.org)" license="LGPL" priority="9">
0008 
0009 <!--
0010     Based off of the katepart html syntax highlighting by Wilbert Berendsen.
0011 
0012     Email me with any bugs/suggestions/requests!
0013 -->
0014 
0015 <highlighting>
0016 
0017 <list name="blocktags">
0018     <item>for</item>
0019     <item>block</item>
0020     <item>if</item>
0021     <item>ifequal</item>
0022     <item>ifnotequal</item>
0023     <item>ifchanged</item>
0024     <item>blocktrans</item>
0025     <item>spaceless</item>
0026     <item>autoescape</item>
0027 </list>
0028 
0029 <list name="endblocktags">
0030     <item>endfor</item>
0031     <item>endblock</item>
0032     <item>endif</item>
0033     <item>endifequal</item>
0034     <item>endifnotequal</item>
0035     <item>endifchanged</item>
0036     <item>endblocktrans</item>
0037     <item>endspaceless</item>
0038     <item>endautoescape</item>
0039 </list>
0040 
0041 <contexts>
0042   <context name="Start" attribute="Normal Text" lineEndContext="#stay">
0043     <RegExpr attribute="Mismatched Block Tag" context="#stay" String="\{%\s*end[a-z]+\s*%\}" />
0044     <IncludeRules context="FindTemplate" />
0045     <IncludeRules context="FindHTML" />
0046   </context>
0047 
0048   <context name="In Block" attribute="Normal Text" lineEndContext="#stay">
0049     <RegExpr context="#pop" String="\{%\s*end[a-z]+\s*%\}" lookAhead="true" />
0050     <IncludeRules context="FindTemplate" />
0051     <IncludeRules context="FindHTML" />
0052   </context>
0053 
0054   <context name="FindTemplate" attribute="Normal Text" lineEndContext="#stay">
0055     <RegExpr attribute="Template Comment" context="Template Comment" String="\{%\s*comment\s*%\}" beginRegion="templatecomment" />
0056     <Detect2Chars attribute="Template Var" context="Template Var" char="{" char1="{" />
0057     <Detect2Chars attribute="Template Tag" context="Template Tag" char="{" char1="%" />
0058   </context>
0059 
0060   <context name="Template Comment" attribute="Template Comment" lineEndContext="#stay">
0061     <RegExpr attribute="Template Comment" context="#pop" String="\{%\s*endcomment\s*%\}" endRegion="templatecomment" />
0062     <DetectSpaces />
0063     <IncludeRules context="##Comments" />
0064   </context>
0065 
0066   <context name="Template Var" attribute="Template Var" lineEndContext="#stay">
0067     <Detect2Chars attribute="Template Var" context="#pop" char="}" char1="}" />
0068     <DetectChar attribute="Template Filter" context="Template Filter" char='|' />
0069     <Detect2Chars attribute="Error" context="#stay" char="{" char1="{" />
0070     <Detect2Chars attribute="Error" context="#stay" char="{" char1="%" />
0071     <Detect2Chars attribute="Error" context="#stay" char="%" char1="}" />
0072   </context>
0073 
0074   <context name="Template Filter" attribute="Template Filter" lineEndContext="#stay">
0075     <Detect2Chars attribute="Template Var" context="#pop#pop" char="}" char1="}" />
0076     <DetectChar attribute="Template String" char="'" context="Single A-string"/>
0077     <DetectChar attribute="Template String" char="&quot;" context="Single Q-string"/>
0078     <Detect2Chars attribute="Error" context="#stay" char="{" char1="{" />
0079     <Detect2Chars attribute="Error" context="#stay" char="{" char1="%" />
0080     <Detect2Chars attribute="Error" context="#stay" char="%" char1="}" />
0081   </context>
0082 
0083   <context name="Template Tag" attribute="Template Tag" lineEndContext="#stay">
0084       <keyword String="blocktags" context="Found Block Tag" lookAhead="true" attribute="Template Tag" />
0085       <DetectIdentifier attribute="Template Tag" context="In Template Tag" />
0086   </context>
0087 
0088   <context name="Found Block Tag" attribute="Template Tag" lineEndContext="#stay">
0089     <!-- This context is entered when a matching block tag was found through lookAhead.  We need to capture it in an re, so that it can be matched with the end[blockname] tag later -->
0090     <RegExpr attribute="Template Tag" String="(&name;)" context="In Block Tag"/>
0091   </context>
0092 
0093   <context name="In Block Tag" attribute="Template Tag Argument" dynamic="true" lineEndContext="#stay" >
0094     <RegExpr context="#pop#pop#pop" String="\{%\s*end%1\s*%\}" dynamic="true" attribute="Template Tag"/>
0095     <RegExpr context="Non Matching Tag" String="\{%\s*end[a-z]+\s*%\}" lookAhead="true" />
0096     <Detect2Chars attribute="Template Tag" context="In Block" char="%" char1="}" />
0097     <IncludeRules context="In Template Tag" />
0098   </context>
0099 
0100   <context name="Non Matching Tag" attribute="Template Tag" lineEndContext="#stay">
0101     <keyword String="endblocktags" attribute="Mismatched Block Tag" context="#pop" />
0102     <!-- If the mismatched tag is one we don't know about, ignore it. -->
0103     <DetectIdentifier attribute="Template Tag" context="#pop" />
0104   </context>
0105 
0106   <context name="In Template Tag" attribute="Template Tag Argument" lineEndContext="#stay">
0107     <Detect2Chars attribute="Template Tag" context="#pop#pop" char="%" char1="}" />
0108     <DetectChar attribute="Template String" char="'" context="Single A-string"/>
0109     <DetectChar attribute="Template String" char="&quot;" context="Single Q-string"/>
0110     <Detect2Chars attribute="Error" context="#stay" char="{" char1="{" />
0111     <Detect2Chars attribute="Error" context="#stay" char="{" char1="%" />
0112     <Detect2Chars attribute="Error" context="#stay" char="}" char1="}" />
0113   </context>
0114 
0115   <context name="Single A-string" attribute="Template String" lineEndContext="#stay">
0116     <HlCStringChar attribute="Template String" context="#stay"/>
0117 <!--       <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/> -->
0118     <DetectChar attribute="Template String" char="'" context="#pop"/>
0119   </context>
0120 
0121   <context name="Single Q-string" attribute="Template String" lineEndContext="#stay">
0122     <HlCStringChar attribute="Template String" context="#stay"/>
0123 <!--       <RegExpr attribute="Operator" String="%[a-zA-Z]" context="#stay"/> -->
0124     <DetectChar attribute="Template String" char="&quot;" context="#pop"/>
0125   </context>
0126 
0127 
0128 
0129   <context name="FindHTML" attribute="Normal Text" lineEndContext="#stay">
0130     <DetectSpaces/>
0131     <DetectIdentifier/>
0132     <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
0133     <StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
0134     <RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
0135     <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
0136     <RegExpr attribute="Element" context="CSS" String="&lt;style\b" insensitive="true" beginRegion="style" />
0137     <RegExpr attribute="Element" context="JS" String="&lt;script\b" insensitive="true" beginRegion="script" />
0138     <RegExpr attribute="Element" context="El Open" String="&lt;pre\b" insensitive="true" beginRegion="pre" />
0139     <RegExpr attribute="Element" context="El Open" String="&lt;div\b" insensitive="true" beginRegion="div" />
0140     <RegExpr attribute="Element" context="El Open" String="&lt;table\b" insensitive="true" beginRegion="table" />
0141     <RegExpr attribute="Element" context="El Open" String="&lt;&name;" />
0142     <RegExpr attribute="Element" context="El Close" String="&lt;/pre\b" insensitive="true" endRegion="pre" />
0143     <RegExpr attribute="Element" context="El Close" String="&lt;/div\b" insensitive="true" endRegion="div" />
0144     <RegExpr attribute="Element" context="El Close" String="&lt;/table\b" insensitive="true" endRegion="table" />
0145     <RegExpr attribute="Element" context="El Close" String="&lt;/&name;" />
0146     <!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
0147     <IncludeRules context="FindEntityRefs" />
0148   </context>
0149 
0150   <context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
0151     <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
0152     <AnyChar attribute="Error" context="#stay" String="&amp;&lt;" />
0153   </context>
0154 
0155   <context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay">
0156     <RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
0157     <RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
0158     <AnyChar attribute="Error" context="#stay" String="&amp;%" />
0159   </context>
0160 
0161   <context name="FindAttributes" attribute="Normal Text" lineEndContext="#stay">
0162     <RegExpr attribute="Attribute" context="#stay" String="^&name;|\s+&name;" />
0163     <DetectChar attribute="Attribute" context="Value" char="=" />
0164   </context>
0165 
0166   <context name="FindDTDRules" attribute="Normal Text" lineEndContext="#stay">
0167     <RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
0168   </context>
0169 
0170 
0171   <context name="Comment" attribute="Comment" lineEndContext="#stay">
0172     <DetectSpaces/>
0173     <IncludeRules context="##Comments" />
0174     <IncludeRules context="FindTemplate" />
0175     <DetectIdentifier/>
0176     <StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
0177     <RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" />
0178   </context>
0179 
0180   <context name="CDATA" attribute="Normal Text" lineEndContext="#stay">
0181     <DetectSpaces/>
0182     <DetectIdentifier/>
0183     <StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" />
0184     <StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
0185   </context>
0186 
0187   <context name="PI" attribute="Normal Text" lineEndContext="#stay">
0188     <Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
0189   </context>
0190 
0191   <context name="Doctype" attribute="Normal Text" lineEndContext="#stay">
0192     <DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
0193     <DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
0194   </context>
0195 
0196   <context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay">
0197     <DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
0198     <IncludeRules context="FindDTDRules" />
0199     <StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
0200     <RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
0201     <IncludeRules context="FindPEntityRefs" />
0202   </context>
0203 
0204   <context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay">
0205     <DetectChar attribute="Doctype" context="#pop" char="&gt;" />
0206     <DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
0207     <DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
0208   </context>
0209 
0210   <context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay">
0211     <DetectChar attribute="Value" context="#pop" char="&quot;" />
0212     <IncludeRules context="FindPEntityRefs" />
0213   </context>
0214 
0215   <context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay">
0216     <DetectChar attribute="Value" context="#pop" char="&apos;" />
0217     <IncludeRules context="FindPEntityRefs" />
0218   </context>
0219 
0220   <context name="El Open" attribute="Normal Text" lineEndContext="#stay">
0221     <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" />
0222     <DetectChar attribute="Element" context="#pop" char="&gt;" />
0223     <IncludeRules context="FindAttributes" />
0224     <IncludeRules context="FindTemplate" />
0225     <RegExpr attribute="Error" context="#stay" String="\S" />
0226   </context>
0227 
0228   <context name="El Close" attribute="Normal Text" lineEndContext="#stay">
0229     <DetectChar attribute="Element" context="#pop" char="&gt;" />
0230     <RegExpr attribute="Error" context="#stay" String="\S" />
0231   </context>
0232 
0233   <context name="El Close 2" attribute="Normal Text" lineEndContext="#stay">
0234     <DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" />
0235     <RegExpr attribute="Error" context="#stay" String="\S" />
0236   </context>
0237 
0238   <context name="El Close 3" attribute="Normal Text" lineEndContext="#stay">
0239     <DetectChar attribute="Element" context="#pop#pop#pop#pop" char="&gt;" />
0240     <RegExpr attribute="Error" context="#stay" String="\S" />
0241   </context>
0242 
0243   <context name="CSS" attribute="Normal Text" lineEndContext="#stay">
0244     <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="style" />
0245     <DetectChar attribute="Element" context="CSS content" char="&gt;" />
0246     <IncludeRules context="FindAttributes" />
0247     <IncludeRules context="FindTemplate" />
0248     <RegExpr attribute="Error" context="#stay" String="\S" />
0249   </context>
0250 
0251   <context name="CSS content" attribute="Normal Text" lineEndContext="#stay">
0252     <RegExpr attribute="Element" context="El Close 2" String="&lt;/style\b" insensitive="true" endRegion="style" />
0253     <IncludeRules context="FindTemplate" />
0254     <IncludeRules context="##CSS" includeAttrib="true"/>
0255   </context>
0256 
0257   <context name="JS" attribute="Normal Text" lineEndContext="#stay">
0258     <Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="script" />
0259     <DetectChar attribute="Element" context="JS content" char="&gt;" />
0260     <IncludeRules context="FindTemplate" />
0261     <IncludeRules context="FindAttributes" />
0262     <RegExpr attribute="Error" context="#stay" String="\S" />
0263   </context>
0264 
0265   <context name="JS content" attribute="Normal Text" lineEndContext="#stay">
0266     <RegExpr attribute="Element" context="El Close 2" String="&lt;/script\b" insensitive="true" endRegion="script" />
0267     <RegExpr attribute="Comment" context="JS comment close" String="//(?=.*&lt;/script\b)" insensitive="true" />
0268     <IncludeRules context="FindTemplate" />
0269     <IncludeRules context="Normal##JavaScript" includeAttrib="true"/>
0270   </context>
0271 
0272   <context name="JS comment close" attribute="Comment" lineEndContext="#pop">
0273     <RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="true" endRegion="script" />
0274     <IncludeRules context="FindTemplate" />
0275     <IncludeRules context="##Comments" />
0276   </context>
0277 
0278   <context name="Value" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ">
0279     <DetectChar attribute="Value" context="Value DQ" char="&quot;" />
0280     <DetectChar attribute="Value" context="Value SQ" char="&apos;" />
0281     <DetectSpaces />
0282   </context>
0283 
0284   <context name="Value NQ" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
0285     <IncludeRules context="FindEntityRefs" />
0286     <IncludeRules context="FindTemplate" />
0287     <RegExpr attribute="Value" context="#stay" String="/(?!&gt;)|[^/&gt;&lt;&quot;&apos;\s]" />
0288   </context>
0289 
0290   <context name="Value DQ" attribute="Value" lineEndContext="#stay">
0291     <DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
0292     <IncludeRules context="FindTemplate" />
0293     <IncludeRules context="FindEntityRefs" />
0294   </context>
0295 
0296   <context name="Value SQ" attribute="Value" lineEndContext="#stay">
0297     <DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
0298     <IncludeRules context="FindTemplate" />
0299     <IncludeRules context="FindEntityRefs" />
0300   </context>
0301 
0302 </contexts>
0303 <itemDatas>
0304   <itemData name="Normal Text" defStyleNum="dsNormal" />
0305   <itemData name="Comment" defStyleNum="dsComment" />
0306   <itemData name="CDATA" defStyleNum="dsBaseN" bold="1" />
0307   <itemData name="Processing Instruction" defStyleNum="dsKeyword" />
0308   <itemData name="Doctype" defStyleNum="dsDataType" bold="1" />
0309   <itemData name="Element" defStyleNum="dsKeyword" />
0310   <itemData name="Attribute" defStyleNum="dsOthers" />
0311   <itemData name="Value" defStyleNum="dsString" />
0312   <itemData name="EntityRef" defStyleNum="dsDecVal" />
0313   <itemData name="PEntityRef" defStyleNum="dsDecVal" />
0314   <itemData name="Error" defStyleNum="dsError" />
0315   <itemData name="Template Var" defStyleNum="dsFunction" />
0316   <itemData name="Template Tag" defStyleNum="dsFunction" />
0317   <itemData name="Template Tag Argument" defStyleNum="dsFunction" />
0318   <itemData name="Template String" defStyleNum="dsString" />
0319   <itemData name="Template Comment" defStyleNum="dsComment" />
0320   <itemData name="Template Filter" defStyleNum="dsOthers" />
0321   <itemData name="Mismatched Block Tag" defStyleNum="dsError" />
0322 </itemDatas>
0323 
0324 </highlighting>
0325 <general>
0326   <comments>
0327       <comment name="multiLine" start="{% comment %}" end="{% endcomment %}" region="templatecomment" />
0328   </comments>
0329 </general>
0330 </language>
0331 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->