Skip to content

Commit

Permalink
fix(core): allow htmlTable format key for indexes (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Jun 22, 2024
1 parent 3a5640d commit aff7c1a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/pages/docs/options/display-options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ This option should be set when a full type representation is preferred.

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

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

Expand Down
2 changes: 1 addition & 1 deletion packages/typedoc-plugin-markdown/src/_typedoc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare module 'typedoc' {
hideGroupHeadings: boolean;
hidePageHeader: boolean;
hidePageTitle: boolean;
indexFormat: 'list' | 'table';
indexFormat: 'list' | 'table' | 'htmlTable';
interfacePropertiesFormat: 'list' | 'table' | 'htmlTable';
membersWithOwnFile: (
| 'Enum'
Expand Down
34 changes: 17 additions & 17 deletions packages/typedoc-plugin-markdown/src/options/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
import { DeclarationOption, ParameterType } from 'typedoc';
import { ALLOWED_OWN_FILE_MEMBERS, TEXT_CONTENT_MAPPINGS } from './constants';
import { IndexFormat, OutputFileStrategy, ReflectionFormat } from './maps';
import { DisplayFormat, OutputFileStrategy } from './maps';

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

/**
Expand All @@ -320,8 +320,8 @@ export const indexFormat: Partial<DeclarationOption> = {
export const parametersFormat: Partial<DeclarationOption> = {
help: 'Sets the format of parameter and type parameter groups.',
type: ParameterType.Map,
map: ReflectionFormat,
defaultValue: ReflectionFormat.List,
map: DisplayFormat,
defaultValue: DisplayFormat.List,
};

/**
Expand All @@ -336,8 +336,8 @@ export const parametersFormat: Partial<DeclarationOption> = {
export const interfacePropertiesFormat: Partial<DeclarationOption> = {
help: 'Sets the format of property groups for interfaces.',
type: ParameterType.Map,
map: ReflectionFormat,
defaultValue: ReflectionFormat.List,
map: DisplayFormat,
defaultValue: DisplayFormat.List,
};

/**
Expand All @@ -352,8 +352,8 @@ export const interfacePropertiesFormat: Partial<DeclarationOption> = {
export const classPropertiesFormat: Partial<DeclarationOption> = {
help: 'Sets the format of property groups for classes.',
type: ParameterType.Map,
map: ReflectionFormat,
defaultValue: ReflectionFormat.List,
map: DisplayFormat,
defaultValue: DisplayFormat.List,
};

/**
Expand All @@ -368,8 +368,8 @@ export const classPropertiesFormat: Partial<DeclarationOption> = {
export const enumMembersFormat: Partial<DeclarationOption> = {
help: 'Sets the format of enumeration members.',
type: ParameterType.Map,
map: ReflectionFormat,
defaultValue: ReflectionFormat.List,
map: DisplayFormat,
defaultValue: DisplayFormat.List,
};

/**
Expand All @@ -384,8 +384,8 @@ export const enumMembersFormat: Partial<DeclarationOption> = {
export const typeDeclarationFormat: Partial<DeclarationOption> = {
help: 'Sets the format of style for type declaration members.',
type: ParameterType.Map,
map: ReflectionFormat,
defaultValue: ReflectionFormat.List,
map: DisplayFormat,
defaultValue: DisplayFormat.List,
};

/**
Expand All @@ -402,8 +402,8 @@ export const typeDeclarationFormat: Partial<DeclarationOption> = {
export const propertyMembersFormat: Partial<DeclarationOption> = {
help: 'Sets the format of style for property members for interfaces and classes.',
type: ParameterType.Map,
map: ReflectionFormat,
defaultValue: ReflectionFormat.List,
map: DisplayFormat,
defaultValue: DisplayFormat.List,
};

/**
Expand All @@ -416,8 +416,8 @@ export const propertyMembersFormat: Partial<DeclarationOption> = {
export const propertiesFormat: Partial<DeclarationOption> = {
help: 'Sets the format of property groups for interfaces and classes.',
type: ParameterType.Map,
map: ReflectionFormat,
defaultValue: ReflectionFormat.List,
map: DisplayFormat,
defaultValue: DisplayFormat.List,
};

/**
Expand Down
12 changes: 2 additions & 10 deletions packages/typedoc-plugin-markdown/src/options/maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,10 @@ export enum OutputFileStrategy {
}

/**
* The allowed values for formatting reflections.
* The allowed values for formatting reflections and indexes.
*/
export enum ReflectionFormat {
export enum DisplayFormat {
List = 'list',
Table = 'table',
HtmlTable = 'htmlTable',
}

/**
* The allowed values for formatting indexes.
*/
export enum IndexFormat {
List = 'list',
Table = 'table',
}
2 changes: 1 addition & 1 deletion packages/typedoc-plugin-markdown/src/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export interface PluginOptions {
/**
* Sets the format of index items.
*/
indexFormat: 'list' | 'table';
indexFormat: 'list' | 'table' | 'htmlTable';

/**
* Sets the format of property groups for interfaces.
Expand Down

0 comments on commit aff7c1a

Please sign in to comment.