Colorer Outliner
rating: 0+x

My outline syntax highlighting for FAR colorer plugin (colorer 4ever)

<?xml version="1.0" encoding="Windows-1251"?>
<!DOCTYPE hrc SYSTEM "../hrc.dtd">
<?xml-stylesheet type="text/xsl" href="../hrc.xsl"?>
 
<!--
@(#)    Wiki/Outline syntax
-->
<hrc>
 
<define name="otlB"    value="dKeyword"/>   <!--    *Bold* -->
<define name="otlI"    value="dComment2"/>   <!--    /Italic/ -->
<define name="otlBI"   value="dString2"/>  <!--   /*BoldItalic*/ -->
<define name="otlU"    value="dVar2"/>       <!--    _Underline_ -->
<define name="otlBU"   value="dNumber"/>    <!--   _*BoldUnderline*_ -->
<define name="otlIU"   value="dParam"/>     <!--   /_ItalicUnderline_/ -->
<define name="otlBIU"  value="dLabel"/>     <!--  _/*BoldItalicUnderline*/_ -->
<define name="otlR"    value="dInsert"/>       <!--    #Reverse# -->
<define name="otlRB"   value="dString2"/>      <!--   *#ReverseBold#* -->
<define name="otlRI"   value="dStringQuote"/>  <!--   /#ReverseItalic#/ -->
<define name="otlRBI"  value="dVar2"/>         <!--  /*#ReverseBoldItalic#*/ -->
<define name="otlRU"   value="dString"/>       <!--   _#ReverseUnderline#_ -->
<define name="otlRBU"  value="dString2"/>      <!--  _*#ReverseBoldUnderline#*_ -->
<define name="otlRIU"  value="dStringQuote"/>  <!--  _/#ReverseItalicUnderline#/_ -->
<define name="otlRBIU" value="dParam"/>        <!-- #*/_ReverseBoldItalicUnderline#/_ -->
 
<define name="otlBullet" value="dNumber"/>        <!-- #*/_ReverseBoldItalicUnderline#/_ -->
 
<scheme name="OutlineComment">
 
    <inherit scheme="Comment" />
 
    <keywords region="dLabel">
        <word name="@author" />
        <word name="@title" />
        <word name="@see" />
        <word name="@since" />
        <word name="@modified" />
        <word name="@version" />
    </keywords>
 
    <regexp match="/(@tags\B).*$/" region0="dComment2" region1="dLabel" />
 
</scheme>
 
<scheme name="OutlinePre">
    <regexp match="/^==$/"    region0="dKeyword" lowpriority="lowpriority" />
</scheme>
 
<scheme name="OutlineCore">
 
    <!-- inet address -->
    <inherit scheme="mNetAddresses" />
    <inherit scheme="mPath" />
 
    <block    start="/^%%/i" end="/$/"
        region="dComment"    scheme="OutlineComment"  />
 
    <!-- Headers -->
    <regexp match="/^(!!! .+)/"    region0="dFunction" region1="dKeyword" />
    <regexp match="/^(!! .+)/"    region0="dFunction" region1="dString2" />
    <regexp match="/^(! .+)/"    region0="dFunction" region1="dIdentifier" />
 
    <!-- Bullets -->
    <regexp match="/^\s*[\-\*\#\xB7+]\s?=/"    region0="otlBullet" />
    <regexp match="/^\s*\d+[\)\.]\s?=/"    region0="otlBullet" />
 
    <!-- Dividers: 3 and more symbols -->
    <regexp match="/^([\-=])\1\1+$/"    region0="dLabel" />
 
    <!-- Links -->
    <regexp match="/\[\[(.+?)\]\]/"    region0="dComment" region1="dURL" />
 
    <!-- Unary stylecodes -->
    <regexp match="/(^|\(|\s) \m (\* \S .*? \S \* ) \M (\s|[.,\);:]|$)?= /x" region0="otlB"/>
    <regexp match="/(^|\(|\s) \m (\/ \S .*? \S \/ ) \M (\s|[.,\);:]|$)?= /x" region0="otlI"/>
    <regexp match="/(^|\(|\s) \m (\~ \S .*? \S \~ ) \M (\s|[.,\);:]|$)?= /x" region0="otlI"/>
    <regexp match="/(^|\(|\s) \m (\_ \S .*? \S \_ ) \M (\s|[.,\);:]|$)?= /x" region0="otlU"/>
    <regexp match="/(^|\(|\s) \m (\# \S .*? \S \# ) \M (\s|[.,\);:]|$)?= /x" region0="otlR"/>
 
    <!-- Monospace -->    
    <regexp match="/(^|\(|\s) \m `` (.+?) `` \M (\s|[.,\);:]|$)?= /x" region2="dInsert" />
 
    <block    start="/^==([a-z_]+:)?$/i" end="/^==$/"
        region="dInsert" region00="dpOpenStruct"
        region10="dpCloseStruct" scheme="OutlinePre"  />
 
    <regexp match="/^==([a-z_]+:)?$/" region0="dDirective" />
 
    <regexp match="/^\@subsec(tion)?\B(.+)?/" region0="dDirective" region2="dString2" />
    <regexp match="/^\@section\B(.+)?/"    region0="dDirective"  region1="dIdentifier" />
    <regexp match="/^\@chap(ter)?\B(.+)?/"    region0="dDirective"  region2="dKeyword" />
 
    <!-- DL: definition list -->
    <regexp match="/^\s*(::)(.+?)((::)|$)/"    region0="dKeyword2" region1="dString2" region3="dString2" />
 
    <!-- Date, Time -->
    <inherit scheme="mDate" />
    <inherit scheme="mTime" />
 
    <keywords region="dDate">
        <word name="Пн" />
        <word name="Вт" />
        <word name="Ср" />
        <word name="Чт" />
        <word name="Пт" />
        <word name="Сб" />
        <word name="Вс" />
 
        <word name="Воскресение" />
        <word name="Понедельник" />
        <word name="Вторник" />
        <word name="Среда" />
        <word name="Четверг" />
        <word name="Пятница" />
        <word name="Суббота"  />
        <word name="Воскресение"  />
 
        <word name="Январь" />
        <word name="Февраль" />
        <word name="Март" />
        <word name="Апрель" />
        <word name="Май" />
        <word name="Июнь" />
        <word name="Июль" />
        <word name="Август" />
        <word name="Сентябрь" />
        <word name="Октябрь" />
        <word name="Ноябрь" />
        <word name="Декабрь" />
 
        <word name="Янв" />
        <word name="Фев" />
        <word name="Мар" />
        <word name="Апр" />
        <word name="Май" />
        <word name="Июн" />
        <word name="Июл" />
        <word name="Авг" />
        <word name="Сен" />
        <word name="Окт" />
        <word name="Ноя" />
        <word name="Дек" />
 
        <word name="Sun" />
        <word name="Mon" />
        <word name="Tue" />
        <word name="Wed" />
        <word name="Thu" />
        <word name="Fri" />
        <word name="Sat" />
 
        <word name="Sunday" />
        <word name="Monday" />
        <word name="Tuesday" />
        <word name="Wednesday" />
        <word name="Thursday" />
        <word name="Friday" />
        <word name="Saturday" />
        <word name="Sunday" />
 
        <word name="January" />
        <word name="February" />
        <word name="March" />
        <word name="April" />
        <word name="May" />
        <word name="June" />
        <word name="July" />
        <word name="August" />
        <word name="September" />
        <word name="October" />
        <word name="November" />
        <word name="December" />
 
        <word name="Jan" />
        <word name="Feb" />
        <word name="Mar" />
        <word name="Apr" />
        <word name="May" />
        <word name="Jun" />
        <word name="Jul" />
        <word name="Aug" />
        <word name="Sep" />
        <word name="Oct" />
        <word name="Nov" />
        <word name="Dec" />
 
    </keywords>
 
    <regexp match="/``.*?''/" region0="dString" />
 
    <!-- TODO: todo :) -->
    <regexp match="/\[!\]/" region0="dTODO" />
    <regexp match="/(^|\s)\m[!\?]{3,}/" region0="dTODO" />
 
</scheme>
 
<scheme name="Outline">
 
    <block start="/^\s*([^\s\>&lt;]*(>>)+[^>])/" end="/$/" scheme="OutlineCore" region="dComment"  region01="dLabel" />
    <block start="/^\s*([^\s\>&lt;]*(>)+)/"      end="/$/" scheme="OutlineCore" region="dComment2" region01="dLabel" />
    <block start="/^(\>)/"                       end="/$/" scheme="OutlineCore" region="dComment"  region01="dLabel" />
 
    <inherit scheme="OutlineCore" />
 
</scheme>
 
</hrc>

In hrc\colorer.hrc :

<type descr="Outline/Text" name="outline" exts="/faq/i">
        <load name="misc/outline.hrc"/>
        <scheme name="outline"/>
    </type>
 
    <!-- you must not to delete this type. it's parameters are used by default -->
    <type descr="default" name="default" exts="//">
        ...
        <switch type="outline"    match="/^%%/i" />
        <switch type="outline"    match="/^\.LOG$/" />
        <switch type="outline"    match="/^[*!]{2,}/" />
        ...
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License