| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY space " "> |
| 5 |
<!ENTITY end "(?=\s*$)"> |
| 6 |
<!ENTITY content "(?:\S(?:.*\S)?)?"> |
| 7 |
<!ENTITY headerKey "^[a-zA-Z0-9][\w\-\s]*\:(?=\s)"> |
| 8 |
|
| 9 |
<!-- Link (obtained from markdown.xml) --> |
| 10 |
<!ENTITY startLink "(?:https?|ftp|news|telnet|gopher|wais)\://"> |
| 11 |
<!ENTITY implicitLink "\b&startLink;[^">\s`\)]*[^\s!"'`\(\)\*,\.:;<>\?~\]\}\\](?=[[:punct:]]*(?:[\s\)]|$))"> |
| 12 |
<!ENTITY link "\b&startLink;[^">\]\s`\)]*[^\s!"'`\(\)\*,\.:;<>\?~\]\}\\](?=[[:punct:]]*(?:[\s\)\]]|$))"> |
| 13 |
<!-- Email (source: http://emailregex.com) --> |
| 14 |
<!ENTITY email "(?:(?:[^<>\(\)\[\]\\\.,;:\s@"]+(?:\.[^<>\(\)\[\]\\\.,;:\s@"]+)*)|(?:"[^"]+"))@(?:(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}])|(?:(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,}))\b"> |
| 15 |
|
| 16 |
<!ENTITY title1 "(\={1,5})[^=](?:.*[^=])?\1"> |
| 17 |
<!ENTITY title2 "(\+{1,5})[^\+](?:.*[^\+])?\1"> |
| 18 |
]> |
| 19 |
|
| 20 |
<!-- Created by Juliano Dorneles dos Santos <[email protected]> --> |
| 21 |
<!-- Fixed for 3.2 Helio Chissini de Castro <[email protected]> --> |
| 22 |
<!-- Extended and adapted (v1.20) by Eric Forgeot < http://esclinux.tk > --> |
| 23 |
<language name="txt2tags" extensions="*.t2t" section="Markup" mimetype="text/txt2tags" version="9" kateversion="5.0" casesensitive="1"> |
| 24 |
<highlighting> |
| 25 |
|
| 26 |
<contexts> |
| 27 |
|
| 28 |
<!-- Start Document: find header --> |
| 29 |
<context name="StartDocument" attribute="Normal" lineEndContext="Normal" lineEmptyContext="Normal" fallthrough="true" fallthroughContext="Normal"> |
| 30 |
<RegExpr attribute="Header Title" context="HeaderValue1" String="^&headerKey;" column="0"/> |
| 31 |
</context> |
| 32 |
<context name="HeaderValue1" attribute="Header Value" lineEndContext="#pop!HeaderKey2" lineEmptyContext="#pop!Normal" /> |
| 33 |
<context name="HeaderKey2" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop!Normal" fallthrough="true" fallthroughContext="#pop!Normal"> |
| 34 |
<RegExpr attribute="Header Title" context="#pop!HeaderValue2" String="^&headerKey;" column="0"/> |
| 35 |
<RegExpr context="#pop!Normal" String="^." column="0" lookAhead="true"/> |
| 36 |
</context> |
| 37 |
<context name="HeaderValue2" attribute="Header Value" lineEndContext="#pop!HeaderKey3" lineEmptyContext="#pop!Normal" /> |
| 38 |
<context name="HeaderKey3" attribute="Normal" lineEndContext="#stay" lineEmptyContext="#pop!Normal" fallthrough="true" fallthroughContext="#pop!Normal"> |
| 39 |
<RegExpr attribute="Header Title" context="#pop!HeaderValue3" String="&headerKey;" column="0"/> |
| 40 |
<RegExpr context="#pop!Normal" String="^." column="0" lookAhead="true"/> |
| 41 |
</context> |
| 42 |
<context name="HeaderValue3" attribute="Header Value" lineEndContext="#pop!Normal" lineEmptyContext="#pop!Normal" /> |
| 43 |
|
| 44 |
<!-- Normal Document --> |
| 45 |
<context name="Normal" attribute="Normal" lineEndContext="#stay"> |
| 46 |
<RegExpr attribute="Verbatim Block" context="VerbatimBlock" String="^```&end;" column="0" beginRegion="VerbatimBlock"/> |
| 47 |
<RegExpr attribute="Raw Block" context="RawBlock" String="^"""&end;" column="0" beginRegion="RawBlock"/> |
| 48 |
<RegExpr attribute="Tagged Block" context="TagBlock" String="^'''&end;" column="0" beginRegion="TagBlock"/> |
| 49 |
<StringDetect attribute="Verbatim Line" context="VerbatimLine" String="```&space;" column="0"/> |
| 50 |
<StringDetect attribute="Raw Line" context="RawLine" String=""""&space;" column="0"/> |
| 51 |
<StringDetect attribute="Tagged Line" context="TagLine" String="'''&space;" column="0"/> |
| 52 |
|
| 53 |
<RegExpr attribute="Bar" context="#stay" String="^\s*[_\=\-]{20,}&end;" column="0"/> |
| 54 |
<RegExpr attribute="Title" context="#stay" String="^\s*(?|&title1;|&title2;)(?:\[.*\])?&end;" column="0" beginRegion="Header" endRegion="Header"/> |
| 55 |
<RegExpr attribute="Tabel" context="Tabel" String="^&space;*\|[\|/_]?&space;" column="0"/> |
| 56 |
<RegExpr attribute="DefList" context="ListLine" String="^&space;*\:&space;" column="0"/> |
| 57 |
<RegExpr attribute="List" context="ListLine" String="^&space;*\-{1,3}&space;" column="0"/> |
| 58 |
<RegExpr attribute="NumList" context="ListLine" String="^&space;*\+{1,3}&space;" column="0"/> |
| 59 |
<DetectChar attribute="Quote" context="Quote" char="	" column="0"/> |
| 60 |
<LineContinue attribute="EOF" context="#stay" char="$" column="0" beginRegion="Header" endRegion="Header"/> |
| 61 |
|
| 62 |
<IncludeRules context="Default"/> |
| 63 |
<DetectChar attribute="Comment" context="FindComments" char="%" column="0" lookAhead="true"/> |
| 64 |
|
| 65 |
<RegExpr attribute="Link (Normal)" String="&implicitLink;|&email;"/> |
| 66 |
</context> |
| 67 |
<context name="Default" attribute="Normal" lineEndContext="#stay"> |
| 68 |
<StringDetect attribute="Interpolated String" context="InterpolatedString" String="%%date"/> |
| 69 |
<StringDetect attribute="Interpolated String" context="InterpolatedString" String="%%mtime"/> |
| 70 |
<StringDetect attribute="Interpolated String" context="InterpolatedString" String="%%infile"/> |
| 71 |
<StringDetect attribute="Interpolated String" context="InterpolatedString" String="%%outfile"/> |
| 72 |
<StringDetect attribute="Interpolated String" context="#stay" String="%%toc"/> |
| 73 |
<RegExpr attribute="BoldItalic" context="#stay" String="\*\*//&content;//\*\*|//\*\*&content;\*\*//" minimal="true" /> |
| 74 |
<RegExpr attribute="Bold" context="#stay" String="\*\*&content;\*\*" minimal="true"/> |
| 75 |
<RegExpr attribute="Italic" context="#stay" String="//&content;//" minimal="true"/> |
| 76 |
<RegExpr attribute="Underline" context="#stay" String="__&content;__" minimal="true"/> |
| 77 |
<RegExpr attribute="Strikeout" context="#stay" String="--&content;--" minimal="true"/> |
| 78 |
<RegExpr attribute="Monospaced" context="#stay" String="``&content;``" minimal="true"/> |
| 79 |
<RangeDetect attribute="Link" context="Link" char="[" char1="]" lookAhead="true"/> |
| 80 |
</context> |
| 81 |
|
| 82 |
<context name="FindComments" attribute="Comment" lineEndContext="#pop"> |
| 83 |
<RegExpr attribute="Constant Character" context="#pop!ConstantChar" String="^%!\s*(?:target|encoding|style|options|include|includeconf|preproc|postproc|guicolors)\s*(?:\(\w*\)\s*)?\:" column="0"/> |
| 84 |
<RegExpr attribute="Comment" context="#pop!CommentBlock" String="^%%%&end;" column="0" beginRegion="CommentBlock"/> |
| 85 |
<DetectChar attribute="Comment" context="#pop!CommentLine" char="%" column="0"/> |
| 86 |
</context> |
| 87 |
<context name="CommentLine" attribute="Comment" lineEndContext="#pop"> |
| 88 |
<DetectSpaces /> |
| 89 |
<IncludeRules context="##Comments"/> |
| 90 |
</context> |
| 91 |
<context name="CommentBlock" attribute="Comment" lineEndContext="#stay"> |
| 92 |
<RegExpr attribute="Comment" context="#pop" String="^%%%&end;" column="0" endRegion="CommentBlock"/> |
| 93 |
<DetectSpaces /> |
| 94 |
<IncludeRules context="##Comments"/> |
| 95 |
</context> |
| 96 |
<context name="ConstantChar" attribute="Comment" lineEndContext="#pop" /> |
| 97 |
|
| 98 |
<context name="ListLine" attribute="List Content" lineEndContext="#pop"> |
| 99 |
<IncludeRules context="Default"/> |
| 100 |
<RegExpr attribute="Link (List Content)" String="&implicitLink;|&email;"/> |
| 101 |
</context> |
| 102 |
<context name="Tabel" attribute="Tabel" lineEndContext="#pop"> |
| 103 |
<RegExpr attribute="Link (Tabel)" String="&implicitLink;|&email;"/> |
| 104 |
</context> |
| 105 |
<context name="Quote" attribute="Quote" lineEndContext="#pop"> |
| 106 |
<RegExpr attribute="Link (Quote)" String="&implicitLink;|&email;"/> |
| 107 |
</context> |
| 108 |
<context name="Link" attribute="Link" lineEndContext="#pop"> |
| 109 |
<DetectChar attribute="Link" context="#pop!LinkContent" char="["/> |
| 110 |
</context> |
| 111 |
<context name="LinkContent" attribute="Link" lineEndContext="#pop"> |
| 112 |
<DetectChar attribute="Link" context="#pop" char="]"/> |
| 113 |
<RegExpr attribute="Link" context="LinkContent" String="\[(?=[^\s\[\]]*\])"/> |
| 114 |
<RegExpr attribute="Link URL" String="&link;|&email;"/> |
| 115 |
</context> |
| 116 |
|
| 117 |
<context name="InterpolatedString" attribute="Interpolated String" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> |
| 118 |
<RangeDetect attribute="Interpolated String" context="#pop" char="(" char1=")"/> |
| 119 |
</context> |
| 120 |
<context name="VerbatimBlock" attribute="Verbatim Block" lineEndContext="#stay"> |
| 121 |
<RegExpr attribute="Verbatim Block" context="#pop" String="^```&end;" column="0" endRegion="VerbatimBlock"/> |
| 122 |
</context> |
| 123 |
<context name="RawBlock" attribute="Raw Block" lineEndContext="#stay"> |
| 124 |
<RegExpr attribute="Raw Block" context="#pop" String="^"""&end;" column="0" endRegion="RawBlock"/> |
| 125 |
</context> |
| 126 |
<context name="TagBlock" attribute="Tagged Block" lineEndContext="#stay"> |
| 127 |
<RegExpr attribute="Tagged Block" context="#pop" String="^'''&end;" column="0" endRegion="TagBlock"/> |
| 128 |
</context> |
| 129 |
<context name="VerbatimLine" attribute="Verbatim Line" lineEndContext="#pop" /> |
| 130 |
<context name="RawLine" attribute="Raw Line" lineEndContext="#pop" /> |
| 131 |
<context name="TagLine" attribute="Tagged Line" lineEndContext="#pop" /> |
| 132 |
|
| 133 |
</contexts> |
| 134 |
|
| 135 |
<itemDatas> |
| 136 |
<itemData name="Normal" defStyleNum="dsNormal" /> |
| 137 |
<itemData name="Comment" defStyleNum="dsComment" /> |
| 138 |
<itemData name="Interpolated String" defStyleNum="dsVariable" spellChecking="false" /> |
| 139 |
<itemData name="Constant Character" defStyleNum="dsPreprocessor" spellChecking="false" /> |
| 140 |
<itemData name="BoldItalic" defStyleNum="dsNormal" bold="1" italic="1" /> |
| 141 |
<itemData name="Bold" defStyleNum="dsNormal" bold="1" /> |
| 142 |
<itemData name="Italic" defStyleNum="dsNormal" italic="1" /> |
| 143 |
<itemData name="Underline" defStyleNum="dsNormal" underline="1" /> |
| 144 |
<itemData name="Strikeout" defStyleNum="dsNormal" strikeOut="1" /> |
| 145 |
<itemData name="Monospaced" defStyleNum="dsInformation" /> |
| 146 |
<itemData name="Verbatim Line" defStyleNum="dsInformation" /> |
| 147 |
<itemData name="Verbatim Block" defStyleNum="dsInformation" /> |
| 148 |
<itemData name="Raw Line" defStyleNum="dsVerbatimString" /> |
| 149 |
<itemData name="Raw Block" defStyleNum="dsVerbatimString" /> |
| 150 |
<itemData name="Tagged Line" defStyleNum="dsVerbatimString" /> |
| 151 |
<itemData name="Tagged Block" defStyleNum="dsVerbatimString" /> |
| 152 |
<itemData name="Title" defStyleNum="dsFunction" bold="1" /> |
| 153 |
<itemData name="Link" defStyleNum="dsOthers" /> |
| 154 |
<itemData name="Tabel" defStyleNum="dsString" /> |
| 155 |
<itemData name="DefList" defStyleNum="dsSpecialString" bold="1" spellChecking="false" /> |
| 156 |
<itemData name="List" defStyleNum="dsSpecialString" bold="1" spellChecking="false" /> |
| 157 |
<itemData name="NumList" defStyleNum="dsSpecialString" bold="1" spellChecking="false" /> |
| 158 |
<itemData name="List Content" defStyleNum="dsNormal" /> |
| 159 |
<itemData name="Quote" defStyleNum="dsAttribute" /> |
| 160 |
<itemData name="Bar" defStyleNum="dsKeyword" spellChecking="false" /> |
| 161 |
<itemData name="EOF" defStyleNum="dsSpecialChar" spellChecking="false" /> |
| 162 |
<itemData name="Link (Normal)" defStyleNum="dsNormal" underline="true" spellChecking="false" /> |
| 163 |
<itemData name="Link (List Content)" defStyleNum="dsNormal" underline="true" spellChecking="false" /> |
| 164 |
<itemData name="Link (Tabel)" defStyleNum="dsString" underline="true" spellChecking="false" /> |
| 165 |
<itemData name="Link (Quote)" defStyleNum="dsAttribute" underline="true" spellChecking="false" /> |
| 166 |
<itemData name="Link URL" defStyleNum="dsOthers" underline="true" spellChecking="false" /> |
| 167 |
<itemData name="Header Title" defStyleNum="dsAnnotation" /> |
| 168 |
<itemData name="Header Value" defStyleNum="dsComment" /> |
| 169 |
</itemDatas> |
| 170 |
|
| 171 |
</highlighting> |
| 172 |
|
| 173 |
<general> |
| 174 |
<comments> |
| 175 |
<comment name="singleLine" start="%"/> |
| 176 |
</comments> |
| 177 |
</general> |
| 178 |
|
| 179 |
</language> |
| 180 |
<!-- kate: replace-tabs off; --> |