Skip to content

Commit 7ed2aaa

Browse files
committed
fix(core): allow htmlTable format key for indexes (#618)
1 parent d11c690 commit 7ed2aaa

File tree

5 files changed

+22
-30
lines changed

5 files changed

+22
-30
lines changed

docs/pages/docs/options/display-options.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ This option should be set when a full type representation is preferred.
115115

116116
<Callout emoji="💡">Sets the format of index items.</Callout>
117117

118-
> Accepts either `"list"` or `"table"`. Defaults to `"list"`.
118+
> Accepts one of `"list"` | `"table"` | `"htmlTable"`. Defaults to `"list"`.
119119
120120
This option renders index items either as a simple unordered list or in a table.
121121

packages/typedoc-plugin-markdown/src/_typedoc.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ declare module 'typedoc' {
1717
hideGroupHeadings: boolean;
1818
hidePageHeader: boolean;
1919
hidePageTitle: boolean;
20-
indexFormat: 'list' | 'table';
20+
indexFormat: 'list' | 'table' | 'htmlTable';
2121
interfacePropertiesFormat: 'list' | 'table' | 'htmlTable';
2222
membersWithOwnFile: (
2323
| 'Enum'

packages/typedoc-plugin-markdown/src/options/declarations.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
import { DeclarationOption, ParameterType } from 'typedoc';
2323
import { ALLOWED_OWN_FILE_MEMBERS, TEXT_CONTENT_MAPPINGS } from './constants';
24-
import { IndexFormat, OutputFileStrategy, ReflectionFormat } from './maps';
24+
import { DisplayFormat, OutputFileStrategy } from './maps';
2525

2626
/**
2727
* TypeDoc creates documentation according to exports derived from the given [`entryPointsStrategy`](https://typedoc.org/options/input/#entrypointstrategy) configuration.
@@ -350,8 +350,8 @@ export const expandParameters: Partial<DeclarationOption> = {
350350
export const indexFormat: Partial<DeclarationOption> = {
351351
help: 'Sets the format of index items.',
352352
type: ParameterType.Map,
353-
map: IndexFormat,
354-
defaultValue: IndexFormat.List,
353+
map: DisplayFormat,
354+
defaultValue: DisplayFormat.List,
355355
};
356356

357357
/**
@@ -366,8 +366,8 @@ export const indexFormat: Partial<DeclarationOption> = {
366366
export const parametersFormat: Partial<DeclarationOption> = {
367367
help: 'Sets the format of parameter and type parameter groups.',
368368
type: ParameterType.Map,
369-
map: ReflectionFormat,
370-
defaultValue: ReflectionFormat.List,
369+
map: DisplayFormat,
370+
defaultValue: DisplayFormat.List,
371371
};
372372

373373
/**
@@ -382,8 +382,8 @@ export const parametersFormat: Partial<DeclarationOption> = {
382382
export const interfacePropertiesFormat: Partial<DeclarationOption> = {
383383
help: 'Sets the format of property groups for interfaces.',
384384
type: ParameterType.Map,
385-
map: ReflectionFormat,
386-
defaultValue: ReflectionFormat.List,
385+
map: DisplayFormat,
386+
defaultValue: DisplayFormat.List,
387387
};
388388

389389
/**
@@ -398,8 +398,8 @@ export const interfacePropertiesFormat: Partial<DeclarationOption> = {
398398
export const classPropertiesFormat: Partial<DeclarationOption> = {
399399
help: 'Sets the format of property groups for classes.',
400400
type: ParameterType.Map,
401-
map: ReflectionFormat,
402-
defaultValue: ReflectionFormat.List,
401+
map: DisplayFormat,
402+
defaultValue: DisplayFormat.List,
403403
};
404404

405405
/**
@@ -414,8 +414,8 @@ export const classPropertiesFormat: Partial<DeclarationOption> = {
414414
export const enumMembersFormat: Partial<DeclarationOption> = {
415415
help: 'Sets the format of enumeration members.',
416416
type: ParameterType.Map,
417-
map: ReflectionFormat,
418-
defaultValue: ReflectionFormat.List,
417+
map: DisplayFormat,
418+
defaultValue: DisplayFormat.List,
419419
};
420420

421421
/**
@@ -430,8 +430,8 @@ export const enumMembersFormat: Partial<DeclarationOption> = {
430430
export const typeDeclarationFormat: Partial<DeclarationOption> = {
431431
help: 'Sets the format of style for type declaration members.',
432432
type: ParameterType.Map,
433-
map: ReflectionFormat,
434-
defaultValue: ReflectionFormat.List,
433+
map: DisplayFormat,
434+
defaultValue: DisplayFormat.List,
435435
};
436436

437437
/**
@@ -448,8 +448,8 @@ export const typeDeclarationFormat: Partial<DeclarationOption> = {
448448
export const propertyMembersFormat: Partial<DeclarationOption> = {
449449
help: 'Sets the format of style for property members for interfaces and classes.',
450450
type: ParameterType.Map,
451-
map: ReflectionFormat,
452-
defaultValue: ReflectionFormat.List,
451+
map: DisplayFormat,
452+
defaultValue: DisplayFormat.List,
453453
};
454454

455455
/**
@@ -462,8 +462,8 @@ export const propertyMembersFormat: Partial<DeclarationOption> = {
462462
export const propertiesFormat: Partial<DeclarationOption> = {
463463
help: 'Sets the format of property groups for interfaces and classes.',
464464
type: ParameterType.Map,
465-
map: ReflectionFormat,
466-
defaultValue: ReflectionFormat.List,
465+
map: DisplayFormat,
466+
defaultValue: DisplayFormat.List,
467467
};
468468

469469
/**

packages/typedoc-plugin-markdown/src/options/maps.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,10 @@ export enum OutputFileStrategy {
1313
}
1414

1515
/**
16-
* The allowed values for formatting reflections.
16+
* The allowed values for formatting reflections and indexes.
1717
*/
18-
export enum ReflectionFormat {
18+
export enum DisplayFormat {
1919
List = 'list',
2020
Table = 'table',
2121
HtmlTable = 'htmlTable',
2222
}
23-
24-
/**
25-
* The allowed values for formatting indexes.
26-
*/
27-
export enum IndexFormat {
28-
List = 'list',
29-
Table = 'table',
30-
}

packages/typedoc-plugin-markdown/src/types/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export interface PluginOptions {
8383
/**
8484
* Sets the format of index items.
8585
*/
86-
indexFormat: 'list' | 'table';
86+
indexFormat: 'list' | 'table' | 'htmlTable';
8787

8888
/**
8989
* Sets the format of property groups for interfaces.

0 commit comments

Comments
 (0)