-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.json
More file actions
352 lines (333 loc) · 14.7 KB
/
config.example.json
File metadata and controls
352 lines (333 loc) · 14.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
{
"$schema": "https://json-schema.org/draft-07/schema#",
"description": "Configuration file for WriteChoice Mint CLI",
// Production documentation URL — used as the base for scraping and link resolution.
"source": "https://docs.example.com",
// Validation environment URL (e.g. localhost:3000) — used by the link checker.
"target": "http://localhost:3000",
// ── wc check links ───────────────────────────────────────────────────────────
"links": {
// Single MDX file to check. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to check recursively. Mutually exclusive with file.
"dir": null,
// Output file path for the broken-link report (no extension — written as JSON).
"output": "links_report",
// Preview broken links without writing a report file.
"dry-run": false,
// Suppress progress output.
"quiet": false,
// Number of URLs to check in parallel.
"concurrency": 25,
// Use a headless browser to follow JavaScript redirects.
"headless": true
},
// ── wc check parse ───────────────────────────────────────────────────────────
"parse": {
// Single MDX file to validate. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to validate recursively. Mutually exclusive with file.
"dir": null,
// Suppress progress output.
"quiet": false
},
// ── wc fix codeblocks ────────────────────────────────────────────────────────
"codeblocks": {
// Single MDX file to process. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to process recursively. Mutually exclusive with file.
"dir": null,
// Preview changes without writing files.
"dry-run": false,
// Suppress progress output.
"quiet": false,
// Line count above which a code block is wrapped in an <Expandable>.
"threshold": 15,
// Wrap oversized blocks in an <Expandable> component instead of truncating.
"expandable": true,
// Force a specific line count limit, overriding threshold.
"lines": null,
// Wrap long lines at this column width (null = no wrapping).
"wrap": null
},
// ── wc fix images ────────────────────────────────────────────────────────────
"images": {
// Single MDX file to process. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to process recursively. Mutually exclusive with file.
"dir": null,
// Download remote images locally instead of keeping remote URLs.
"download": false,
// Preview changes without writing files.
"dry-run": false,
// Suppress progress output.
"quiet": false
},
// ── wc fix inlineimages ──────────────────────────────────────────────────────
"inlineimages": {
// Single MDX file to process. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to process recursively. Mutually exclusive with file.
"dir": null,
// Preview changes without writing files.
"dry-run": false,
// Suppress progress output.
"quiet": false
},
// ── wc fix h1 ────────────────────────────────────────────────────────────────
"h1": {
// Single MDX file to process. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to process recursively. Mutually exclusive with file.
"dir": null,
// Preview changes without writing files.
"dry-run": false,
// Suppress progress output.
"quiet": false
},
// ── wc fix imports ───────────────────────────────────────────────────────────
"imports": {
// Single MDX file to process. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to process recursively. Mutually exclusive with file.
"dir": null,
// Directory where shared snippets are stored.
"snippets": "snippets",
// Preview changes without writing files.
"dry-run": false,
// Suppress progress output.
"quiet": false
},
// ── wc fix tabs ──────────────────────────────────────────────────────────────
"tabs": {
// Single MDX file to process. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to process recursively. Mutually exclusive with file.
"dir": null,
// Preview changes without writing files.
"dry-run": false,
// Suppress progress output.
"quiet": false
},
// ── wc nav ───────────────────────────────────────────────────────────────────
"nav": {
"folders": {
// Path to the Mintlify docs.json navigation file.
"docs": "docs.json",
// Include the base (root) folder as a nav group.
"base": true,
// Folder depth levels to flatten/skip when building the nav tree.
"skip_levels": [],
// Rename nav groups to title-case derived from folder names.
"rename": false,
// Preview changes without writing docs.json.
"dry-run": false,
// Suppress progress output.
"quiet": false
},
"root": {
// Path to the Mintlify docs.json navigation file.
"docs": "docs.json",
// Preview changes without writing docs.json.
"dry-run": false,
// Suppress progress output.
"quiet": false
}
},
// ── wc fix redirects ─────────────────────────────────────────────────────────
"fix": {
"redirects": {
// Path to the Mintlify docs.json file containing the redirects array.
"docs": "docs.json",
// Directory of MDX files to scan for moved pages. Mutually exclusive with file.
"dir": null,
// Preview changes without writing docs.json.
"dry-run": false,
// Suppress progress output.
"quiet": false
}
},
// ── wc scrape ────────────────────────────────────────────────────────────────
"scrape": {
// JSON file listing the URLs to scrape. Each entry can be a string URL or an object.
"urls_file": "urls.json",
// Directory to write the converted MDX files into.
"output": "output",
// Number of pages to scrape in parallel.
"concurrency": 3,
// Use a Playwright browser instead of native fetch (needed for JS-rendered pages).
"playwright": false,
// Preview conversions without writing any MDX files.
"dry-run": false,
// Suppress per-page progress output.
"quiet": false,
// CSS selector for the main content area to extract. Everything outside is ignored.
"content_selector": "body",
// CSS selector used to find the page title for the frontmatter.
"title_selector": "h1",
// CSS selectors to remove before conversion (nav, sidebars, footers, etc.).
// Example: [".sidebar", ".toc", "nav", ".feedback-form"]
"elements_to_remove": [],
// HTML tags whose content is preserved as raw HTML in the MDX output,
// bypassing Markdown conversion.
//
// Table behaviour is controlled by whether "table" appears here:
// - "table" included: all tables are kept as raw HTML.
// - "table" omitted (default): simple text-only tables are converted to
// GFM markdown tables. The original HTML is kept as a JSX comment
// ({/* ... */}) directly above the markdown table. Tables that contain
// lists, code blocks, divs, or nested tables are kept as raw HTML.
"html_preserve_elements": ["iframe"],
// Additional CSS selectors to preserve as raw HTML verbatim.
// Useful for custom widgets, SVG diagrams, or anything Turndown mangled.
// Example: ["figure.diagram", ".code-playground"]
"html_preserve_custom": [],
// ── Image handling ────────────────────────────────────────────────────────
"images": {
// How to handle image URLs in the scraped content:
// "keep_remote" — leave all src URLs as-is.
// "download_by_url" — download each image and save using its URL path.
// "download_by_page" — download each image and save under the page slug.
"strategy": "keep_remote",
// Subdirectory inside output where downloaded images are saved.
"folder": "images"
},
// ── Component mappings ────────────────────────────────────────────────────
// Each entry maps a CSS selector in the source HTML to a Mintlify MDX component.
// "name" — MDX component name (e.g. "Note", "Accordion").
// "selector" — CSS selector matching the root element of this component.
// "props" — key/value map of MDX props to extract from child elements or attributes.
// "content" — CSS selector for the inner content to place inside the component.
// "group" — optional wrapper component for repeated siblings (e.g. AccordionGroup).
"components": [
{
"name": "Note",
"selector": ".admonition.note",
"props": {
"title": {
"selector": ".admonition-title",
"child": true
}
},
"content": ".admonition-body"
},
{
"name": "Warning",
"selector": ".admonition.warning",
"props": {
"title": {
"selector": ".admonition-title",
"child": true
}
},
"content": ".admonition-body"
},
{
"name": "Accordion",
"selector": ".faq-item",
"group": {
"selector": ".faq-group",
"wrapper": "AccordionGroup"
},
"props": {
"title": ".faq-question"
},
"content": ".faq-answer"
},
{
"name": "Card",
"selector": "a.card",
"group": {
"wrapper": "CardGroup"
},
"props": {
"title": ".card-title",
"icon": {
"attr": "data-icon"
},
"href": {
"attr": "href"
}
},
"content": ".card-body"
},
{
"name": "Tab",
"selector": ".tab-panel",
"group": {
"selector": ".tabs",
"wrapper": "Tabs"
},
"props": {
"title": {
"attr": "data-title"
}
}
}
],
// ── Code block detection ──────────────────────────────────────────────────
"codeblock": {
// CSS class prefixes used to detect the language of a code block.
// Matches the first class on <code> or <pre> that starts with one of these.
"language_class_patterns": ["language-", "lang-", "highlight-"]
},
// ── Custom scripts ────────────────────────────────────────────────────────
"scripts": {
// Path (or array of paths) to pre-process script(s). Runs before Turndown with a live Cheerio DOM.
"pre": null,
// Path (or array of paths) to post-process script(s). Runs on the final markdown string.
"post": null
},
// ── Playwright options ────────────────────────────────────────────────────
"playwright_config": {
// Run Chromium without a visible window. Set false for debugging.
"headless": true,
// Stealth patches to bypass Cloudflare and similar bot-detection systems.
"stealth": true,
// Wait for this CSS selector before capturing the page. Preferred over wait_time.
"wait_for_selector": null,
// Seconds to wait after page load when wait_for_selector is null.
"wait_time": 3,
// Max seconds to wait before timing out.
"page_load_timeout": 30,
// Path to a session file saved by "wc session". Injects cookies into Playwright or native fetch.
"storage_state": null
},
// ── API mode ──────────────────────────────────────────────────────────────
"api": {
// Dot-notation path to the HTML body in the JSON response.
"content": "article.body",
// Dot-notation path to the page URL — used for the output file path and permalink frontmatter.
"filepath": "article.html_url",
// Dot-notation path to the page title.
"title": "article.title",
// Extra frontmatter fields — last path segment becomes the key.
"fm": ["article.created_at", "article.updated_at"],
// HTTP headers for every request (e.g. API auth tokens).
"headers": {}
}
},
// ── wc metadata ──────────────────────────────────────────────────────────────
"metadata": {
// Single MDX file to process. Mutually exclusive with dir.
"file": null,
// Directory of MDX files to process recursively. Mutually exclusive with file.
"dir": null,
// Number of pages to fetch metadata for in parallel.
"concurrency": 15,
// Meta tag names/properties to extract from each page.
"tags": [
"og:title",
"og:description",
"og:image",
"og:url",
"twitter:title",
"twitter:description",
"twitter:image"
],
// Preview without writing any files.
"dry-run": false,
// Suppress progress output.
"quiet": false
}
}