lang-wrd.mkxl /size: 1733 b    last modification: 2023-12-21 09:44
1%D \module
2%D   [       file=lang-wrd,
3%D        version=2006.XX.XX,
4%D          title=\CONTEXT\ Language Macros,
5%D       subtitle=Checking,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D Experimental.
15
16\writestatus{loading}{ConTeXt Language Macros / Checking}
17
18\registerctxluafile{lang-wrd}{}
19
20\unprotect
21
22% \loadspellchecklist[en][words-en.txt]
23% \loadspellchecklist[us][words-en.txt]
24% \loadspellchecklist[nl][words-nl.txt]
25% \setupspellchecking[state=start,method=1]
26%
27% \setupspellchecking[state=start,method=2]
28% ...
29% \typefile{\jobname.words}
30%
31% beware, maybe some day we will honour grouping
32%
33% 1: spell checking
34% 2: word counting
35% 3: language coloring
36
37\installcorenamespace{spell}
38
39\installdirectcommandhandler \??spell {spellchecking}
40
41\appendtoks
42   \ifcstok{\directspellcheckingparameter\c!state}\v!start
43     \clf_enablespellchecking
44       method {\directspellcheckingparameter\c!method}%
45       list   {\directspellcheckingparameter\c!list}%
46     \relax
47   \else
48     \clf_disablespellchecking
49   \fi
50\to \everysetupspellchecking
51
52\permanent\tolerant\protected\def\loadspellchecklist[#1]#*[#S#2]% can be public implementor
53  {\clf_loadspellchecklist{#1}{#2}}
54
55\setupspellchecking
56  [\c!state=\v!stop,
57   \c!method=1,
58   \c!list=]
59
60\definecolor[word:yes]    [g=.75]
61\definecolor[word:no]     [r=.75]
62
63%definecolor[word:unset]  [s=.75]
64\definecolor[word:en]     [b=.75]
65\definecolor[word:de]     [r=.75]
66\definecolor[word:nl]     [g=.75]
67\definecolor[word:unknown][r=.75,g=.75]
68
69\protect \endinput
70