textadept-context-types.lua /size: 3970 b    last modification: 2020-07-01 14:35
1local info = {
2    version   = 1.002,
3    comment   = "filetypes for textadept for context/metafun",
4    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5    copyright = "PRAGMA ADE / ConTeXt Development Team",
6    license   = "see context related readme files",
7}
8
9-- todo: add the same ones as we have in scite
10
11local lexer   = require("scite-context-lexer")
12local context = lexer.context
13local install = context.install
14
15-- autopdf takes long to stop (weird, not in scite)
16
17-- WIN32 and 'start "" "%e.pdf"' or OSX and 'open "%e.pdf"' or 'xdg-open "%e.pdf"',
18
19local quitter = function(output)
20    return find(output,"%? +$") and true or false, "see message above"
21end
22
23local listing = {
24    command = [[mtxrun --autogenerate --script context --autopdf --extra=listing --scite --compact "%basename%"]],
25    quitter = quitter,
26}
27
28install {
29    lexer    = "scite-context-lexer-tex",
30    suffixes = {
31        "tex",
32        "mkii",
33        "mkiv", "mkvi", "mkix", "mkxi",
34        "mkic", "mkci", 
35
36    },
37    check    = {
38        command = [[mtxrun --autogenerate --script check "%basename%"]],
39        quitter = quitter,
40    },
41    process  = {
42        command = [[mtxrun --autogenerate --script context --autopdf "%basename%"]], 
43        quitter = quitter,
44    },
45    listing  = listing,
46    generate = [[mtxrun --generate]],
47    fonts    = [[mtxrun --script fonts --reload --force]],
48    clear    = [[mtxrun --script cache --erase]],
49    purge    = [[mtxrun --script context --purgeall]],
50    preview  = [[]],
51    logfile  = [[]],
52    arrange  = [[]],
53    unicodes = [[]],
54    setter   = function(lexer)
55        -- whatever
56    end,
57}
58
59install {
60    lexer    = "scite-context-lexer-xml",
61    suffixes = {
62        "xml", "xsl", "xsd", "fo", "dtd", "xslt",
63        "lmx", "exa", "ctx", "export",
64        "rlb", "rlg", "rlv", "rng",
65        "xfdf",
66        "htm", "html", "xhtml",
67        "svg",
68        "xul"
69    },
70    check    = [[tidy -quiet -utf8 -xml -errors "%basename%"]],
71    process  = {
72        command = [[mtxrun --autogenerate --script context --autopdf "%basename%"]], --  --autopdf]],
73        quitter = quitter,
74    },
75    listing  = listing,
76    setter   = function(lexer)
77        -- whatever
78    end,
79}
80
81install {
82    lexer    = "scite-context-lexer-mps",
83    suffixes = {
84        "mp", "mpx"
85    },
86    listing  = listing,
87    setter   = function(lexer)
88        -- whatever
89    end,
90}
91
92install {
93    lexer    = "scite-context-lexer-lua",
94    suffixes = {
95        "lua", "luc",
96        "cld", "tuc", "luj", "lum", "tma", "lfg", "luv", "lui"
97    },
98    check    = [[mtxrun --autogenerate --script "%basename%"]],
99    process  = [[mtxrun --autogenerate --script "%basename%"]],
100    preview  = [[mtxrun --autogenerate --script "%basename%"]],
101    listing  = listing,
102    setter   = function(lexer)
103        -- whatever
104    end,
105}
106
107install {
108    lexer    = "scite-context-lexer-txt",
109    suffixes = {
110        "txt"
111    },
112    listing  = listing,
113    setter   = function(lexer)
114        -- whatever
115    end,
116}
117
118install {
119    lexer    = "scite-context-lexer-pdf",
120    suffixes = {
121        "pdf"
122    },
123    encoding = "7-BIT-ASCII",
124    setter   = function(lexer)
125        -- whatever
126    end,
127}
128
129install {
130    lexer    = "scite-context-lexer-web",
131    suffixes = {
132        "w",
133        "ww"
134    },
135    listing  = listing,
136    setter   = function(lexer)
137        -- whatever
138    end,
139}
140
141install {
142    lexer    = "scite-context-lexer-cpp",
143    suffixes = {
144        "h", "c",
145        "hh", "cc",
146        "hpp", "cpp",
147        "hxx", "cxx"
148    },
149    listing  = listing,
150    setter   = function(lexer)
151        -- whatever
152    end,
153}
154
155install {
156    "scite-context-lexer-bibtex",
157    suffixes = {
158        "bib"
159    },
160    listing  = listing,
161    setter   = function(lexer)
162        -- whatever
163    end,
164}
165
166install {
167    "scite-context-lexer-sql",
168    suffixes = {
169        "sql"
170    },
171    listing  = listing,
172    setter   = function(lexer)
173        -- whatever
174    end,
175}
176