@ox-content/unplugin 2.66.0 → 2.68.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/dist/index.d.mts +53 -4
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -145,7 +145,15 @@ type RehypePlugin = UnifiedAttacher | UnifiedPluginTuple | UnifiedPreset;
|
|
|
145
145
|
* Transforms HTML after rendering.
|
|
146
146
|
*/
|
|
147
147
|
type OxContentPlugin = (html: string) => string | Promise<string>;
|
|
148
|
+
/**
|
|
149
|
+
* Code annotation options for the framework-agnostic unplugin package.
|
|
150
|
+
*/
|
|
148
151
|
interface CodeAnnotationsOptions {
|
|
152
|
+
/**
|
|
153
|
+
* Attribute name read from the code fence meta string.
|
|
154
|
+
*
|
|
155
|
+
* @default 'annotate'
|
|
156
|
+
*/
|
|
149
157
|
metaKey?: string;
|
|
150
158
|
}
|
|
151
159
|
interface ResolvedCodeAnnotationsOptions {
|
|
@@ -154,7 +162,10 @@ interface ResolvedCodeAnnotationsOptions {
|
|
|
154
162
|
}
|
|
155
163
|
/**
|
|
156
164
|
* API documentation generation configuration.
|
|
157
|
-
*
|
|
165
|
+
*
|
|
166
|
+
* The unplugin package keeps this surface smaller than the Vite plugin's docs
|
|
167
|
+
* generator, but follows the same convention: provide `true` for defaults or an
|
|
168
|
+
* object to customize scanning and output.
|
|
158
169
|
*/
|
|
159
170
|
interface DocsConfig {
|
|
160
171
|
/**
|
|
@@ -164,6 +175,10 @@ interface DocsConfig {
|
|
|
164
175
|
enabled?: boolean;
|
|
165
176
|
/**
|
|
166
177
|
* Source directories to scan for documentation.
|
|
178
|
+
*
|
|
179
|
+
* Paths are resolved from the bundler project root before include/exclude
|
|
180
|
+
* matching.
|
|
181
|
+
*
|
|
167
182
|
* @default ['./src']
|
|
168
183
|
*/
|
|
169
184
|
src?: string[];
|
|
@@ -174,6 +189,9 @@ interface DocsConfig {
|
|
|
174
189
|
out?: string;
|
|
175
190
|
/**
|
|
176
191
|
* File patterns to include.
|
|
192
|
+
*
|
|
193
|
+
* Patterns are evaluated inside each configured `src` directory.
|
|
194
|
+
*
|
|
177
195
|
* @default ['**\/*.ts', '**\/*.tsx', '**\/*.js', '**\/*.jsx']
|
|
178
196
|
*/
|
|
179
197
|
include?: string[];
|
|
@@ -199,42 +217,58 @@ interface DocsConfig {
|
|
|
199
217
|
groupBy?: "file" | "kind";
|
|
200
218
|
}
|
|
201
219
|
/**
|
|
202
|
-
* Plugin configuration for various
|
|
220
|
+
* Plugin configuration for various Markdown ecosystems.
|
|
221
|
+
*
|
|
222
|
+
* Plugins run in the order listed for their respective pipeline stage. Use this
|
|
223
|
+
* when migrating from markdown-it, remark, or rehype based stacks while keeping
|
|
224
|
+
* ox-content as the parser/renderer bridge.
|
|
203
225
|
*/
|
|
204
226
|
interface PluginConfig {
|
|
205
227
|
/**
|
|
206
228
|
* Ox-content native plugins.
|
|
207
229
|
* Transform HTML after rendering.
|
|
230
|
+
* @default []
|
|
208
231
|
*/
|
|
209
232
|
oxContent?: OxContentPlugin[];
|
|
210
233
|
/**
|
|
211
234
|
* Markdown-it plugins.
|
|
235
|
+
* @default []
|
|
212
236
|
* @see https://www.npmjs.com/search?q=markdown-it-plugin
|
|
213
237
|
*/
|
|
214
238
|
markdownIt?: MarkdownItPlugin[];
|
|
215
239
|
/**
|
|
216
240
|
* mdast plugins.
|
|
217
241
|
* Accepts both Ox Content-native mdast plugins and existing remark plugins.
|
|
242
|
+
* @default []
|
|
218
243
|
*/
|
|
219
244
|
mdast?: MdastPlugin[];
|
|
220
245
|
/**
|
|
221
246
|
* Remark plugins (unified ecosystem).
|
|
222
247
|
* Kept for compatibility; runs in the same mdast stage as `plugin.mdast`.
|
|
248
|
+
* @default []
|
|
223
249
|
* @see https://github.com/remarkjs/remark/blob/main/doc/plugins.md
|
|
224
250
|
*/
|
|
225
251
|
remark?: RemarkPlugin[];
|
|
226
252
|
/**
|
|
227
253
|
* Rehype plugins (unified ecosystem).
|
|
254
|
+
* @default []
|
|
228
255
|
* @see https://github.com/rehypejs/rehype/blob/main/doc/plugins.md
|
|
229
256
|
*/
|
|
230
257
|
rehype?: RehypePlugin[];
|
|
231
258
|
}
|
|
232
259
|
/**
|
|
233
|
-
*
|
|
260
|
+
* Options for the framework-agnostic ox-content unplugin.
|
|
261
|
+
*
|
|
262
|
+
* This package is intended for bundlers such as webpack, Rollup, esbuild,
|
|
263
|
+
* Rspack, and Vite. It exposes a compact subset of the core Vite plugin options
|
|
264
|
+
* plus ecosystem plugin hooks.
|
|
234
265
|
*/
|
|
235
266
|
interface OxContentOptions {
|
|
236
267
|
/**
|
|
237
268
|
* Source directory for Markdown files.
|
|
269
|
+
*
|
|
270
|
+
* Used as the logical content root for generated modules and docs output.
|
|
271
|
+
*
|
|
238
272
|
* @default 'docs'
|
|
239
273
|
*/
|
|
240
274
|
srcDir?: string;
|
|
@@ -275,7 +309,16 @@ interface OxContentOptions {
|
|
|
275
309
|
highlightTheme?: string;
|
|
276
310
|
/**
|
|
277
311
|
* Opt-in line annotations for fenced code blocks.
|
|
278
|
-
*
|
|
312
|
+
*
|
|
313
|
+
* Pass `true` to enable the default `annotate` meta key, or pass an object to
|
|
314
|
+
* configure the key.
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* ~~~md
|
|
318
|
+
* ```ts annotate="highlight:1,3-4;warning:6"
|
|
319
|
+
* ```
|
|
320
|
+
* ~~~
|
|
321
|
+
*
|
|
279
322
|
* @default false
|
|
280
323
|
*/
|
|
281
324
|
codeAnnotations?: boolean | CodeAnnotationsOptions;
|
|
@@ -306,14 +349,20 @@ interface OxContentOptions {
|
|
|
306
349
|
extensions?: string[];
|
|
307
350
|
/**
|
|
308
351
|
* Files/patterns to include.
|
|
352
|
+
* Empty by default, which lets the Markdown extension filter decide.
|
|
353
|
+
* @default []
|
|
309
354
|
*/
|
|
310
355
|
include?: string | RegExp | RegExp[];
|
|
311
356
|
/**
|
|
312
357
|
* Files/patterns to exclude.
|
|
358
|
+
* Empty by default.
|
|
359
|
+
* @default []
|
|
313
360
|
*/
|
|
314
361
|
exclude?: string | RegExp | RegExp[];
|
|
315
362
|
/**
|
|
316
363
|
* Plugin configuration for markdown processing.
|
|
364
|
+
* Each plugin list defaults to an empty array.
|
|
365
|
+
* @default {}
|
|
317
366
|
*/
|
|
318
367
|
plugin?: PluginConfig;
|
|
319
368
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox-content/unplugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.68.0",
|
|
4
4
|
"description": "Universal plugin for Ox Content - Markdown processing for webpack, rollup, esbuild, vite, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"esbuild",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"remark-rehype": "^11.1.1",
|
|
66
66
|
"unified": "^11.0.5",
|
|
67
67
|
"unplugin": "^3.0.0",
|
|
68
|
-
"@ox-content/napi": "2.
|
|
68
|
+
"@ox-content/napi": "2.68.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/markdown-it": "^14.1.2",
|