summaryrefslogtreecommitdiff
path: root/context/data/scite/scite-context-readme.tex
blob: 0789401b83ce27676b048c544a476f312c1f05b5 (plain)
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
% interface=en modes=icon,screen language=uk

\usemodule[art-01]
\usemodule[abr-02]

\unexpanded\def\METAPOST{MetaPost}
\unexpanded\def\METAFUN {MetaFun}

\setuphead
  [section]
  [color=darkblue]

\setuptype
  [color=darkblue]

\setuptyping
  [color=darkblue]

\setuptyping
  [margin=yes]

\setupwhitespace
  [big]

\definecolor[gray][s=.2,t=.5,a=1]

\startuseMPgraphic{TitlePage}{darkness}
    StartPage ;

        numeric factor   ; factor   := 1/3 ;
        numeric multiple ; multiple := PaperHeight/PaperWidth ; % 1.6 ;
        numeric stages   ; stages   := multiple/16 ; % .1 ;
        numeric darkness ; darkness := \MPvar{darkness} ;

        def Scaled(expr s, m) =
            if m = 1 :
                scaled (2*s*PaperWidth)
            else :
                xscaled (2*s*PaperWidth) yscaled (2*s*PaperHeight)
            fi
        enddef ;

        fill Page withcolor (factor*white) ;

        fill fullcircle scaled (multiple*PaperWidth) shifted llcorner Page withcolor (factor*red) ;
        fill fullcircle scaled (multiple*PaperWidth) shifted ulcorner Page withcolor (factor*green) ;
        fill fullcircle scaled (multiple*PaperWidth) shifted urcorner Page withcolor (factor*blue) ;
        fill fullcircle scaled (multiple*PaperWidth) shifted lrcorner Page withcolor (factor*yellow) ;

        for i = llcorner Page, ulcorner Page, urcorner Page, lrcorner Page :
            for j = 0 step stages until (10*stages-eps) : % or .8
                fill fullcircle Scaled(j,1) shifted i withcolor transparent(1,\MPvar{darkness}*(1-j),white) ;
            endfor ;
        endfor ;

        draw Page withpen pencircle scaled .1PaperWidth withcolor transparent(1,.5,.5white) ;

    StopPage
\stopuseMPgraphic

\startmode[icon,screen]

  \setuppapersize[S66][S66]

  \setupbodyfont[10pt]

\stopmode

\startmode[icon]

  \starttext

  \startTEXpage
     \useMPgraphic{TitlePage}{darkness=0.4}
  \stopTEXpage

  \stoptext

\stopmode

\starttext

% title page

\definelayer
  [TitlePage]
  [width=\paperwidth,
   height=\paperheight]

\setlayer
  [TitlePage]
  {\useMPgraphic{TitlePage}{darkness=1}}

\setlayerframed
  [TitlePage]
  [preset=rightbottom,
   hoffset=.1\paperwidth,
   voffset=.1\paperwidth]
  [align=left,
   width=\hsize,
   frame=off,
   foregroundcolor=gray]
  {\definedfont[SerifBold sa 10]SciTE\endgraf
   \definedfont[SerifBold sa 2.48]IN CONTEXT MkIV\kern.25\bodyfontsize}

\startTEXpage
  \tightlayer[TitlePage]
\stopTEXpage

% main text

\subject{About \SCITE}

{\em This manual is under (re)construction.}

For a long time at \PRAGMA\ we used \TEXEDIT, an editor we'd
written in \MODULA. It had some project management features and
recognized the project structure in \CONTEXT\ documents. Later we
rewrote this to a platform independent reimplementation called
\TEXWORK\ written in \PERLTK\ (not to be confused with the editor
with the plural name).

In the beginning of the century I can into \SCITE, written by Neil
Hodgson. Although the mentioned editors provide some functionality
not present in \SCITE\ we decided to use that editor because it
frees us from maintaining our own. I ported our \TEX\ and
\METAPOST\ (line based) syntax highlighting to \SCITE\ and got a
lot of others for free.

After a while I found out that there was an extension interface
written in \LUA. I played with it and wrote a few extensions too.
This pleasant experience later triggered the \LUATEX\ project.

A decade into the century \SCITE\ got another new feature: you can
write dynamic external lexers in \LUA\ using \LPEG. As in the
meantime \CONTEXT\ has evolved in a \TEX/\LUA\ hybrid, it made
sense to look into this. The result is a couple of lexers that
suit \TEX, \METAPOST\ and \LUA\ usage in \CONTEXT\ \MKIV. As we
also use \XML\ as input and output format a lexer for \XML\ is also
provided. And because \PDF\ is one of the backend formats lexing of
\PDF\ is also implemented. \footnote {In the process some of the
general lexing framework was adapted to suit our demands for speed.
We ship these files as well.}

In the \CONTEXT\ (standalone) distribution you will find the
relevant files under:

\starttyping
<texroot>/tex/texmf-context/context/data/scite
\stoptyping

Normally a user will not have to dive into the implementation
details but in principle you can tweak the properties files to
suit your purpose.

\subject{The look and feel}

The color scheme that we use is consistent over the lexers but we
use more colors that in the traditional lexing. For instance,
\TEX\ primitives, low level \TEX\ commands, \TEX\ constants, basic
file structure related commands, and user commands all get a
different treatment. When spell checking is turned on, we indicate
unknown words, but also words that are known but might need
checking, for instance because they have an uppercase character.
In \in {figure} [fig:colors] we some of that in practice.

\placefigure
  [page]
  [fig:colors]
  {Nested lexers in action.}
  {\rotate
     [rotation=90]
     {\externalfigure
        [scite-context-visual.png]
        [maxheight=1.2\textwidth,
         maxwidth=.9\textheight]}}

\subject{Installing \SCITE}

Installing \SCITE\ is straightforward. We are most familiar with
\MSWINDOWS\ but for other operating systems installation is not
much different. First you need to fetch the archive from:

\starttyping
www.scintilla.org
\stoptyping

The \MSWINDOWS\ binaries are zipped in \type {wscite.zip}, and you
can unzip this in any directory you want as long as you make sure
that the binary ends up in your path or as shortcut on your
desktop. So, say that you install \SCITE\ in:

\starttyping
c:\data\system\scite\wscite
\stoptyping

You need to add this path to your local path definition.
Installing \SCITE\ to some known place has the advantage that you
can move it around. There are no special dependencies on the
operating system.

Next you need to install the lpeg lexers. \footnote {Versions
later than 2.11 will not run on \MSWINDOWS\ 2K. In that case you need
to comment the external lexer import.} These can be fetched from:

\starttyping
http://foicica.com/scintillua/
\stoptyping

On \MSWINDOWS\ you need to copy the \type {lexers} subfolder to the \type
{wscite} folder. For \LINUX\ the place depends on the distribution and I just
copy them in the same path as where the regular properties files live. \footnote
{If you update, don't do so without testing first. Sometimes there are changes in
\SCITE\ that influence the lexers in which case you have to wait till we have
update them to suit those changes.}

For \UNIX, one can take a precompiled version as well. Here we
need to split the set of files into:

\starttyping
/usr/bin
/usr/share/scite
\stoptyping

The second path is hard coded in the binary.

If you want to use \CONTEXT, you need to copy the relevant files from

\starttyping
<texroot>/tex/texmf-context/context/data/scite
\stoptyping

to the path were \SCITE\ keeps its property files (\type (*.properties).

There is a file called \type {SciteGlobal.properties}. At the end
of that file (on \MSWINDOWS\ it is in the path where the Scite binary)
you then add a line to the end:

\starttyping
import scite-context-user
\stoptyping

You need to restart \SCITE\ in order to see if things work out as
expected.

Disabling the external lexer in a recent \SCITE\ is somewhat
tricky. In that case the end of that file looks like:

\starttyping
imports.exclude=scite-context-external
import *
import scite-context-user
\stoptyping

In any case you need to make sure that the user file is loaded last.

After this, things should run as expected (given that \TEX\ runs
at the console as well).

% In order to run the commands needed, we assume that the following programs
% are installed:
%
% \startitemize[packed]
% \item tidy (for quick and dirty checking of \XML\ files)
% \item xsltproc (for converting \XML\ files into other formats)
% \item acrobat (for viewing files)
% \item ghostview (for viewing files, use gv on \UNIX)
% \item rxvt (a console, only needed on \UNIX)
% \stopitemize

\subject{Fonts}

The configuration file defaults to the Dejavu fonts. These free
fonts are part of the \CONTEXT\ suite (also known as the
standalone distribution). Of course you can fetch them from \type
{http://dejavu-fonts.org} as well. You have to copy them to where
your operating system expects them. In the suite they are
available in

\starttyping
<contextroot>/tex/texmf/fonts/truetype/public/dejavu
\stoptyping

\subject{An alternative approach}

If for some reason you prefer not to mess with property files in
the main \SCITE\ path, you can follow a different route and
selectively copy files to places.

The following files are needed for the lpeg based lexer:

\starttyping
lexers/scite-context-lexer.lua
lexers/scite-context-lexer-tex.lua
lexers/scite-context-lexer-mps.lua
lexers/scite-context-lexer-lua.lua
lexers/scite-context-lexer-cld.lua
lexers/scite-context-lexer-txt.lua
lexers/scite-context-lexer-xml*.lua
lexers/scite-context-lexer-pdf*.lua

lexers/context/data/scite-context-data-tex.lua
lexers/context/data/scite-context-data-context.lua
lexers/context/data/scite-context-data-interfaces.lua
lexers/context/data/scite-context-data-metapost.lua
lexers/context/data/scite-context-data-metafun.lua

lexers/themes/scite-context-theme.lua
\stoptyping

The data files are needed because we cannot access property files
from within the lexer. If we could open a file we could use the
property files instead.

These files go to the \type {lexers} subpath in your \SCITE\
installation. Normally this sits in the binary path. The
following files provide some extensions. On \MSWINDOWS\ you can copy
these files to the path where the \SCITE\ binary lives.

\starttyping
scite-ctx.lua
\stoptyping

Because property files can only be loaded from the same path
where the (user) file loads them you need to copy the following
files to the same path where the loading is defined:

\starttyping
scite-context.properties
scite-context-internal.properties
scite-context-external.properties

scite-pragma.properties

scite-tex.properties
scite-metapost.properties

scite-context-data-tex.properties
scite-context-data-context.properties
scite-context-data-interfaces.properties
scite-context-data-metapost.properties
scite-context-data-metafun.properties

scite-ctx.properties
scite-ctx-context.properties
scite-ctx-example.properties
\stoptyping

On \MSWINDOWS\ these go to:

\starttyping
c:/Users/YourName
\stoptyping

Next you need to add this to:

\starttyping
import scite-context
import scite-context-internal
import scite-context-external
import scite-pragma
\stoptyping

to the file:

\starttyping
SciTEUser.properties
\stoptyping

Of course the pragma import is optional. You can comment either the
internal or external variant but there is no reason not to keep them both.

\subject{Extensions}

Just a quick not to some extensions. If you select a part of the
text (normally you do this with the shift key pressed) and you hit
\type {Shift-F11}, you get a menu with some options. More (robust)
ones will be provided at some point.

\subject{Spell checking}

If you want to have spell checking, you need have files with
correct words on each line. The first line of a file determines
the language:

\starttyping
% language=uk
\stoptyping

When you use the external lexers, you need to provide some files.
Given that you have a text file with valid words only, you can run
the following script:

\starttyping
mtxrun --script scite --words nl uk
\stoptyping

This will convert files with names like \type {spell-nl.txt} into
\LUA\ files that you need to copy to the \type {lexers/data} path.
Spell checking happens realtime when you have the language
directive (just add a bogus character to disable it). Wrong words
are colored red, and words that might have a case problem are
colored orange. Recognized words are greyed and words with less
than three characters are ignored.

In the case of internal lexers, the following file is needed:

\starttyping
spell-uk.txt
\stoptyping

If you use the traditional lexer, this file is taken from the
path determined by the environment variable:

\starttyping
CTXSPELLPATH
\stoptyping

As already mentioned, the lpeg lexer expects them in the data
path. This is because the \LUA\ instance that does the lexing is
rather minimalistic and lacks some libraries as well as cannot
access the main \SCITE\ state.

Spell checking in \type {txt} files is enabled by adding a first
line:

\starttyping
[#!-%] language=uk
\stoptyping

The first character on that line is one of the four mentioned
between square brackets. So,

\starttyping
# language=uk
\stoptyping

should work. For \XML\ files there are two methods. You can use the
following (at the start of the file):

\starttyping
<?xml ... language="uk" ?>
\stoptyping

But probably better is to use the next directive just below the
usual \XML\ marker line:

\starttyping
<?context-directive editor language uk ?>
\stoptyping

\subject{Interface selection}

In a similar fashion you can drive the interface checking:

\starttyping
% interface=nl
\stoptyping

\subject{Property files}

The internal lexers are controlled by the property files while the
external ones are steered with themes. Unfortunately there is
hardly any access to properties from the external lexer code nor
can we consult the file system and/or run programs like \type
{mtxrun}. This means that we cannot use configuration files in the
\CONTEXT\ distribution directly. Hopefully this changes with
future releases.

\subject{The external lexers}

These are the more advanced. They provide more detail and the \CONTEXT\
lexer also supports nested \METAPOST\ and \LUA. Currently there is no
detailed configuration but this might change once they are stable.

The external lexers operate on documents while the internal ones
operate on lines. This can make the external lexers slow on large
documents. We've optimized the code somewhat for speed and memory
consumption but there's only so much one can do. While lexing each
change in style needs a small table but allocating and garbage
collecting many small tables comes at a price. Of course in
practice this probably gets unnoticed. \footnote {I wrote the code
in 2011 on a more than 5 years old Dell M90 laptop, so I suppose
that speed is less an issue now.}

In principle the external lexers can be used with \type
{textadept} which also uses \type {scintilla}. Actually, support
for lpeg lexing originates in \type {textadept}. Currently \type
{textadept} lacks a couple of features I like about \SCITE\ (for
instance it has no realtime logpane) and it's also still changing.
At some point the \CONTEXT\ distribution might ship with files
for \type {textadept} as well.

The external lpeg lexers work okay with the \MSWINDOWS\ and
\LINUX\ versions of \SCITE, but unfortunately at the time of
writing this, the \LUA\ library that is needed is not available
for the \MACOSX\ version of \SCITE. Also, due to the fact that the
lexing framework is rather isolated, there are some issues that
cannot be addressed in the properly, at least not currently.

In addition to \CONTEXT\ and \METAFUN\ lexing a \LUA\ lexer is
also provided so that we can handle \CONTEXT\ \LUA\ Document
(\CLD) files too. There is also an \XML\ lexer. This one also
provides spell checking. The \PDF\ lexer tries to do a good job on
\PDF\ files, but it has some limitations. There is also a simple
text file lexer that does spell checking.

Don't worry if you see an orange rectangle in your \TEX\ or \XML\
document. This indicates that there is a special space character
there, for instance \type {0xA0}, the nonbreakable space. Of course
we assume that you use \UTF8 as input encoding.

\subject{The internal lexers}

\SCITE\ has quite some built in lexers. A lexer is responsible for
highlighting the syntax of your document. The way a \TEX\ file is
treated is configured in the file:

\starttyping
tex.properties
\stoptyping

You can edit this file to your needs using the menu entry under
\type {options} in the top bar. In this file, the following
settings apply to the \TEX\ lexer:

\starttyping
lexer.tex.interface.default=0
lexer.tex.use.keywords=1
lexer.tex.comment.process=0
lexer.tex.auto.if=1
\stoptyping

The option \type {lexer.tex.interface.default} determines the way
keywords are highlighted. You can control the interface from your
document as well, which makes more sense that editing the
configuration file each time.

\starttyping
% interface=all|tex|nl|en|de|cz|it|ro|latex
\stoptyping

The values in the properties file and the keywords in the preamble
line have the following meaning:

\starttabulate[|lT|lT|p|]
\NC 0 \NC all   \NC all commands (preceded by a backslash)                \NC \NR
\NC 1 \NC tex   \NC \TEX, \ETEX, \PDFTEX, \OMEGA\ primitives (and macros) \NC \NR
\NC 2 \NC nl    \NC the dutch \CONTEXT\ interface                         \NC \NR
\NC 3 \NC en    \NC the english \CONTEXT\ interface                       \NC \NR
\NC 4 \NC de    \NC the german \CONTEXT\ interface                        \NC \NR
\NC 5 \NC cz    \NC the czech \CONTEXT\ interface                         \NC \NR
\NC 6 \NC it    \NC the italian \CONTEXT\ interface                       \NC \NR
\NC 7 \NC ro    \NC the romanian \CONTEXT\ interface                      \NC \NR
\NC 8 \NC latex \NC \LATEX\ (apart from packages)                         \NC \NR
\stoptabulate

The configuration file is set up in such a way that you can easily
add more keywords to the lists. The keywords for the second and
higher interfaces are defined in their own properties files. If
you're curious about the way this is configures, you can peek into
the property files that start with \type {scite-context}. When you
have \CONTEXT\ installed you can generate configuration files with

\starttyping
mtxrun --script interface --scite
\stoptyping

You need to make sure that you move the result to the right place so best
not mess around with this command and use the files from the distribution.

Back to the properties in \type {tex.properties}. You can disable keyword
coloring alltogether with:

\starttyping
lexer.tex.use.keywords=0
\stoptyping

but this is only handy for testing purposes. More interesting is that you can
influence the way comment is treated:

\starttyping
lexer.tex.comment.process=0
\stoptyping

When set to zero, comment is not interpreted as \TEX\ code and it will come out
in a uniform color. But, when set to one, you will get as much colors as a \TEX\
source. It's a matter of taste what you choose.

The lexer tries to cope with the \TEX\ syntax as good as possible and takes for
instance care of the funny \type {^^} notation. A special treatment is
applied to so called \type {\if}'s:

\starttyping
lexer.tex.auto.if=1
\stoptyping

This is the default setting. When set to one, all \type {\ifwhatever}'s will be
seen as a command. When set to zero, only the primitive \type {\if}'s will be
treated. In order not to confuse you, when this property is set to one, the
lexer will not color an \type {\ifwhatever} that follows an \type {\newif}.

\subject{The \METAPOST\ lexer}

The \METAPOST\ lexer is set up slightly different from its \TEX\ counterpart,
first of all because \METAPOST\ is more a language that \TEX. As with the
\TEX\ lexer, we can control the interpretation of identifiers. The \METAPOST\
specific configuration file is:

\starttyping
metapost.properties
\stoptyping

Here you can find properties like:

\starttyping
lexer.metapost.interface.default=1
\stoptyping

Instead of editing the configuration file you can control the lexer with the
first line in your document:

\starttyping
% interface=none|metapost|mp|metafun
\stoptyping

The numbers and keywords have the following meaning:

\starttabulate[|lT|lT|p|]
\NC 0 \NC none           \NC no highlighting of identifiers   \NC \NR
\NC 1 \NC metapost or mp \NC \METAPOST\ primitives and macros \NC \NR
\NC 2 \NC metafun        \NC \METAFUN\ macros                 \NC \NR
\stoptabulate

Similar to the \TEX\ lexer, you can influence the way comments are handled:

\starttyping
lexer.metapost.comment.process=1
\stoptyping

This will interpret comment as \METAPOST\ code, which is not that useful
(opposite to \TEX, where documentation is often coded in \TEX).

The lexer will color the \METAPOST\ keywords, and, when enabled also additional
keywords (like those of \METAFUN). The additional keywords are colored and shown
in a slanted font.

The \METAFUN\ keywords are defined in a separate file:

\starttyping
metafun-scite.properties
\stoptyping

You can either copy this file to the path where you global properties files lives,
or put a copy in the path of your user properties file. In that case you need to
add an entry to the file \type {SciTEUser.properties}:

\starttyping
import metafun-scite
\stoptyping

The lexer is able to recognize \type {btex}||\type {etex} and will treat anything
in between as just text. The same happens with strings (between \type {"}). Both
act on a per line basis.

\subject{Using \ConTeXt}

When \type {mtxrun} is in your path, \CONTEXT\ should run out of the box. You can
find \type {mtxrun} in:

\starttyping
<contextroot>/tex/texmf-mswin/bin
\stoptyping

or in a similar path that suits the operating system that you use.

When you hit \type{CTRL-12} your document will be processed. Take a look at
the \type {Tools} menu to see what more is provided.

\subject{Extensions (using \LUA)}

When the \LUA\ extensions are loaded, you will see a message
in the log pane that looks like:

\starttyping
-  see scite-ctx.properties for configuring info

-  ctx.spellcheck.wordpath set to ENV(CTXSPELLPATH)
-  ctxspellpath set to c:\data\develop\context\spell
-  ctx.spellcheck.wordpath expands to c:\data\develop\context\spell

-  ctx.wraptext.length is set to 65
-  key bindings:

Shift + F11   pop up menu with ctx options

Ctrl  + B     check spelling
Ctrl  + M     wrap text (auto indent)
Ctrl  + R     reset spelling results
Ctrl  + I     insert template
Ctrl  + E     open log file

-  recognized first lines:

xml   <?xml version='1.0' language='nl'
tex   % language=nl
\stoptyping

This message tells you what extras are available.

\subject{Templates}

There is an experimental template mechanism. One option is to define
templates in a properties file. The property file \type
{scite-ctx-context} contains definitions like:

\starttyping
command.25.$(file.patterns.context)=insert_template \
$(ctx.template.list.context)

ctx.template.list.context=\
    itemize=structure.itemize.context|\
    tabulate=structure.tabulate.context|\
    natural TABLE=structure.TABLE.context|\
    use MP graphic=graphics.usemp.context|\
    reuse MP graphic=graphics.reusemp.context|\
    typeface definition=fonts.typeface.context

ctx.template.structure.itemize.context=\
\startitemize\n\
\item ?\n\
\item ?\n\
\item ?\n\
\stopitemize\n
\stoptyping

The file \type {scite-ctx-example} defines \XML\ variants:

\starttyping
command.25.$(file.patterns.example)=insert_template \
$(ctx.template.list.example)

ctx.template.list.example=\
    bold=font.bold.example|\
    emphasized=font.emphasized.example|\
    |\
    inline math=math.inline.example|\
    display math=math.display.example|\
    |\
    itemize=structure.itemize.example

ctx.template.structure.itemize.example=\
<itemize>\n\
<item>?</item>\n\
<item>?</item>\n\
<item>?</item>\n\
</itemize>\n
\stoptyping

For larger projects it makes sense to keep templates with the
project. In one of our projects we have a directory in the
path where the project files are kept which holds template files:

\starttyping
..../ctx-templates/achtergronden.xml
..../ctx-templates/bewijs.xml
\stoptyping

One could define a template menu like we did previously:

\starttyping
ctx.templatelist.example=\
    achtergronden=mathadore.achtergronden|\
    bewijs=mathadore.bewijs|\

ctx.template.mathadore.achtergronden.file=smt-achtergronden.xml
ctx.template.mathadore.bewijs.file=smt-bewijs.xml
\stoptyping

However, when no such menu is defined, we will automatically scan
the directory and build the menu without user intervention.

\subject{Using \SCITE}

The following keybindings are available in \SCITE. Most of this
list is taken from the on|-|line help pages.

\startbuffer[keybindings]
\starttabulate[|l|p|]
\FL
\NC \rm \bf keybinding   \NC \bf meaning (taken from the \SCITE\ help file)                                \NC \NR
\ML
\NC \type{Ctrl+Keypad+}         \NC magnify text size                                                      \NC \NR
\NC \type{Ctrl+Keypad-}         \NC reduce text size                                                       \NC \NR
\NC \type{Ctrl+Keypad/}         \NC restore text size to normal                                            \NC \NR
\ML
\NC \type{Ctrl+Keypad*}         \NC expand or contract a fold point                                        \NC \NR
\ML
\NC \type{Ctrl+Tab}             \NC cycle through recent files                                             \NC \NR
\ML
\NC \type{Tab}                  \NC indent block                                                           \NC \NR
\NC \type{Shift+Tab}            \NC dedent block                                                           \NC \NR
\ML
\NC \type{Ctrl+BackSpace}       \NC delete to start of word                                                \NC \NR
\NC \type{Ctrl+Delete}          \NC delete to end of word                                                  \NC \NR
\NC \type{Ctrl+Shift+BackSpace} \NC delete to start of line                                                \NC \NR
\NC \type{Ctrl+Shift+Delete}    \NC delete to end of line                                                  \NC \NR
\ML
\NC \type{Ctrl+Home}            \NC go to start of document; \type{Shift} extends selection                \NC \NR
\NC \type{Ctrl+End}             \NC go to end of document; \type{Shift} extends selection                  \NC \NR
\NC \type{Alt+Home}             \NC go to start of display line; \type{Shift} extends selection            \NC \NR
\NC \type{Alt+End}              \NC go to end of display line; \type{Shift} extends selection              \NC \NR
\ML
\NC \type{Ctrl+F2}              \NC create or delete a bookmark                                            \NC \NR
\NC \type{F2}                   \NC go to next bookmark                                                    \NC \NR
\ML
\NC \type{Ctrl+F3}              \NC find selection                                                         \NC \NR
\NC \type{Ctrl+Shift+F3}        \NC find selection backwards                                               \NC \NR
\ML
\NC \type{Ctrl+Up}              \NC scroll up                                                              \NC \NR
\NC \type{Ctrl+Down}            \NC scroll down                                                            \NC \NR
\ML
\NC \type{Ctrl+C}               \NC copy selection to buffer                                               \NC \NR
\NC \type{Ctrl+V}               \NC insert content of buffer                                               \NC \NR
\NC \type{Ctrl+X}               \NC copy selection to buffer and delete selection                          \NC \NR
\ML
\NC \type{Ctrl+L}               \NC line cut                                                               \NC \NR
\NC \type{Ctrl+Shift+T}         \NC line copy                                                              \NC \NR
\NC \type{Ctrl+Shift+L}         \NC line delete                                                            \NC \NR
\NC \type{Ctrl+T}               \NC line transpose with previous                                           \NC \NR
\NC \type{Ctrl+D}               \NC line duplicate                                                         \NC \NR
\ML
\NC \type{Ctrl+K}               \NC find matching preprocessor conditional, skipping nested ones           \NC \NR
\NC \type{Ctrl+Shift+K}         \NC select to matching preprocessor conditional                            \NC \NR
\NC \type{Ctrl+J}               \NC find matching preprocessor conditional backwards, skipping nested ones \NC \NR
\NC \type{Ctrl+Shift+J}         \NC select to matching preprocessor conditional backwards                  \NC \NR
\ML
\NC \type{Ctrl+[}               \NC previous paragraph; \type{Shift} extends selection                     \NC \NR
\NC \type{Ctrl+]}               \NC next paragraph; \type{Shift} extends selection                         \NC \NR
\NC \type{Ctrl+Left}            \NC previous word; \type{Shift} extends selection                          \NC \NR
\NC \type{Ctrl+Right}           \NC next word; \type{Shift} extends selection                              \NC \NR
\NC \type{Ctrl+/}               \NC previous word part; \type{Shift} extends selection                     \NC \NR
\NC \type{Ctrl+\ }              \NC next word part; \type{Shift} extends selection                         \NC \NR
\LL
\stoptabulate
\stopbuffer

\getbuffer[keybindings]

\subject{Affiliation}

\starttabulate[|l|l|]
\NC author    \NC Hans Hagen                    \NC \NR
\NC copyright \NC PRAGMA ADE, Hasselt NL        \NC \NR
\NC more info \NC \type {www.pragma-ade.com}    \NC \NR
\NC           \NC \type {www.contextgarden.net} \NC \NR
\NC version   \NC \currentdate                  \NC \NR
\stoptabulate

\stoptext