File: test.mkiv.html

package info (click to toggle)
kf6-syntax-highlighting 6.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 47,568 kB
  • sloc: xml: 197,750; cpp: 12,850; python: 3,023; sh: 955; perl: 546; ruby: 488; pascal: 393; javascript: 161; php: 150; jsp: 132; lisp: 131; haskell: 124; ada: 119; ansic: 107; makefile: 96; f90: 94; ml: 85; cobol: 81; yacc: 71; csh: 62; erlang: 54; sql: 51; java: 47; objc: 37; awk: 31; asm: 30; tcl: 29; fortran: 18; cs: 10
file content (194 lines) | stat: -rw-r--r-- 20,473 bytes parent folder | download
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>test.mkiv</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (ConTeXt) - Theme (Breeze Light)"/>
</head><body style="background-color:#ffffff;color:#1f1c1b"><pre>
<span style="color:#898887">% ConTeXt test file for Kate's syntax highlighting and code folding</span>


<span style="color:#898887">%% Comments</span>
<span style="color:#898887">%   This is a comment</span>
<span style="color:#644a9b">\%</span>  Not a comment
<span style="color:#644a9b">\\</span><span style="color:#898887">% This is a comment</span>

<span style="color:#898887">% Titles should be bold</span>
<span style="font-weight:bold">\subject</span><span style="color:#924c9d">{</span>Subject<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsubject</span><span style="color:#924c9d">{</span>Sub-subject<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsubsubject</span><span style="color:#924c9d">{</span>Sub-sub-subject<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsubsubsubject</span><span style="color:#924c9d">{</span>Sub-sub-sub-subject<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsubsubsubsubject</span><span style="color:#924c9d">{</span>Sub-sub-sub-sub-subject<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\section</span><span style="color:#924c9d">{</span>Section<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsection</span><span style="color:#924c9d">{</span>Sub-section<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsubsection</span><span style="color:#924c9d">{</span>Sub-sub-section<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsubsubsection</span><span style="color:#924c9d">{</span>Sub-sub-sub-section<span style="color:#924c9d">}</span>
<span style="font-weight:bold">\subsubsubsubsection</span><span style="color:#924c9d">{</span>Sub-sub-sub-sub-section<span style="color:#924c9d">}</span>

<span style="color:#898887">%% Start/stop blocks</span>
<span style="color:#0057ae;background-color:#e0e9f8">\startsection</span>
Can be nested
<span style="color:#0057ae;background-color:#e0e9f8">\startitemize</span>
<span style="color:#644a9b">\item</span> normal
<span style="color:#0057ae;background-color:#e0e9f8">\stopitemize</span>
normal
<span style="color:#0057ae;background-color:#e0e9f8">\stopsection</span>
<span style="color:#898887">% \startblock \stopblock should be comments</span>


<span style="color:#898887">%% Commands</span>
<span style="color:#644a9b">\def</span><span style="color:#0057ae;background-color:#e0e9f8">\startstuff</span><span style="color:#924c9d">{</span>Custom environment start<span style="color:#924c9d">}</span>
<span style="color:#644a9b">\def</span><span style="color:#0057ae;background-color:#e0e9f8">\stopstuff</span><span style="color:#924c9d">{</span>Custom environment stop<span style="color:#924c9d">}</span>
<span style="color:#0057ae;background-color:#e0e9f8">\startstuff</span> should not be normal command colour (it is an error to miss <span style="color:#0057ae;background-color:#e0e9f8">\stopstuff</span>)

<span style="color:#644a9b">\def\sayHello</span><span style="color:#924c9d">{</span>Héllò Wø®łÐ<span style="color:#924c9d">}</span>
<span style="color:#898887">% This prints Héllò Wø®łÐ@@@ , If it were \sayHelloAAA it would be</span>
<span style="color:#898887">% an error, so the @ is not in the macro</span>
<span style="color:#644a9b">\sayHello</span>@@@

<span style="color:#644a9b">\def\testUnderscores</span><span style="color:#924c9d">{</span>Text_With_Underscores<span style="color:#924c9d">}</span>
<span style="color:#898887">% This prints Text_With_Underscores_ note the final underscore and no error</span>
<span style="color:#644a9b">\testUnderscores</span>_

<span style="color:#644a9b">\def\€</span><span style="color:#924c9d">{</span>Macro with sign<span style="color:#924c9d">}</span>
<span style="color:#898887">% This is a single macro</span>
<span style="color:#644a9b">\€</span> <span style="color:#898887">% This prints Macro with sign</span>
<span style="color:#644a9b">\€</span>A <span style="color:#898887">% This prints Macro with signA   (not an error)</span>

<span style="color:#644a9b">\setupindenting</span>[yes, big]


<span style="color:#898887">%% Inline math</span>
<span style="color:#0057ae;background-color:#e0e9f8">$</span><span style="color:#006e28">equations are green, </span><span style="color:#644a9b">\commands</span><span style="color:#006e28"> somewhat darker</span>
<span style="color:#006e28">it can also run over multiple lines</span>
<span style="color:#898887">% Comment</span>
<span style="color:#0057ae;background-color:#e0e9f8">$</span>
normal
<span style="color:#0057ae;background-color:#e0e9f8">\mathematics</span><span style="color:#924c9d">{</span><span style="color:#006e28">equations are green, </span><span style="color:#644a9b">\commands</span><span style="color:#006e28"> somewhat darker</span>
<span style="color:#006e28">it can also run over multiple lines</span>
<span style="color:#644a9b">\mathematics</span><span style="color:#924c9d">{</span><span style="color:#006e28">nested math should be green</span><span style="color:#924c9d">}</span><span style="color:#006e28"> this should still be green</span>
<span style="color:#898887">% Comment</span>
<span style="color:#924c9d">}</span>
normal
<span style="color:#0057ae;background-color:#e0e9f8">\math</span><span style="color:#924c9d">{</span><span style="color:#006e28">equations are green, </span><span style="color:#644a9b">\commands</span><span style="color:#006e28"> somewhat darker</span>
<span style="color:#006e28">it can also run over multiple lines</span>
<span style="color:#644a9b">\math</span><span style="color:#924c9d">{</span><span style="color:#006e28">nested math should be green</span><span style="color:#924c9d">}</span><span style="color:#006e28"> this should still be green</span>
<span style="color:#898887">% Comment</span>
<span style="color:#924c9d">}</span>
normal
<span style="color:#0057ae;background-color:#e0e9f8">\m</span><span style="color:#924c9d">{</span><span style="color:#006e28">equations are green, </span><span style="color:#644a9b">\commands</span><span style="color:#006e28"> somewhat darker</span>
<span style="color:#006e28">it can also run over multiple lines</span>
<span style="color:#644a9b">\m</span><span style="color:#924c9d">{</span><span style="color:#006e28">nested math should be green</span><span style="color:#924c9d">}</span><span style="color:#006e28"> this should still be green</span>
<span style="color:#898887">% Comment</span>
<span style="color:#924c9d">}</span>
normal
<span style="color:#0057ae;background-color:#e0e9f8">\mathematics</span><span style="color:#006e28"> t</span>he first character should be green <span style="color:#924c9d">{}</span>
<span style="color:#0057ae;background-color:#e0e9f8">\math</span><span style="color:#006e28">        t</span>he first character should be green <span style="color:#924c9d">{}</span>
<span style="color:#0057ae;background-color:#e0e9f8">\m</span><span style="color:#006e28">           t</span>he first character should be green <span style="color:#924c9d">{}</span>
<span style="color:#0057ae;background-color:#e0e9f8">\formula</span><span style="color:#006e28">     t</span>he first character should be green <span style="color:#924c9d">{}</span>
normal
<span style="color:#898887">% $should$ \mathematics{still} \math{be} \m{commented}</span>

<span style="color:#898887">% The underscore after sum should be blue, not macro color</span>
Math macro with underscores <span style="color:#0057ae;background-color:#e0e9f8">\m</span><span style="color:#006e28"> </span><span style="color:#924c9d">{</span><span style="color:#006e28"> v = </span><span style="color:#644a9b">\sum</span><span style="color:#924c9d">_</span><span style="color:#006e28">0</span><span style="color:#924c9d">^</span><span style="color:#006e28">1</span><span style="color:#924c9d">{</span><span style="color:#006e28"> </span><span style="color:#644a9b">\sqrt</span><span style="color:#924c9d">{</span><span style="color:#006e28">2</span><span style="color:#924c9d">}</span><span style="color:#006e28"> </span><span style="color:#924c9d">}</span><span style="color:#006e28">! </span><span style="color:#924c9d">}</span>

<span style="color:#898887">%% Display math</span>
<span style="color:#0057ae;background-color:#e0e9f8">$$</span>
<span style="color:#006e28">equations are green, </span><span style="color:#644a9b">\commands</span><span style="color:#006e28"> somewhat darker</span>
<span style="color:#006e28">it can also run over multiple lines</span>
<span style="color:#898887">% Comment</span>
<span style="color:#0057ae;background-color:#e0e9f8">$$</span>
normal
<span style="color:#0057ae;background-color:#e0e9f8">\startformula</span>
<span style="color:#006e28">equations are green, </span><span style="color:#644a9b">\commands</span><span style="color:#006e28"> somewhat darker</span>
<span style="color:#006e28">it can also run over multiple lines</span>
<span style="color:#898887">% Comment</span>

<span style="color:#006e28">Nested formulae should not work</span>
<span style="color:#006e28">The following should be red:</span>
<span style="color:#bf0303;text-decoration:underline">\startformula</span>
<span style="color:#006e28">Should still be math colour</span>
<span style="color:#0057ae;background-color:#e0e9f8">\stopformula</span>
normal

<span style="color:#898887">% This is a regular macro, not math macro</span>
<span style="color:#644a9b">\def\mathematicsMacroShouldNotMatchThis</span><span style="color:#924c9d">{</span>Not Math<span style="color:#924c9d">}</span>

<span style="color:#898887">%% Verbatim</span>
<span style="color:#0057ae;background-color:#e0e9f8">\starttyping</span>
<span style="color:#bf0303">All text in here should be verbatim colour</span>
<span style="color:#bf0303">% This should not be a comment</span>
<span style="color:#bf0303">&amp;@@#^%&amp;^#$</span>

<span style="color:#bf0303">Nested typing should be displayed in verbatim colour</span>
<span style="color:#bf0303">\starttyping</span>
<span style="color:#bf0303">\stoptyping</span>
<span style="color:#bf0303">should still be verbatim colour</span>
<span style="color:#bf0303">% This should not be a comment</span>
<span style="color:#0057ae;background-color:#e0e9f8">\stoptyping</span>

normal


<span style="color:#898887">%% Tables</span>
<span style="color:#0057ae;background-color:#e0e9f8">\starttabulate</span>[|c|c|c|]
<span style="color:#644a9b">\FL</span>
<span style="color:#644a9b">\NC</span> header1 <span style="color:#644a9b">\NC</span> header2 <span style="color:#644a9b">\NC</span> header3 <span style="color:#644a9b">\NR</span>
<span style="color:#644a9b">\ML</span>
<span style="color:#644a9b">\NC</span> value1 <span style="color:#644a9b">\NC</span> value2 <span style="color:#644a9b">\NC</span> value3 <span style="color:#644a9b">\NR</span>
<span style="color:#644a9b">\NC</span> value4 <span style="color:#644a9b">\NC</span> value5 <span style="color:#644a9b">\NC</span> value6 <span style="color:#644a9b">\NR</span>
<span style="color:#644a9b">\BL</span>
<span style="color:#0057ae;background-color:#e0e9f8">\stoptabulate</span>

Commands for TABLE environment (<span style="color:#0057ae;background-color:#e0e9f8">\bTABLE</span> and <span style="color:#0057ae;background-color:#e0e9f8">\eTABLE</span>, <span style="color:#0057ae;background-color:#e0e9f8">\bTD</span> and <span style="color:#0057ae;background-color:#e0e9f8">\eTD</span>, etc.) should emulate start/stop blocks
<span style="color:#0057ae;background-color:#e0e9f8">\bTABLE</span>[split=yes]
  <span style="color:#0057ae;background-color:#e0e9f8">\bTR</span> <span style="color:#0057ae;background-color:#e0e9f8">\bTD</span> value1 <span style="color:#0057ae;background-color:#e0e9f8">\eTD</span> <span style="color:#0057ae;background-color:#e0e9f8">\bTD</span> value2 <span style="color:#0057ae;background-color:#e0e9f8">\eTD</span> <span style="color:#0057ae;background-color:#e0e9f8">\bTD</span> value3 <span style="color:#0057ae;background-color:#e0e9f8">\eTD</span> <span style="color:#0057ae;background-color:#e0e9f8">\eTR</span>
  <span style="color:#0057ae;background-color:#e0e9f8">\bTR</span> <span style="color:#0057ae;background-color:#e0e9f8">\bTD</span> value4 <span style="color:#0057ae;background-color:#e0e9f8">\eTD</span> <span style="color:#0057ae;background-color:#e0e9f8">\bTD</span> value5 <span style="color:#0057ae;background-color:#e0e9f8">\eTD</span> <span style="color:#0057ae;background-color:#e0e9f8">\bTD</span> value6 <span style="color:#0057ae;background-color:#e0e9f8">\eTD</span> <span style="color:#0057ae;background-color:#e0e9f8">\eTR</span>
<span style="color:#0057ae;background-color:#e0e9f8">\eTABLE</span>

<span style="color:#0057ae;background-color:#e0e9f8">\startxtable</span>
  <span style="color:#0057ae;background-color:#e0e9f8">\startxrow</span>
    <span style="color:#0057ae;background-color:#e0e9f8">\startxcell</span> value1 <span style="color:#0057ae;background-color:#e0e9f8">\stopxcell</span>
    <span style="color:#0057ae;background-color:#e0e9f8">\startxcell</span> value2 <span style="color:#0057ae;background-color:#e0e9f8">\stopxcell</span>
  <span style="color:#0057ae;background-color:#e0e9f8">\stopxrow</span>
  <span style="color:#0057ae;background-color:#e0e9f8">\startxrow</span>
    <span style="color:#0057ae;background-color:#e0e9f8">\startxcell</span> value3 <span style="color:#0057ae;background-color:#e0e9f8">\stopxcell</span>
    <span style="color:#0057ae;background-color:#e0e9f8">\startxcell</span> value5 <span style="color:#0057ae;background-color:#e0e9f8">\stopxcell</span>
  <span style="color:#0057ae;background-color:#e0e9f8">\stopxrow</span>
<span style="color:#0057ae;background-color:#e0e9f8">\stopxtable</span>



<span style="font-weight:bold">\subject</span><span style="color:#924c9d">{</span> Languajes directly usable in <span style="color:#644a9b">\CONTEXT</span> <span style="color:#924c9d">}</span>

<span style="color:#898887">% These three sould have their own separate syntax highlighting</span>

<span style="color:#0057ae;background-color:#e0e9f8">\startluacode</span>
    <span style="color:#0057ae">context</span><span style="color:#ca60ca">.</span>chapter<span style="color:#ca60ca">({</span><span style="color:#0057ae">first</span><span style="color:#ca60ca">},</span> <span style="color:#bf0303">"Some title"</span><span style="color:#ca60ca">)</span>
    <span style="color:#0057ae">context</span><span style="color:#ca60ca">.</span>startcolumns<span style="color:#ca60ca">({</span><span style="color:#0057ae">n</span> <span style="color:#ca60ca">=</span> <span style="color:#b08000">3</span><span style="color:#ca60ca">,</span> <span style="color:#0057ae">rule</span> <span style="color:#ca60ca">=</span> <span style="color:#bf0303">"on"</span><span style="color:#ca60ca">})</span>
        context<span style="color:#ca60ca">(</span><span style="color:#bf0303">"Hello one"</span><span style="color:#ca60ca">)</span>
    <span style="color:#0057ae">context</span><span style="color:#ca60ca">.</span>column<span style="color:#ca60ca">()</span>
        context<span style="color:#ca60ca">(</span><span style="color:#bf0303">"Hello two"</span><span style="color:#ca60ca">)</span>
    <span style="color:#0057ae">context</span><span style="color:#ca60ca">.</span>column<span style="color:#ca60ca">()</span>
        context<span style="color:#ca60ca">(</span><span style="color:#bf0303">"Hello three"</span><span style="color:#ca60ca">)</span>
    <span style="color:#0057ae">context</span><span style="color:#ca60ca">.</span>stopcolumns<span style="color:#ca60ca">()</span>
<span style="color:#0057ae;background-color:#e0e9f8">\stopluacode</span>

<span style="color:#0057ae;background-color:#e0e9f8">\startMPcode</span>
    <span style="color:#0057ae">transform</span> pagecoords;
    pagecoords <span style="color:#ca60ca">:=</span> <span style="font-weight:bold">identity</span> <span style="color:#0057ae">scaled</span> <span style="color:#b08000">10</span>mm <span style="color:#0057ae">shifted</span> (<span style="color:#b08000">100</span>mm,<span style="color:#b08000">150</span>mm);
    <span style="font-weight:bold">fill</span> ( (<span style="color:#b08000">0</span>,<span style="color:#b08000">0</span>) <span style="color:#ca60ca">--</span> (<span style="color:#b08000">2</span>,<span style="color:#b08000">0</span>) <span style="color:#ca60ca">--</span> (<span style="color:#b08000">2</span>,<span style="color:#b08000">1</span>) <span style="color:#ca60ca">--</span> (<span style="color:#b08000">1</span>,<span style="color:#b08000">1</span>) <span style="color:#ca60ca">--</span> (<span style="color:#b08000">1</span>,<span style="color:#b08000">2</span>) <span style="color:#ca60ca">--</span> <span style="color:#0057ae">cycle</span> )
        <span style="color:#0057ae">transformed</span> pagecoords <span style="color:#0057ae">withcolor</span> <span style="font-weight:bold">green</span>;
    <span style="font-weight:bold">draw</span> ( (<span style="color:#b08000">2</span>,<span style="color:#b08000">0</span>) <span style="color:#ca60ca">..</span> (<span style="color:#b08000">2</span>,<span style="color:#b08000">1</span>) <span style="color:#ca60ca">..</span> (<span style="color:#b08000">1</span>,<span style="color:#b08000">1</span>) <span style="color:#ca60ca">..</span> (<span style="color:#b08000">1</span>,<span style="color:#b08000">2</span>) <span style="color:#ca60ca">..</span> (<span style="color:#b08000">0</span>,<span style="color:#b08000">2</span>) )
        <span style="color:#0057ae">transformed</span> pagecoords;
    <span style="font-weight:bold">drawarrow</span> ( (<span style="color:#b08000">0</span>,<span style="color:#b08000">0</span>) <span style="color:#ca60ca">--</span> (<span style="color:#b08000">2</span>,<span style="color:#b08000">2</span>) ) <span style="color:#0057ae">transformed</span> pagecoords;
<span style="color:#0057ae;background-color:#e0e9f8">\stopMPcode</span>

<span style="color:#0057ae;background-color:#e0e9f8">\startXML</span>
&lt;<span style="font-weight:bold">context</span><span style="color:#006e28"> name</span><span style="color:#006e28">=</span><span style="color:#bf0303">"MathModeMacroFind"</span><span style="color:#006e28"> attribute</span><span style="color:#006e28">=</span><span style="color:#bf0303">"Math"</span><span style="color:#006e28"> lineEndContext</span><span style="color:#006e28">=</span><span style="color:#bf0303">"#stay"</span>>
    &lt;<span style="font-weight:bold">DetectChar</span><span style="color:#006e28"> char</span><span style="color:#006e28">=</span><span style="color:#bf0303">"{"</span><span style="color:#006e28">              attribute</span><span style="color:#006e28">=</span><span style="color:#bf0303">"Brace"</span><span style="color:#006e28"> context</span><span style="color:#006e28">=</span><span style="color:#bf0303">"#pop!MathModeMacro"</span>/>
    &lt;<span style="font-weight:bold">RegExpr</span><span style="color:#006e28">    String</span><span style="color:#006e28">=</span><span style="color:#bf0303">"</span><span style="color:#b08000">&amp;macro_math;</span><span style="color:#bf0303">"</span><span style="color:#006e28"> attribute</span><span style="color:#006e28">=</span><span style="color:#bf0303">"Macro"</span><span style="color:#006e28"> context</span><span style="color:#006e28">=</span><span style="color:#bf0303">"#pop"</span>/> <span style="color:#898887">&lt;!-- 1 token --></span>
    &lt;<span style="font-weight:bold">RegExpr</span><span style="color:#006e28">    String</span><span style="color:#006e28">=</span><span style="color:#bf0303">"[[:graph:]]"</span><span style="color:#006e28">  attribute</span><span style="color:#006e28">=</span><span style="color:#bf0303">"Math"</span><span style="color:#006e28">  context</span><span style="color:#006e28">=</span><span style="color:#bf0303">"#pop"</span>/> <span style="color:#898887">&lt;!-- 1 token --></span>
&lt;/<span style="font-weight:bold">context</span>>
<span style="color:#0057ae;background-color:#e0e9f8">\stopXML</span>

</pre></body></html>