| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!-- |
| 3 |
Kate syntax highlight filter for Textile formatted documents |
| 4 |
|
| 5 |
Copyright 2012 alexander Kabakov. http://kabakov.wordpress.com/ |
| 6 |
Licensed under GPL license. |
| 7 |
--> |
| 8 |
|
| 9 |
<!DOCTYPE language |
| 10 |
[ |
| 11 |
<!ENTITY strongregex "(\s|^)\*[^*]\w.*\w[^*]\*(\s|\.|,|;|:|\-|\?|$)"> |
| 12 |
<!ENTITY strikeoutregex "(\s|^)-[^-]\w.*\w[^-]-(\s|\.|,|;|:|\-|\?|$)"> |
| 13 |
<!ENTITY blockattrsregex "(\(\w+(#\w+)?\))?"> |
| 14 |
<!ENTITY formatregex "(>|<|=|<>)?"> |
| 15 |
<!ENTITY name "(?![0-9])[\w_:][\w.:_-]*"> |
| 16 |
]> |
| 17 |
|
| 18 |
<language section="Markup" name="Textile" |
| 19 |
version="6" kateversion="5.0" |
| 20 |
extensions="*.textile" priority="15" |
| 21 |
author="Alexander Kabakov ([email protected])" |
| 22 |
license="LGPL" > |
| 23 |
<highlighting> |
| 24 |
<contexts> |
| 25 |
<context attribute="Normal Text" lineEndContext="#stay" name="Normal Text" > |
| 26 |
<StringDetect attribute="comment" context="comment" String="<!--" beginRegion="comment" /> |
| 27 |
<RegExpr attribute="macro" String="\{\{&name;\}\}" /> |
| 28 |
|
| 29 |
<Detect2Chars context="sectiontitle_block" char="h" char1="1" column="0" /> |
| 30 |
<Detect2Chars context="sectionheader_block" char="h" char1="2" column="0" /> |
| 31 |
<Detect2Chars context="sectionheader_block" char="h" char1="3" column="0" /> |
| 32 |
<Detect2Chars context="sectionheader_block" char="h" char1="4" column="0" /> |
| 33 |
<Detect2Chars context="sectionheader_block" char="h" char1="5" column="0" /> |
| 34 |
|
| 35 |
<RegExpr attribute="textblock" String="^(p|pre|bq|bc)&blockattrsregex;&formatregex;\." column="0" /> |
| 36 |
<DetectChar context="image" char="!"/> |
| 37 |
|
| 38 |
<IncludeRules context="inc" /> |
| 39 |
|
| 40 |
<RegExpr attribute="itemlist" String="^[\*\#]+\s" column="0" /> |
| 41 |
<RegExpr attribute="htmllink" String='".*":http(s)?:[\w_/\\\d\.%\?&=-]*' /> |
| 42 |
</context> |
| 43 |
|
| 44 |
<context name="image" lineEndContext="#pop" attribute="image"> |
| 45 |
<RegExpr String="&blockattrsregex;" attribute="blockattrs" /> |
| 46 |
<RegExpr String="\w+\.(png|jpg|jpeg|gif|bmp)" attribute="imagefilename" /> |
| 47 |
<DetectChar char="!" context="#pop" attribute="image"/> |
| 48 |
</context> |
| 49 |
|
| 50 |
<context name="sectiontitle_block" lineEndContext="#pop" attribute="sectiontitle"> |
| 51 |
<RegExpr String="&blockattrsregex;" attribute="sectionblockattrs" /> |
| 52 |
</context> |
| 53 |
|
| 54 |
<context name="sectionheader_block" lineEndContext="#pop" attribute="sectionheader"> |
| 55 |
<RegExpr String="&blockattrsregex;" attribute="sectionblockattrs" /> |
| 56 |
</context> |
| 57 |
|
| 58 |
<context name="comment" attribute="comment" lineEndContext="#stay"> |
| 59 |
<DetectSpaces/> |
| 60 |
<StringDetect attribute="comment" context="#pop" String="-->" endRegion="comment" /> |
| 61 |
<IncludeRules context="##Comments" /> |
| 62 |
<DetectIdentifier/> |
| 63 |
</context> |
| 64 |
|
| 65 |
<context attribute="Normal Text" name="inc" lineEndContext="#stay" > |
| 66 |
<RegExpr attribute="strong" String="&strongregex;" /> |
| 67 |
<RegExpr attribute="strikeout" minimal="true" String="&strikeoutregex;"/> |
| 68 |
</context> |
| 69 |
</contexts> |
| 70 |
|
| 71 |
<itemDatas> |
| 72 |
<itemData name="Normal Text" defStyleNum="dsNormal" /> |
| 73 |
|
| 74 |
<itemData name="sectiontitle" defStyleNum="dsKeyword" bold="true" /> |
| 75 |
<itemData name="sectionheader" defStyleNum="dsFunction" bold="true" /> |
| 76 |
<itemData name="sectionblockattrs" defStyleNum="dsComment" bold="true"/> |
| 77 |
<itemData name="blockattrs" defStyleNum="dsComment" /> |
| 78 |
<itemData name="textblock" defStyleNum="dsComment" /> |
| 79 |
|
| 80 |
<itemData name="strong" defStyleNum="dsNormal" bold="true" /> |
| 81 |
<itemData name="strikeout" defStyleNum="dsNormal" strikeOut="true" /> |
| 82 |
|
| 83 |
<itemData name="itemlist" defStyleNum="dsDataType" /> |
| 84 |
|
| 85 |
<itemData name="macro" defStyleNum="dsComment" bold="true"/> |
| 86 |
<itemData name="comment" defStyleNum="dsComment" /> |
| 87 |
|
| 88 |
<itemData name="image" defStyleNum="dsFloat" /> |
| 89 |
<itemData name="imagefilename" defStyleNum="dsKeyword" /> |
| 90 |
<itemData name="htmllink" defStyleNum="dsDataType" /> |
| 91 |
</itemDatas> |
| 92 |
|
| 93 |
</highlighting> |
| 94 |
|
| 95 |
<general> |
| 96 |
<comments> |
| 97 |
<comment name="multiLine" start="<!--" end="-->" region="comment" /> |
| 98 |
</comments> |
| 99 |
</general> |
| 100 |
|
| 101 |
</language> |
| 102 |
<!-- kate: replace-tabs on; tab-width 4; indent-width 4; --> |