% ConTeXt test file for Kate's syntax highlighting and code folding
%% Comments
% This is a comment
\% Not a comment
\\% This is a comment
% Titles should be bold
{Subject}
{Sub-subject}
{Sub-sub-subject}
{Sub-sub-sub-subject}
{Sub-sub-sub-sub-subject}
{Section}
{Sub-section}
{Sub-sub-section}
{Sub-sub-sub-section}
{Sub-sub-sub-sub-section}
%% Start/stop blocks
\startsection
Can be nested
\startitemize
\item normal
\stopitemize
normal
\stopsection
% \startblock \stopblock should be comments
%% Commands
\def\startstuff{Custom environment start}
\def\stopstuff{Custom environment stop}
\startstuff should not be normal command colour (it is an error to miss \stopstuff)
\def\sayHello{Héllò Wø®łÐ}
% This prints Héllò Wø®łÐ@@@ , If it were \sayHelloAAA it would be
% an error, so the @ is not in the macro
\sayHello@@@
\def\testUnderscores{Text_With_Underscores}
% This prints Text_With_Underscores_ note the final underscore and no error
\testUnderscores_
\def\€{Macro with sign}
% This is a single macro
\€ % This prints Macro with sign
\€A % This prints Macro with signA (not an error)
\setupindenting[yes, big]
%% Inline math
$\commands
% Comment
$
normal
\mathematics{\commands
\mathematics{}
% Comment
}
normal
\math{\commands
\math{}
% Comment
}
normal
\m{\commands
\m{}
% Comment
}
normal
\mathematicshe first character should be green {}
\mathhe first character should be green {}
\mhe first character should be green {}
\formulahe first character should be green {}
normal
% $should$ \mathematics{still} \math{be} \m{commented}
% The underscore after sum should be blue, not macro color
Math macro with underscores \m{\sum_^{\sqrt{}}}
%% Display math
$$
\commands
% Comment
$$
normal
\startformula
\commands
% Comment
\startformula
\stopformula
normal
% This is a regular macro, not math macro
\def\mathematicsMacroShouldNotMatchThis{Not Math}
%% Verbatim
\starttyping
All text in here should be verbatim colour
% This should not be a comment
&@@#^%&^#$
Nested typing should be displayed in verbatim colour
\starttyping
\stoptyping
should still be verbatim colour
% This should not be a comment
\stoptyping
normal
%% Tables
\starttabulate[|c|c|c|]
\FL
\NC header1 \NC header2 \NC header3 \NR
\ML
\NC value1 \NC value2 \NC value3 \NR
\NC value4 \NC value5 \NC value6 \NR
\BL
\stoptabulate
Commands for TABLE environment (\bTABLE and \eTABLE, \bTD and \eTD, etc.) should emulate start/stop blocks
\bTABLE[split=yes]
\bTR \bTD value1 \eTD \bTD value2 \eTD \bTD value3 \eTD \eTR
\bTR \bTD value4 \eTD \bTD value5 \eTD \bTD value6 \eTD \eTR
\eTABLE
\startxtable
\startxrow
\startxcell value1 \stopxcell
\startxcell value2 \stopxcell
\stopxrow
\startxrow
\startxcell value3 \stopxcell
\startxcell value5 \stopxcell
\stopxrow
\stopxtable
{ Languajes directly usable in \CONTEXT }
% These three sould have their own separate syntax highlighting
\startluacode
context.chapter({first}, "Some title")
context.startcolumns({n = 3, rule = "on"})
context("Hello one")
context.column()
context("Hello two")
context.column()
context("Hello three")
context.stopcolumns()
\stopluacode
\startMPcode
transform pagecoords;
pagecoords := identity scaled 10mm shifted (100mm,150mm);
fill ( (0,0) -- (2,0) -- (2,1) -- (1,1) -- (1,2) -- cycle )
transformed pagecoords withcolor green;
draw ( (2,0) .. (2,1) .. (1,1) .. (1,2) .. (0,2) )
transformed pagecoords;
drawarrow ( (0,0) -- (2,2) ) transformed pagecoords;
\stopMPcode
\startXML
<context name="MathModeMacroFind" attribute="Math" lineEndContext="#stay">
<DetectChar char="{" attribute="Brace" context="#pop!MathModeMacro"/>
<RegExpr String="¯o_math;" attribute="Macro" context="#pop"/>
<RegExpr String="[[:graph:]]" attribute="Math" context="#pop"/>
context>
\stopXML