0
# Configuration Options
1
2
Comprehensive configuration system with extensive options for customizing markdown output, file organization, formatting, and behavior of the TypeDoc Plugin Markdown.
3
4
## Capabilities
5
6
### PluginOptions Interface
7
8
Complete interface defining all available plugin configuration options with their types and purposes.
9
10
```typescript { .api }
11
/**
12
* Describes the options declared by the plugin for customizing markdown output.
13
* All configuration options available for the TypeDoc Plugin Markdown.
14
*/
15
interface PluginOptions {
16
/** Custom anchor prefix to add to anchor links */
17
anchorPrefix?: string;
18
19
/** Specifies comment block tags that should preserve their position */
20
blockTagsPreserveOrder?: string[];
21
22
/** Sets the format of property groups for classes */
23
classPropertiesFormat?: 'list' | 'table' | 'htmlTable';
24
25
/** The format of custom anchors */
26
customAnchorsFormat?: 'curlyBrace' | 'escapedCurlyBrace' | 'squareBracket';
27
28
/** The file name of the entry page */
29
entryFileName?: string;
30
31
/** @deprecated This functionality has been deprecated in favour of the @mergeModuleWith tag */
32
entryModule?: string;
33
34
/** Sets the format of enumeration members */
35
enumMembersFormat?: 'list' | 'table' | 'htmlTable';
36
37
/** @deprecated This option has been renamed hideGroupHeadings to better reflect its purpose */
38
excludeGroups?: boolean;
39
40
/** Exclude writing @ scope directories in paths */
41
excludeScopesInPaths?: boolean;
42
43
/** Expand objects inside declarations */
44
expandObjects?: boolean;
45
46
/** Expand parameters in signature parentheses to display type information */
47
expandParameters?: boolean;
48
49
/** Specify the file extension for generated output files */
50
fileExtension?: string;
51
52
/** Flatten output files to a single directory */
53
flattenOutputFiles?: boolean;
54
55
/** Apply additional output formatting with Prettier */
56
formatWithPrettier?: boolean;
57
58
/** Do not print breadcrumbs */
59
hideBreadcrumbs?: boolean;
60
61
/** Excludes grouping by kind so all members are rendered at the same level */
62
hideGroupHeadings?: boolean;
63
64
/** Do not print page header */
65
hidePageHeader?: boolean;
66
67
/** Do not print page title */
68
hidePageTitle?: boolean;
69
70
/** Sets the format of index items */
71
indexFormat?: 'list' | 'table' | 'htmlTable';
72
73
/** Sets the format of property groups for interfaces */
74
interfacePropertiesFormat?: 'list' | 'table' | 'htmlTable';
75
76
/** Determines which members are exported to their own file */
77
membersWithOwnFile?: (
78
| 'Enum'
79
| 'Variable'
80
| 'Function'
81
| 'Class'
82
| 'Interface'
83
| 'TypeAlias'
84
)[];
85
86
/** Appends the documentation index page to the readme page */
87
mergeReadme?: boolean;
88
89
/** The file name of the separate modules / index page */
90
modulesFileName?: string;
91
92
/** @deprecated This option has been deprecated in favour of TypeDoc `navigation` option */
93
navigationModel?: {
94
excludeGroups?: boolean;
95
excludeCategories?: boolean;
96
excludeFolders?: boolean;
97
};
98
99
/** @deprecated Deprecated in favour of `--router` */
100
outputFileStrategy?: 'members' | 'modules';
101
102
/** Configure page title output with placeholders */
103
pageTitleTemplates?: {
104
index?:
105
| string
106
| ((name: { projectName: string; version: string }) => string);
107
member?:
108
| string
109
| ((name: {
110
name: string;
111
rawName: string;
112
kind: string;
113
isDeprecated: boolean;
114
group?: string;
115
codeKeyword?: string;
116
keyword?: string;
117
}) => string);
118
module?:
119
| string
120
| ((name: {
121
name: string;
122
rawName: string;
123
kind: string;
124
isDeprecated: boolean;
125
}) => string);
126
};
127
128
/** Sets the format of parameter and type parameter groups */
129
parametersFormat?: 'list' | 'table' | 'htmlTable';
130
131
/** Preserve anchor casing when generating link to symbols */
132
preserveAnchorCasing?: boolean;
133
134
/** Specify a custom Prettier configuration file location */
135
prettierConfigFile?: string;
136
137
/** @deprecated This option has been deprecated in favour of `--interfacePropertiesFormat` and `--classPropertiesFormat` */
138
propertiesFormat?: 'list' | 'table' | 'htmlTable';
139
140
/** Sets the format of style for property members for interfaces and classes */
141
propertyMembersFormat?: 'list' | 'table' | 'htmlTable';
142
143
/** Specify the base path for all urls */
144
publicPath?: string;
145
146
/** Sanitize HTML and JSX inside JsDoc comments */
147
sanitizeComments?: boolean;
148
149
/** Controls whether deprecated symbols have their page titles rendered with a strikethrough */
150
strikeDeprecatedPageTitles?: boolean;
151
152
/** Control how table columns are configured and displayed */
153
tableColumnSettings?: {
154
hideDefaults?: boolean;
155
hideInherited?: boolean;
156
hideModifiers?: boolean;
157
hideOverrides?: boolean;
158
hideSources?: boolean;
159
hideValues?: boolean;
160
leftAlignHeaders?: boolean;
161
};
162
163
/** @deprecated This option has been deprecated in favour of `--pageTitleTemplates` */
164
textContentMappings?: Record<string, any>;
165
166
/** Sets the format of style for type alias properties */
167
typeAliasPropertiesFormat?: 'list' | 'table' | 'htmlTable';
168
169
/** Sets the format of style for type declaration members */
170
typeDeclarationFormat?: 'list' | 'table' | 'htmlTable';
171
172
/** Set the visibility level for type declaration documentation */
173
typeDeclarationVisibility?: 'compact' | 'verbose';
174
175
/** Wraps signatures and declarations in code blocks */
176
useCodeBlocks?: boolean;
177
178
/** Add custom anchors like `{#custom-id}` to headings */
179
useCustomAnchors?: boolean;
180
181
/** Add HTML anchors to page headings */
182
useHTMLAnchors?: boolean;
183
184
/** Use HTML encoded entities for angle brackets */
185
useHTMLEncodedBrackets?: boolean;
186
}
187
```
188
189
## Configuration Categories
190
191
### File Organization Options
192
193
Options controlling how documentation files are structured and named.
194
195
```typescript { .api }
196
// File naming and organization
197
fileExtension?: string; // Default: '.md'
198
entryFileName?: string; // Default: 'README'
199
modulesFileName?: string; // Default: 'modules'
200
flattenOutputFiles?: boolean; // Default: false
201
outputFileStrategy?: 'members' | 'modules'; // Default: 'modules' (deprecated)
202
203
// Members with individual files
204
membersWithOwnFile?: Array<'Enum' | 'Variable' | 'Function' | 'Class' | 'Interface' | 'TypeAlias'>;
205
```
206
207
**Usage Example:**
208
209
```typescript
210
// TypeDoc configuration
211
{
212
"plugin": ["typedoc-plugin-markdown"],
213
"markdown": "./docs",
214
"fileExtension": ".md",
215
"entryFileName": "index",
216
"flattenOutputFiles": false,
217
"membersWithOwnFile": ["Class", "Interface", "Enum", "Function"]
218
}
219
```
220
221
### Display and Formatting Options
222
223
Options controlling how content is displayed and formatted in the generated markdown.
224
225
```typescript { .api }
226
// Page structure
227
hidePageHeader?: boolean; // Default: false
228
hidePageTitle?: boolean; // Default: false
229
hideBreadcrumbs?: boolean; // Default: false
230
hideGroupHeadings?: boolean; // Default: false
231
232
// Content formatting
233
useCodeBlocks?: boolean; // Default: false
234
useHTMLAnchors?: boolean; // Default: false
235
useCustomAnchors?: boolean; // Default: false
236
sanitizeComments?: boolean; // Default: true
237
expandObjects?: boolean; // Default: false
238
expandParameters?: boolean; // Default: false
239
240
// Table formatting
241
indexFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
242
interfacePropertiesFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
243
classPropertiesFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
244
enumMembersFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
245
parametersFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
246
propertyMembersFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
247
typeAliasPropertiesFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
248
typeDeclarationFormat?: 'list' | 'table' | 'htmlTable'; // Default: 'list'
249
```
250
251
**Usage Example:**
252
253
```typescript
254
// Enhanced table formatting configuration
255
{
256
"useCodeBlocks": true,
257
"useHTMLAnchors": true,
258
"indexFormat": "table",
259
"interfacePropertiesFormat": "htmlTable",
260
"classPropertiesFormat": "table",
261
"parametersFormat": "table",
262
"tableColumnSettings": {
263
"hideDefaults": false,
264
"hideInherited": true,
265
"leftAlignHeaders": true
266
}
267
}
268
```
269
270
### Table Column Configuration
271
272
Detailed control over table column visibility and formatting.
273
274
```typescript { .api }
275
tableColumnSettings?: {
276
/** Hide default values column */
277
hideDefaults?: boolean; // Default: false
278
279
/** Hide inherited members column */
280
hideInherited?: boolean; // Default: false
281
282
/** Hide modifiers column (public, private, etc.) */
283
hideModifiers?: boolean; // Default: false
284
285
/** Hide overrides column */
286
hideOverrides?: boolean; // Default: false
287
288
/** Hide sources column */
289
hideSources?: boolean; // Default: false
290
291
/** Hide values column */
292
hideValues?: boolean; // Default: false
293
294
/** Left-align table headers */
295
leftAlignHeaders?: boolean; // Default: false
296
};
297
```
298
299
### Navigation and Linking Options
300
301
Options for controlling navigation and internal linking.
302
303
```typescript { .api }
304
// Linking and anchors
305
anchorPrefix?: string; // Default: ''
306
publicPath?: string; // Default: ''
307
preserveAnchorCasing?: boolean; // Default: false
308
customAnchorsFormat?: 'curlyBrace' | 'escapedCurlyBrace' | 'squareBracket'; // Default: 'curlyBrace'
309
310
// Path handling
311
excludeScopesInPaths?: boolean; // Default: false
312
```
313
314
### Page Title Customization
315
316
Templates for customizing page titles across different reflection types.
317
318
```typescript { .api }
319
pageTitleTemplates?: {
320
/** Template for index page title */
321
index?: string | ((name: { projectName: string; version: string }) => string);
322
323
/** Template for member page titles */
324
member?: string | ((name: {
325
name: string;
326
rawName: string;
327
kind: string;
328
isDeprecated: boolean;
329
group?: string;
330
codeKeyword?: string;
331
keyword?: string;
332
}) => string);
333
334
/** Template for module page titles */
335
module?: string | ((name: {
336
name: string;
337
rawName: string;
338
kind: string;
339
isDeprecated: boolean;
340
}) => string);
341
};
342
```
343
344
**Usage Example:**
345
346
```typescript
347
{
348
"pageTitleTemplates": {
349
"index": "{projectName} v{version} Documentation",
350
"member": "{kind}: {name}",
351
"module": "Module: {name}"
352
}
353
}
354
```
355
356
### Advanced Configuration
357
358
Advanced options for specialized use cases and customization.
359
360
```typescript { .api }
361
// Content processing
362
blockTagsPreserveOrder?: string[]; // Preserve order for these block tags
363
364
// Formatting with Prettier
365
formatWithPrettier?: boolean; // Default: false
366
prettierConfigFile?: string; // Path to Prettier config
367
368
// Deprecated options (included for backward compatibility)
369
excludeGroups?: boolean; // @deprecated Use hideGroupHeadings
370
propertiesFormat?: 'list' | 'table' | 'htmlTable'; // @deprecated Use specific format options
371
textContentMappings?: Record<string, any>; // @deprecated Use pageTitleTemplates
372
entryModule?: string; // @deprecated Use @mergeModuleWith tag
373
outputFileStrategy?: 'members' | 'modules'; // @deprecated Use --router
374
navigationModel?: { // @deprecated Use TypeDoc navigation option
375
excludeGroups?: boolean;
376
excludeCategories?: boolean;
377
excludeFolders?: boolean;
378
};
379
```
380
381
**Complete Configuration Example:**
382
383
```typescript
384
// typedoc.json - Comprehensive configuration
385
{
386
"plugin": ["typedoc-plugin-markdown"],
387
"markdown": "./docs",
388
389
// File organization
390
"fileExtension": ".md",
391
"entryFileName": "index",
392
"modulesFileName": "modules",
393
"flattenOutputFiles": false,
394
395
// Display options
396
"hidePageHeader": false,
397
"hidePageTitle": false,
398
"hideBreadcrumbs": false,
399
"useCodeBlocks": true,
400
"useHTMLAnchors": true,
401
402
// Table formatting
403
"indexFormat": "table",
404
"interfacePropertiesFormat": "htmlTable",
405
"classPropertiesFormat": "table",
406
"parametersFormat": "table",
407
"tableColumnSettings": {
408
"hideDefaults": false,
409
"hideInherited": true,
410
"leftAlignHeaders": true
411
},
412
413
// Page titles
414
"pageTitleTemplates": {
415
"index": "{projectName} Documentation",
416
"member": "{kind}: {name}",
417
"module": "Module: {name}"
418
},
419
420
// Content options
421
"sanitizeComments": true,
422
"expandObjects": false,
423
"membersWithOwnFile": ["Class", "Interface", "Enum"],
424
425
// Advanced options
426
"formatWithPrettier": false,
427
"useCustomAnchors": false,
428
"preserveAnchorCasing": false
429
}
430
```