@mdit/plugin-mathjax-slim 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/importer-DDxrj6yI.js +1 -0
- package/lib/importer-N3BdKsx_.js +1 -0
- package/lib/index.d.ts +400 -266
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/sync.d.ts +402 -266
- package/lib/sync.js +2 -2
- package/lib/sync.js.map +1 -1
- package/package.json +22 -17
- package/lib/importer-C5KF-eLj.js +0 -2
- package/lib/importer-C5KF-eLj.js.map +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,296 +1,430 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { TeX } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
1
|
+
import { MarkdownItTexOptions } from "@mdit/plugin-tex";
|
|
2
|
+
import { LiteAdaptor } from "@mathjax/src/js/adaptors/liteAdaptor.js";
|
|
3
|
+
import { TeX } from "@mathjax/src/js/input/tex.js";
|
|
4
|
+
import { CHTML } from "@mathjax/src/js/output/chtml.js";
|
|
5
|
+
import { SVG } from "@mathjax/src/js/output/svg.js";
|
|
6
|
+
import { MmlNode } from "@mathjax/src/js/core/MmlTree/MmlNode.js";
|
|
7
|
+
import TexError from "@mathjax/src/js/input/tex/TexError.js";
|
|
8
|
+
import { ChtmlFontData } from "@mathjax/src/js/output/chtml/FontData.js";
|
|
9
|
+
import { SvgFontData } from "@mathjax/src/js/output/svg/FontData.js";
|
|
10
|
+
import { MathItem } from "@mathjax/src/js/core/MathItem.js";
|
|
11
|
+
import { LiteElement } from "@mathjax/src/js/adaptors/lite/Element.js";
|
|
12
|
+
import { MathDocument } from "@mathjax/src/js/core/MathDocument.js";
|
|
13
|
+
import { CssStyles } from "@mathjax/src/js/ui/menu/mj-context-menu.js";
|
|
14
|
+
import { LinebreakVisitor } from "@mathjax/src/js/output/common/LinebreakVisitor.js";
|
|
15
|
+
import { SvgWrapperFactory } from "@mathjax/src/js/output/svg/WrapperFactory.js";
|
|
16
|
+
import { ChtmlWrapperFactory } from "@mathjax/src/js/output/chtml/WrapperFactory.js";
|
|
17
|
+
import MarkdownIt from "markdown-it";
|
|
10
18
|
|
|
19
|
+
//#region src/mathjax.d.ts
|
|
11
20
|
type TexPackage = "action" | "ams" | "amscd" | "bbm" | "bboldx" | "bbox" | "begingroup" | "boldsymbol" | "braket" | "bussproofs" | "cancel" | "cases" | "centernot" | "color" | "colortbl" | "colorv2" | "configmacros" | "dsfont" | "empheq" | "enclose" | "extpfeil" | "gensymb" | "html" | "mathtools" | "mhchem" | "newcommand" | "noerrors" | "noundefined" | "physics" | "setoptions" | "tagformat" | "texhtml" | "textcomp" | "textmacros" | "unicode" | "units" | "upgreek" | "verb";
|
|
12
21
|
interface MathJaxTexInputOptions {
|
|
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
|
-
|
|
22
|
+
/**
|
|
23
|
+
* extensions to use
|
|
24
|
+
*
|
|
25
|
+
* @default [
|
|
26
|
+
* 'action',
|
|
27
|
+
* 'ams',
|
|
28
|
+
* 'amscd',
|
|
29
|
+
* 'bbm',
|
|
30
|
+
* 'bboldx',
|
|
31
|
+
* 'bbox',
|
|
32
|
+
* 'begingroup',
|
|
33
|
+
* 'boldsymbol',
|
|
34
|
+
* 'braket',
|
|
35
|
+
* 'bussproofs',
|
|
36
|
+
* 'cancel',
|
|
37
|
+
* 'cases',
|
|
38
|
+
* 'centernot',
|
|
39
|
+
* 'color',
|
|
40
|
+
* 'colortbl',
|
|
41
|
+
* 'colorv2',
|
|
42
|
+
* 'configmacros',
|
|
43
|
+
* 'dsfont',
|
|
44
|
+
* 'empheq',
|
|
45
|
+
* 'enclose',
|
|
46
|
+
* 'extpfeil',
|
|
47
|
+
* 'gensymb',
|
|
48
|
+
* 'html',
|
|
49
|
+
* 'mathtools',
|
|
50
|
+
* 'mhchem',
|
|
51
|
+
* 'newcommand',
|
|
52
|
+
* 'noerrors',
|
|
53
|
+
* 'noundefined',
|
|
54
|
+
* 'physics',
|
|
55
|
+
* 'require',
|
|
56
|
+
* 'setoptions',
|
|
57
|
+
* 'tagformat',
|
|
58
|
+
* 'texhtml',
|
|
59
|
+
* 'textcomp',
|
|
60
|
+
* 'textmacros',
|
|
61
|
+
* 'unicode',
|
|
62
|
+
* 'units',
|
|
63
|
+
* 'upgreek',
|
|
64
|
+
* 'verb',
|
|
65
|
+
* ]
|
|
66
|
+
*/
|
|
67
|
+
packages?: TexPackage[];
|
|
68
|
+
/**
|
|
69
|
+
* pattern for recognizing numbers
|
|
70
|
+
*
|
|
71
|
+
* @default /^(?:[0-9]+(?:\{,\}[0-9]{3})*(?:\.[0-9]*)?|\.[0-9]+)/
|
|
72
|
+
*/
|
|
73
|
+
digits?: RegExp;
|
|
74
|
+
tags?: "ams" | "all" | "none";
|
|
75
|
+
/**
|
|
76
|
+
* side for `\tag` macros
|
|
77
|
+
*/
|
|
78
|
+
tagSide?: "left" | "right";
|
|
79
|
+
/**
|
|
80
|
+
* amount to indent tags
|
|
81
|
+
*
|
|
82
|
+
* @default "0.8em"
|
|
83
|
+
*/
|
|
84
|
+
tagIndent?: "0.8em";
|
|
85
|
+
/**
|
|
86
|
+
* use label name rather than tag for ids
|
|
87
|
+
*
|
|
88
|
+
* @default true;
|
|
89
|
+
*/
|
|
90
|
+
useLabelIds?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* maximum number of macro substitutions per expression
|
|
93
|
+
*
|
|
94
|
+
* @default 1000
|
|
95
|
+
*/
|
|
96
|
+
maxMacros?: number;
|
|
97
|
+
/**
|
|
98
|
+
* maximum size for the internal TeX string (in bytes)
|
|
99
|
+
*
|
|
100
|
+
* @default 5120
|
|
101
|
+
*/
|
|
102
|
+
maxBuffer?: number;
|
|
103
|
+
formatError?: (jax: TeX<unknown, unknown, unknown>, error: typeof TexError) => MmlNode;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Data passed to MathJax filters
|
|
107
|
+
*/
|
|
108
|
+
interface MathjaxFilterData {
|
|
109
|
+
math: MathItem<LiteElement, string, HTMLElement>;
|
|
110
|
+
document: MathDocument<LiteElement, string, HTMLElement>;
|
|
111
|
+
data: any;
|
|
96
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* MathJax filter function
|
|
115
|
+
*/
|
|
116
|
+
type MathjaxFilter = (data: MathjaxFilterData) => void;
|
|
117
|
+
/**
|
|
118
|
+
* @see https://docs.mathjax.org/en/latest/options/output/index.html#option-descriptions
|
|
119
|
+
*/
|
|
97
120
|
interface MathjaxCommonOutputOptions {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Global scaling factor for all expressions
|
|
123
|
+
*
|
|
124
|
+
* @default 1
|
|
125
|
+
*/
|
|
126
|
+
scale?: number;
|
|
127
|
+
/**
|
|
128
|
+
* smallest scaling factor to use
|
|
129
|
+
*
|
|
130
|
+
* @default 0.5
|
|
131
|
+
*/
|
|
132
|
+
minScale?: number;
|
|
133
|
+
/**
|
|
134
|
+
* make mtext elements use surrounding font
|
|
135
|
+
*
|
|
136
|
+
* @default false
|
|
137
|
+
*/
|
|
138
|
+
mtextInheritFont?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* make merror text use surrounding font
|
|
141
|
+
*
|
|
142
|
+
* @default true
|
|
143
|
+
*/
|
|
144
|
+
merrorInheritFont?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* font to use for mtext, if not inheriting (empty means use MathJax fonts)
|
|
147
|
+
*
|
|
148
|
+
* @default ""
|
|
149
|
+
*/
|
|
150
|
+
mtextFont?: string;
|
|
151
|
+
/**
|
|
152
|
+
* font to use for merror, if not inheriting (empty means use MathJax fonts)
|
|
153
|
+
*
|
|
154
|
+
* @default "serif"
|
|
155
|
+
*/
|
|
156
|
+
merrorFont?: string;
|
|
157
|
+
/**
|
|
158
|
+
* font to use for character that aren’t in MathJax's fonts
|
|
159
|
+
*
|
|
160
|
+
* @default "serif"
|
|
161
|
+
*/
|
|
162
|
+
unknownFamily?: string;
|
|
163
|
+
/**
|
|
164
|
+
* - `true` for MathML spacing rules
|
|
165
|
+
* - `false` for TeX rules
|
|
166
|
+
*
|
|
167
|
+
* @default false
|
|
168
|
+
*/
|
|
169
|
+
mathmlSpacing?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* RFDa and other attributes NOT to copy to the output
|
|
172
|
+
*/
|
|
173
|
+
skipAttributes?: Record<string, boolean>;
|
|
174
|
+
/**
|
|
175
|
+
* default size of ex in em units
|
|
176
|
+
*
|
|
177
|
+
* @default 0.5
|
|
178
|
+
*/
|
|
179
|
+
exFactor?: number;
|
|
180
|
+
/**
|
|
181
|
+
* default for indentalign when set to 'auto'
|
|
182
|
+
*
|
|
183
|
+
* @default "center"
|
|
184
|
+
*/
|
|
185
|
+
displayAlign?: "left" | "center" | "right";
|
|
186
|
+
/**
|
|
187
|
+
* default for indentshift when set to 'auto'
|
|
188
|
+
*
|
|
189
|
+
* @default 0
|
|
190
|
+
*/
|
|
191
|
+
displayIndent?: string;
|
|
192
|
+
/**
|
|
193
|
+
* default for overflow
|
|
194
|
+
*
|
|
195
|
+
* @default "overflow"
|
|
196
|
+
*/
|
|
197
|
+
displayOverflow?: "scroll" | "scale" | "truncate" | "elide" | "linebreak" | "overflow";
|
|
198
|
+
/**
|
|
199
|
+
* options for when overflow is linebreak
|
|
200
|
+
*/
|
|
201
|
+
linebreaks?: {
|
|
202
|
+
/**
|
|
203
|
+
* true for browser-based breaking of inline equations
|
|
118
204
|
*
|
|
119
205
|
* @default true
|
|
120
206
|
*/
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* font to use for mtext, if not inheriting (empty means use MathJax fonts)
|
|
124
|
-
*
|
|
125
|
-
* @default ""
|
|
126
|
-
*/
|
|
127
|
-
mtextFont?: string;
|
|
128
|
-
/**
|
|
129
|
-
* font to use for merror, if not inheriting (empty means use MathJax fonts)
|
|
130
|
-
*
|
|
131
|
-
* @default "serif"
|
|
132
|
-
*/
|
|
133
|
-
merrorFont?: string;
|
|
207
|
+
inline?: boolean;
|
|
134
208
|
/**
|
|
135
|
-
*
|
|
209
|
+
* a fixed size or a percentage of the container width
|
|
136
210
|
*
|
|
137
|
-
* @default "
|
|
211
|
+
* @default "100%"
|
|
138
212
|
*/
|
|
139
|
-
|
|
213
|
+
width?: string;
|
|
140
214
|
/**
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
displayAlign?: "left" | "center" | "right";
|
|
144
|
-
/**
|
|
145
|
-
* @default 0
|
|
146
|
-
*/
|
|
147
|
-
displayIndent?: string;
|
|
148
|
-
/**
|
|
149
|
-
* - `true` for MathML spacing rules
|
|
150
|
-
* - `false` for TeX rules
|
|
151
|
-
*
|
|
152
|
-
* @default false
|
|
153
|
-
*/
|
|
154
|
-
mathmlSpacing?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* RFDa and other attributes NOT to copy to the output
|
|
157
|
-
*/
|
|
158
|
-
skipAttributes?: Record<string, boolean>;
|
|
159
|
-
/**
|
|
160
|
-
* default size of ex in em units
|
|
215
|
+
* the default lineleading in em units
|
|
161
216
|
*
|
|
162
|
-
* @default 0.
|
|
163
|
-
*/
|
|
164
|
-
|
|
217
|
+
* @default 0.2
|
|
218
|
+
*/
|
|
219
|
+
lineleading?: number;
|
|
220
|
+
/**
|
|
221
|
+
* for developers only
|
|
222
|
+
*/
|
|
223
|
+
LinebreakVisitor?: typeof LinebreakVisitor;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* the font component to load
|
|
227
|
+
*
|
|
228
|
+
* @default ""
|
|
229
|
+
*/
|
|
230
|
+
font?: string;
|
|
231
|
+
/**
|
|
232
|
+
* The path to the font definitions
|
|
233
|
+
*
|
|
234
|
+
* @default "https://cdn.jsdelivr.net/npm/@mathjax/mathjax-newcm-font/"
|
|
235
|
+
*/
|
|
236
|
+
fontPath?: string;
|
|
237
|
+
/**
|
|
238
|
+
* The font extensions to load
|
|
239
|
+
*
|
|
240
|
+
* @default []
|
|
241
|
+
*/
|
|
242
|
+
fontExtensions?: string[];
|
|
243
|
+
/**
|
|
244
|
+
* 'use', 'force', or 'ignore' data-mjx-hdw attributes
|
|
245
|
+
*
|
|
246
|
+
* @default "auto"
|
|
247
|
+
*/
|
|
248
|
+
htmlHDW?: "use" | "force" | "ignore";
|
|
249
|
+
/**
|
|
250
|
+
* A list of pre-filters to add to the output jax
|
|
251
|
+
*
|
|
252
|
+
* @default []
|
|
253
|
+
*/
|
|
254
|
+
preFilters?: MathjaxFilter[];
|
|
255
|
+
/**
|
|
256
|
+
* A list of post-filters to add to the output jax
|
|
257
|
+
*
|
|
258
|
+
* @default []
|
|
259
|
+
*/
|
|
260
|
+
postFilters?: MathjaxFilter[];
|
|
261
|
+
/**
|
|
262
|
+
* for developers only
|
|
263
|
+
*/
|
|
264
|
+
cssStyles?: typeof CssStyles;
|
|
165
265
|
}
|
|
166
266
|
interface MathjaxCommonHTMLOutputOptions extends MathjaxCommonOutputOptions {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Whether match ex-height of surrounding font
|
|
269
|
+
*
|
|
270
|
+
* @default true
|
|
271
|
+
*/
|
|
272
|
+
matchFontHeight?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Font data to use
|
|
275
|
+
*
|
|
276
|
+
* @default font data from `@mathjax/mathjax-newcm-font`
|
|
277
|
+
*/
|
|
278
|
+
fontData?: typeof ChtmlFontData;
|
|
279
|
+
/**
|
|
280
|
+
* The URL where the fonts are found
|
|
281
|
+
*
|
|
282
|
+
* @default jsdelivr CDN links for `@mathjax/mathjax-newcm-font`
|
|
283
|
+
*/
|
|
284
|
+
fontURL?: string;
|
|
285
|
+
/**
|
|
286
|
+
* location where MathJax should look for font data that has to be loaded dynamically.
|
|
287
|
+
*
|
|
288
|
+
* @default jsdelivr CDN links for `@mathjax/mathjax-newcm-font`
|
|
289
|
+
*/
|
|
290
|
+
dynamicPrefix?: string;
|
|
291
|
+
/**
|
|
292
|
+
* Whether only produce CSS that is used in the processed equations
|
|
293
|
+
*
|
|
294
|
+
* @default true
|
|
295
|
+
*/
|
|
296
|
+
adaptiveCSS?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* for developers only
|
|
299
|
+
*/
|
|
300
|
+
wrapperFactory?: typeof ChtmlWrapperFactory;
|
|
185
301
|
}
|
|
186
302
|
interface MathjaxSVGOutputOptions extends MathjaxCommonOutputOptions {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
303
|
+
/**
|
|
304
|
+
* stroke-width to use for SVG character paths in units that are 1/1000 of an em
|
|
305
|
+
*
|
|
306
|
+
* @default 3
|
|
307
|
+
*/
|
|
308
|
+
blacker?: number;
|
|
309
|
+
/**
|
|
310
|
+
* @see https://docs.mathjax.org/en/latest/options/output/svg.html#option-descriptions
|
|
311
|
+
* @default "local"
|
|
312
|
+
*/
|
|
313
|
+
fontCache?: "local" | "global" | "none";
|
|
314
|
+
/**
|
|
315
|
+
* Font data to use
|
|
316
|
+
*
|
|
317
|
+
* @default font data from `@mathjax/mathjax-newcm-font`
|
|
318
|
+
*/
|
|
319
|
+
fontData?: typeof SvgFontData;
|
|
320
|
+
/**
|
|
321
|
+
* Whether the xlink namespace should be included in the href attributes or not
|
|
322
|
+
*
|
|
323
|
+
* @default true
|
|
324
|
+
*/
|
|
325
|
+
useXlink?: boolean;
|
|
326
|
+
/**
|
|
327
|
+
* ID to use for local font cache (for single equation processing)
|
|
328
|
+
*/
|
|
329
|
+
localID?: string | null;
|
|
330
|
+
/**
|
|
331
|
+
* for developers only
|
|
332
|
+
*/
|
|
333
|
+
wrapperFactory?: typeof SvgWrapperFactory;
|
|
205
334
|
}
|
|
206
|
-
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/options.d.ts
|
|
207
337
|
type TeXTransformer = (content: string, displayMode: boolean) => string;
|
|
208
338
|
interface MarkdownItMathjaxOptions extends Pick<MarkdownItTexOptions, "allowInlineWithSpace" | "delimiters" | "mathFence"> {
|
|
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
|
-
|
|
339
|
+
/**
|
|
340
|
+
* Output syntax
|
|
341
|
+
*
|
|
342
|
+
* 输出格式
|
|
343
|
+
*
|
|
344
|
+
* @default 'svg'
|
|
345
|
+
*/
|
|
346
|
+
output?: "chtml" | "svg";
|
|
347
|
+
/**
|
|
348
|
+
* Enable A11y
|
|
349
|
+
*
|
|
350
|
+
* 是否启用无障碍
|
|
351
|
+
*
|
|
352
|
+
* @default true
|
|
353
|
+
*/
|
|
354
|
+
a11y?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* TeX input options
|
|
357
|
+
*
|
|
358
|
+
* TeX 输入选项
|
|
359
|
+
*/
|
|
360
|
+
tex?: MathJaxTexInputOptions;
|
|
361
|
+
/**
|
|
362
|
+
* Common HTML output options
|
|
363
|
+
*
|
|
364
|
+
* 通用 HTML 输出选项
|
|
365
|
+
*/
|
|
366
|
+
chtml?: MathjaxCommonHTMLOutputOptions;
|
|
367
|
+
/**
|
|
368
|
+
* SVG output options
|
|
369
|
+
*
|
|
370
|
+
* SVG 输出选项
|
|
371
|
+
*/
|
|
372
|
+
svg?: MathjaxSVGOutputOptions;
|
|
373
|
+
/**
|
|
374
|
+
* transformer on output content
|
|
375
|
+
*
|
|
376
|
+
* 输出内容的转换器
|
|
377
|
+
*/
|
|
378
|
+
transformer?: TeXTransformer;
|
|
249
379
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
* Forked from https://github.com/tani/markdown-it-mathjax3/blob/master/index.ts
|
|
253
|
-
*/
|
|
254
|
-
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/plugin.d.ts
|
|
255
382
|
interface DocumentOptions {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
383
|
+
InputJax: TeX<LiteElement, string, HTMLElement>;
|
|
384
|
+
OutputJax: CHTML<LiteElement, string, HTMLElement> | SVG<LiteElement, string, HTMLElement>;
|
|
385
|
+
enableAssistiveMml: boolean;
|
|
259
386
|
}
|
|
260
387
|
declare const getDocumentOptions: (options: MarkdownItMathjaxOptions) => Promise<DocumentOptions>;
|
|
261
388
|
/**
|
|
262
389
|
* Mathjax instance
|
|
263
390
|
*/
|
|
264
391
|
interface MathjaxInstance extends Required<Pick<MarkdownItMathjaxOptions, "allowInlineWithSpace" | "delimiters" | "mathFence">> {
|
|
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
|
-
|
|
392
|
+
/**
|
|
393
|
+
* Mathjax adaptor
|
|
394
|
+
*/
|
|
395
|
+
adaptor: LiteAdaptor;
|
|
396
|
+
/**
|
|
397
|
+
* Mathjax document options
|
|
398
|
+
*/
|
|
399
|
+
documentOptions: DocumentOptions;
|
|
400
|
+
/**
|
|
401
|
+
* Clear style cache
|
|
402
|
+
*/
|
|
403
|
+
clearStyle: () => void;
|
|
404
|
+
/**
|
|
405
|
+
* Output style for rendered content and clears it
|
|
406
|
+
*
|
|
407
|
+
* @returns style
|
|
408
|
+
*/
|
|
409
|
+
outputStyle: () => Promise<string>;
|
|
410
|
+
/**
|
|
411
|
+
* Reset tex (including labels)
|
|
412
|
+
*/
|
|
413
|
+
reset: () => void;
|
|
414
|
+
/**
|
|
415
|
+
* Output content transformer
|
|
416
|
+
*/
|
|
417
|
+
transformer: TeXTransformer | null;
|
|
291
418
|
}
|
|
292
419
|
declare const createMathjaxInstance: (options?: MarkdownItMathjaxOptions) => Promise<MathjaxInstance | null>;
|
|
293
|
-
declare const mathjax: (md: MarkdownIt, {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
420
|
+
declare const mathjax: (md: MarkdownIt, {
|
|
421
|
+
allowInlineWithSpace,
|
|
422
|
+
adaptor,
|
|
423
|
+
delimiters,
|
|
424
|
+
documentOptions,
|
|
425
|
+
mathFence,
|
|
426
|
+
transformer
|
|
427
|
+
}: MathjaxInstance) => void;
|
|
428
|
+
//#endregion
|
|
429
|
+
export { DocumentOptions, MarkdownItMathjaxOptions, MathJaxTexInputOptions, MathjaxCommonHTMLOutputOptions, MathjaxCommonOutputOptions, MathjaxFilter, MathjaxFilterData, MathjaxInstance, MathjaxSVGOutputOptions, TeXTransformer, TexPackage, createMathjaxInstance, getDocumentOptions, mathjax };
|
|
430
|
+
//# sourceMappingURL=index.d.ts.map
|