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