Commit 5460525b authored by Christoph Cullmann's avatar Christoph Cullmann

backport the fixes for rest:

remove highlight of other languages from reST

emove the reST HL rules to include syntax highlighting of specific languages for code blocks.

I'm rather on the fence about actually merging this, as it can be seen as a regression. OTOH it avoids silly things like including C++/Python/Doxygen styles in CMake (e.g. see http://commits.kde.org/kate/9695f1785ad8 ).

kill the duplicated rest hl file

REVIEW: 116580
parent 26912e6d
......@@ -11,7 +11,7 @@
Copyright 2010 Matt Williams (matt@milliams.com)
Copyright 2014 Matthew Woehlke (mw_triad@users.sourceforge.net)
-->
<language name="reStructuredText" extensions="*.rst" section="Markup" mimetype="text/x-rst" version="1.03" kateversion="2.4" casesensitive="1">
<language name="reStructuredText" extensions="*.rst" section="Markup" mimetype="text/x-rst" version="1.4" kateversion="2.4" casesensitive="1">
<highlighting>
......@@ -23,9 +23,6 @@
<RegExpr attribute="Footnote" context="#stay" String="^\s*\.\. \[(\d+|#|\*|#[&SimpleReferenceNameChars;]+)\]\s" minimal="true" column="0"/>
<RegExpr attribute="Citation" context="#stay" String="^\s*\.\. \[[&SimpleReferenceNameChars;]+\]\s" minimal="true" column="0"/>
<RegExpr attribute="HyperlinkTarget" context="#stay" String="^\s*(\.\. (__:|_[&SimpleReferenceNameChars; ]+:(\s|$))|__ )" minimal="true" column="0"/>
<RegExpr attribute="CMakeCode" String="^\s*\.\. code-block::\s*cmake$" context="CMakeCodeBlock" column="0"/>
<RegExpr attribute="CppCode" String="^\s*\.\. code-block::\s*c\+\+$" context="CppCodeBlock" column="0"/>
<RegExpr attribute="PythonCode" String="^\s*\.\. code-block::\s*python$" context="PythonCodeBlock" column="0"/>
<RegExpr attribute="Code" String="^\s*\.\. code-block::" context="CodeBlock" column="0"/>
<RegExpr attribute="Directive" context="#stay" String="^\s*\.\. [\w-_\.]+::(\s|$)" minimal="true" column="0"/>
<RegExpr attribute="Code" String="::$" context="CodeBlock" />
......@@ -67,46 +64,10 @@
<IncludeRules context="##Alerts"/>
</context>
<context name="CMakeCodeBlock" attribute="CMakeCode" lineEndContext="#stay">
<RegExpr attribute="CMakeCode" String="^(\s+)(?=\S)" context="CMakeCodeRegion" column="0"/>
</context>
<context name="CppCodeBlock" attribute="CppCode" lineEndContext="#stay">
<RegExpr attribute="CppCode" String="^(\s+)(?=\S)" context="CppCodeRegion" column="0"/>
</context>
<context name="PythonCodeBlock" attribute="PythonCode" lineEndContext="#stay">
<RegExpr attribute="PythonCode" String="^(\s+)(?=\S)" context="PythonCodeRegion" column="0"/>
</context>
<context name="CodeBlock" attribute="Code" lineEndContext="#stay">
<RegExpr attribute="Code" String="^(\s+)(?=\S)" context="Code" column="0"/>
</context>
<context name="CMakeCodeRegion" attribute="CMakeCode" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="CMakeCode" String="^%1" lookAhead="true" context="CMakeCode" column="0" dynamic="true"/>
<RegExpr attribute="Normal" String="^(.|$)" lookAhead="true" context="#pop#pop" column="0"/>
<IncludeRules context="CMakeCode" includeAttrib="true"/>
</context>
<context name="CMakeCode" attribute="CMakeCode" lineEndContext="#pop">
<IncludeRules context="##CMake" includeAttrib="true"/>
</context>
<context name="CppCodeRegion" attribute="CppCode" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="CppCode" String="^%1" lookAhead="true" context="CppCode" column="0" dynamic="true"/>
<RegExpr attribute="Normal" String="^(.|$)" lookAhead="true" context="#pop#pop" column="0"/>
<IncludeRules context="CppCode" includeAttrib="true"/>
</context>
<context name="CppCode" attribute="CppCode" lineEndContext="#pop">
<IncludeRules context="##C++" includeAttrib="true"/>
</context>
<context name="PythonCodeRegion" attribute="PythonCode" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="PythonCode" String="^%1" lookAhead="true" context="PythonCode" column="0" dynamic="true"/>
<RegExpr attribute="Normal" String="^(.|$)" lookAhead="true" context="#pop#pop" column="0"/>
<IncludeRules context="PythonCode" includeAttrib="true"/>
</context>
<context name="PythonCode" attribute="PythonCode" lineEndContext="#pop">
<IncludeRules context="##Python" includeAttrib="true"/>
</context>
<context name="Code" attribute="Code" lineEndContext="#stay" dynamic="true">
<RegExpr attribute="Code" String="^%1" context="#stay" column="0" dynamic="true"/>
<RegExpr attribute="Normal" String="^(.|$)" lookAhead="true" context="#pop#pop" column="0"/>
......@@ -132,9 +93,6 @@
<itemData name="Directive" defStyleNum="dsDataType" />
<itemData name="SubstitutionDefinition" defStyleNum="dsDataType" />
<itemData name="Role" defStyleNum="dsKeyword" />
<itemData name="CMakeCode" defStyleNum="dsDataType" />
<itemData name="CppCode" defStyleNum="dsDataType" />
<itemData name="PythonCode" defStyleNum="dsDataType" />
<itemData name="Code" defStyleNum="dsDataType" />
<itemData name="Comment" defStyleNum="dsComment" />
</itemDatas>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="Restructured Text" version="1.0" kateversion="2.4" section="Markup" extensions="*.rst" author="Massimiliano Torromeo (massimiliano.torromeo@gmail.com)" license="LGPL">
<highlighting>
<contexts>
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
<RegExpr attribute="Emphasys" String="\*[^* ].*\S\*" context="#stay" />
<RegExpr attribute="Strong" String="\*\*\S.*\S\*\*" context="#stay" />
<RegExpr attribute="Literal" String="``\S.*\S``" context="#stay" />
<RegExpr attribute="Directive" String="^\.\. " context="Directive" />
<RegExpr attribute="Title" String="^(#{3,}|\*{3,}|={3,}|-{3,}|\^{3,}|&quot;{3,}|&apos;{3,}|~{3,}|`{3,}|\+{3,})$" context="#stay" />
<RegExpr attribute="OrderedList" String="[#0-9]\.\s" firstNonSpace="1" context="#stay" />
<AnyChar attribute="UnorderedList" String="*+-" firstNonSpace="1" context="#stay" />
<DetectChar attribute="Link" char="`" context="Link" />
<RegExpr attribute="Code" String="::$" context="CodeBlock" />
</context>
<context name="CodeBlock" attribute="Code" lineEndContext="#stay">
<RegExpr attribute="Code" String="^\s" context="Code" />
</context>
<context name="Code" attribute="Code" lineEndContext="#stay">
<RegExpr attribute="Normal" String="^\S" lookAhead="true" context="#pop#pop" />
</context>
<context name="Directive" attribute="Directive" lineEndContext="#pop">
<RegExpr attribute="Keyword" String="\w+" context="#stay" />
</context>
<context name="Link" attribute="Link" lineEndContext="#pop">
<DetectChar attribute="Link" char="&lt;" context="URL" />
<Detect2Chars attribute="Link" char="`" char1="_" context="#pop" />
</context>
<context name="URL" attribute="LinkUrl" lineEndContext="#stay">
<RegExpr attribute="LinkUrl" String="[^&gt;]+" context="#stay" />
<DetectChar attribute="Link" char="&gt;" context="#pop" />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
<itemData name="Directive" defStyleNum="dsDecVal" />
<itemData name="Emphasys" defStyleNum="dsNormal" italic="1" />
<itemData name="Strong" defStyleNum="dsNormal" bold="1" />
<itemData name="Literal" defStyleNum="dsDataType" />
<itemData name="Keyword" defStyleNum="dsKeyword" />
<itemData name="OrderedList" defStyleNum="dsDecVal" />
<itemData name="UnorderedList" defStyleNum="dsFloat" />
<itemData name="Link" defStyleNum="dsString" />
<itemData name="LinkUrl" defStyleNum="dsString" bold="1" />
<itemData name="Title" defStyleNum="dsKeyword" bold="1" />
<itemData name="Code" defStyleNum="dsDataType" />
<itemData name="Error" defStyleNum="dsError" />
</itemDatas>
</highlighting>
</language>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment