Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/rmarkdown.xml
Show All 9 Lines | 7 | depends on: | |||
---|---|---|---|---|---|
10 | Kate highlighting module for LaTeX | 10 | Kate highlighting module for LaTeX | ||
11 | Kate highlighting module for YAML | 11 | Kate highlighting module for YAML | ||
12 | --> | 12 | --> | ||
13 | 13 | | |||
14 | <language name="R Markdown" | 14 | <language name="R Markdown" | ||
15 | section="Markup" | 15 | section="Markup" | ||
16 | extensions="*.rmd;*.Rmd;*.RMD" | 16 | extensions="*.rmd;*.Rmd;*.RMD" | ||
17 | mimetype="text/x-r-markdown" | 17 | mimetype="text/x-r-markdown" | ||
18 | version="4" | 18 | version="5" | ||
19 | kateversion="3.4" | 19 | kateversion="3.4" | ||
20 | casesensitive="true" | 20 | casesensitive="true" | ||
21 | author="Dirk Sarpe (dsarpe@posteo.de)" | 21 | author="Dirk Sarpe (dsarpe@posteo.de)" | ||
22 | license="GPL"> | 22 | license="GPL"> | ||
23 | 23 | | |||
24 | <highlighting> | 24 | <highlighting> | ||
25 | <contexts> | 25 | <contexts> | ||
26 | 26 | | |||
27 | <context attribute="Markdown" name="Normal Text" lineEndContext="#stay"> | 27 | <context attribute="Markdown" name="Normal Text" lineEndContext="#stay"> | ||
28 | <RegExpr String="^```\{r.*\}" attribute="Structure" context="R block" | 28 | <RegExpr String="^```\{r.*\}" column="0" attribute="Structure" context="R block" | ||
29 | beginRegion="block"/> | 29 | beginRegion="R block"/> | ||
30 | <Detect2Chars char="`" char1="r" attribute="Structure" | 30 | <Detect2Chars char="`" char1="r" attribute="Structure" | ||
31 | context="R inline"/> | 31 | context="R inline"/> | ||
32 | <Detect2Chars char="$" char1="$" attribute="MathMode" | 32 | <Detect2Chars char="$" char1="$" attribute="MathMode" | ||
33 | context="LaTeX equation block" beginRegion="block"/> | 33 | context="LaTeX equation block" beginRegion="LaTeX equation block"/> | ||
34 | <DetectChar char="$" attribute="MathMode" | 34 | <DetectChar char="$" attribute="MathMode" | ||
35 | context="LaTeX inline equation"/> | 35 | context="LaTeX inline equation"/> | ||
36 | <RegExpr String="^---$" context="YAMLhead" beginRegion="block"/> | 36 | <RegExpr String="^---$" column="0" attribute="Markdown" context="YAMLhead" | ||
37 | beginRegion="YAMLhead block"/> | ||||
37 | <IncludeRules context="##Markdown" includeAttrib="true"/> | 38 | <IncludeRules context="##Markdown" includeAttrib="true"/> | ||
38 | </context> | 39 | </context> | ||
39 | 40 | | |||
40 | <context name="R block" attribute="Markdown" lineEndContext="#stay"> | 41 | <context name="R block" attribute="Markdown" lineEndContext="#stay"> | ||
41 | <RegExpr String="^```$" attribute="Structure" context="Normal Text" | 42 | <RegExpr String="^```$" column="0" attribute="Structure" context="#pop" | ||
42 | endRegion="block"/> | 43 | endRegion="R block"/> | ||
43 | <IncludeRules context="##R Script" includeAttrib="true"/> | 44 | <IncludeRules context="##R Script" includeAttrib="true"/> | ||
44 | </context> | 45 | </context> | ||
45 | 46 | | |||
46 | <context name="R inline" attribute="Markdown" lineEndContext="#stay"> | 47 | <context name="R inline" attribute="Markdown" lineEndContext="#stay"> | ||
47 | <DetectChar char="`" attribute="Structure" context="Normal Text"/> | 48 | <DetectChar char="`" attribute="Structure" context="#pop"/> | ||
48 | <IncludeRules context="##R Script" includeAttrib="true"/> | 49 | <IncludeRules context="##R Script" includeAttrib="true"/> | ||
49 | </context> | 50 | </context> | ||
50 | 51 | | |||
51 | <context name="LaTeX equation block" attribute="MathMode" | 52 | <context name="LaTeX equation block" attribute="MathMode" | ||
52 | lineEndContext="#stay"> | 53 | lineEndContext="#stay"> | ||
53 | <Detect2Chars char="$" char1="$" attribute="MathMode" | 54 | <Detect2Chars char="$" char1="$" attribute="MathMode" | ||
54 | context="Normal Text" endRegion="block"/> | 55 | context="#pop" endRegion="LaTeX equation block"/> | ||
55 | <IncludeRules context="MathModeDisplay##LaTeX" includeAttrib="true"/> | 56 | <IncludeRules context="MathModeDisplay##LaTeX" includeAttrib="true"/> | ||
56 | </context> | 57 | </context> | ||
57 | 58 | | |||
58 | <context name="LaTeX inline equation" attribute="MathMode" | 59 | <context name="LaTeX inline equation" attribute="MathMode" | ||
59 | lineEndContext="#stay"> | 60 | lineEndContext="#stay"> | ||
60 | <DetectChar char="$" attribute="MathMode" context="Normal Text"/> | 61 | <DetectChar char="$" attribute="MathMode" context="#pop"/> | ||
61 | <IncludeRules context="MathMode##LaTeX" includeAttrib="true"/> | 62 | <IncludeRules context="MathMode##LaTeX" includeAttrib="true"/> | ||
62 | </context> | 63 | </context> | ||
63 | 64 | | |||
64 | <context name="YAMLhead" attribute="Document Headers" | 65 | <context name="YAMLhead" attribute="Document Headers" | ||
65 | lineEndContext="#stay"> | 66 | lineEndContext="#stay"> | ||
66 | <RegExpr String="^---$" context="Normal Text"/> | 67 | <RegExpr String="^---$" column="0" attribute="Markdown" context="#pop" | ||
68 | endRegion="YAMLhead block"/> | ||||
67 | <IncludeRules context="##YAML" includeAttrib="true"/> | 69 | <IncludeRules context="##YAML" includeAttrib="true"/> | ||
68 | </context> | 70 | </context> | ||
69 | 71 | | |||
70 | </contexts> | 72 | </contexts> | ||
71 | 73 | | |||
72 | <itemDatas> | 74 | <itemDatas> | ||
73 | <itemData name="Markdown" defStyleNum="dsNormal"/> | 75 | <itemData name="Markdown" defStyleNum="dsNormal"/> | ||
74 | <itemData name="Structure" defStyleNum="dsRegionMarker"/> | 76 | <itemData name="Structure" defStyleNum="dsRegionMarker"/> | ||
75 | <itemData name="MathMode" defStyleNum="dsRegionMarker" color="#00A000"/> | 77 | <itemData name="MathMode" defStyleNum="dsRegionMarker" color="#00A000"/> | ||
76 | <itemData name="Document Headers" defStyleNum="dsOthers"/> | 78 | <itemData name="Document Headers" defStyleNum="dsOthers"/> | ||
77 | </itemDatas> | 79 | </itemDatas> | ||
78 | 80 | | |||
79 | </highlighting> | 81 | </highlighting> | ||
80 | 82 | | |||
81 | </language> | 83 | </language> |