@unified-latex/unified-latex-util-parse 1.6.0 → 1.7.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/README.md +103 -0
- package/index.cjs +1020 -24262
- package/index.cjs.map +1 -7
- package/index.d.ts +148 -17
- package/index.js +34 -60
- package/index.js.map +1 -7
- package/package.json +11 -11
- package/index.d.ts.map +0 -1
- package/libs/compiler-ast.d.ts +0 -7
- package/libs/compiler-ast.d.ts.map +0 -1
- package/libs/parse-math.d.ts +0 -7
- package/libs/parse-math.d.ts.map +0 -1
- package/libs/parse-minimal.d.ts +0 -17
- package/libs/parse-minimal.d.ts.map +0 -1
- package/libs/parse.d.ts +0 -16
- package/libs/parse.d.ts.map +0 -1
- package/libs/plugin-from-string-minimal.d.ts +0 -15
- package/libs/plugin-from-string-minimal.d.ts.map +0 -1
- package/libs/plugin-from-string.d.ts +0 -28
- package/libs/plugin-from-string.d.ts.map +0 -1
- package/libs/process-at-letter-and-expl-macros.d.ts +0 -27
- package/libs/process-at-letter-and-expl-macros.d.ts.map +0 -1
- package/libs/process-macros-and-environments.d.ts +0 -14
- package/libs/process-macros-and-environments.d.ts.map +0 -1
- package/libs/reparse-math.d.ts +0 -25
- package/libs/reparse-math.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -94,6 +94,85 @@ PluginOptions
|
|
|
94
94
|
function unifiedLatexFromStringMinimal(options: PluginOptions): void;
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
+
## `unifiedLatexProcessAtLetterAndExplMacros`
|
|
98
|
+
|
|
99
|
+
Unified plugin to reprocess macros names to possibly include `@`, `_`, or `:`.
|
|
100
|
+
This plugin detects the `\makeatletter` and `\ExplSyntaxOn` commands and reprocesses macro names
|
|
101
|
+
inside of those blocks to include those characters.
|
|
102
|
+
|
|
103
|
+
### Usage
|
|
104
|
+
|
|
105
|
+
`unified().use(unifiedLatexProcessAtLetterAndExplMacros[, options])`
|
|
106
|
+
|
|
107
|
+
#### options
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
{ atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Type
|
|
114
|
+
|
|
115
|
+
`Plugin<{ atLetter?: boolean; expl3?: boolean; autodetectExpl3AndAtLetter?: boolean; }[], Ast.Root, Ast.Root>`
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
function unifiedLatexProcessAtLetterAndExplMacros(options: {
|
|
119
|
+
atLetter?: boolean;
|
|
120
|
+
expl3?: boolean;
|
|
121
|
+
autodetectExpl3AndAtLetter?: boolean;
|
|
122
|
+
}): (tree: Ast.Root) => void;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## `unifiedLatexProcessMacrosAndEnvironmentsWithMathReparse`
|
|
126
|
+
|
|
127
|
+
Unified plugin to process macros and environments. Any environments that contain math content
|
|
128
|
+
are reparsed (if needed) in math mode.
|
|
129
|
+
|
|
130
|
+
### Usage
|
|
131
|
+
|
|
132
|
+
`unified().use(unifiedLatexProcessMacrosAndEnvironmentsWithMathReparse[, options])`
|
|
133
|
+
|
|
134
|
+
#### options
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
{ environments: Ast.EnvInfoRecord; macros: Ast.MacroInfoRecord; }
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Type
|
|
141
|
+
|
|
142
|
+
`Plugin<{ environments: Ast.EnvInfoRecord; macros: Ast.MacroInfoRecord; }[], Ast.Root, Ast.Root>`
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
function unifiedLatexProcessMacrosAndEnvironmentsWithMathReparse(options: {
|
|
146
|
+
environments: Ast.EnvInfoRecord;
|
|
147
|
+
macros: Ast.MacroInfoRecord;
|
|
148
|
+
}): (tree: Ast.Root) => void;
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## `unifiedLatexReparseMath`
|
|
152
|
+
|
|
153
|
+
Reparse math environments/macro contents that should have been parsed in math mode but weren't.
|
|
154
|
+
|
|
155
|
+
### Usage
|
|
156
|
+
|
|
157
|
+
`unified().use(unifiedLatexReparseMath[, options])`
|
|
158
|
+
|
|
159
|
+
#### options
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
{ mathEnvs: string[]; mathMacros: string[]; }
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Type
|
|
166
|
+
|
|
167
|
+
`Plugin<{ mathEnvs: string[]; mathMacros: string[]; }[], Ast.Root, Ast.Root>`
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
function unifiedLatexReparseMath(options: {
|
|
171
|
+
mathEnvs: string[];
|
|
172
|
+
mathMacros: string[];
|
|
173
|
+
}): (tree: Ast.Root) => void;
|
|
174
|
+
```
|
|
175
|
+
|
|
97
176
|
# Functions
|
|
98
177
|
|
|
99
178
|
## `getParser(options)`
|
|
@@ -184,6 +263,30 @@ function parseMinimal(str: String): Ast.Root;
|
|
|
184
263
|
| :---- | :------- |
|
|
185
264
|
| str | `String` |
|
|
186
265
|
|
|
266
|
+
`unifiedLatexReparseMathConstructPlugin({
|
|
267
|
+
mathEnvs,
|
|
268
|
+
mathMacros,
|
|
269
|
+
})`
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
Construct the inner function for the `unifiedLatexReparseMath` plugin. This function should not be used by libraries.
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
function unifiedLatexReparseMathConstructPlugin({
|
|
276
|
+
mathEnvs,
|
|
277
|
+
mathMacros,
|
|
278
|
+
}: {
|
|
279
|
+
mathEnvs: string[];
|
|
280
|
+
mathMacros: string[];
|
|
281
|
+
}): (tree: Ast.Root) => void;
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Parameters**
|
|
285
|
+
|
|
286
|
+
| Param | Type |
|
|
287
|
+
| :-------------------------------------------- | :-------------------------------- |
|
|
288
|
+
| {
 mathEnvs,
 mathMacros,
} | <span color='gray'>Omitted</span> |
|
|
289
|
+
|
|
187
290
|
# Types
|
|
188
291
|
|
|
189
292
|
## `PluginOptions`
|