Skip to content

Commit

Permalink
chore(all): final output tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Nov 27, 2024
1 parent 5e95bba commit fbfd19b
Show file tree
Hide file tree
Showing 39 changed files with 100 additions and 261 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ Links using `{@link}` inline tags.

## Type Parameters

### T

\-
**T**

## Properties

Expand Down
4 changes: 1 addition & 3 deletions packages/docusaurus-plugin-typedoc/test/out/links/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ Links using `{@link}` inline tags.

#### Type Parameters

##### T

\-
**T**

#### Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ Links using \`{@link}\` inline tags.
#### Type Parameters
##### T
\\-
• **T**
#### Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,7 @@ export function declaration(
if (this.helpers.useTableFormat('parameters')) {
md.push(this.partials.typeParametersTable(model.typeParameters));
} else {
md.push(
this.partials.typeParametersList(model.typeParameters, {
headingLevel: options.headingLevel,
}),
);
md.push(this.partials.typeParametersList(model.typeParameters));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ export function memberWithGroups(
if (this.helpers.useTableFormat('parameters')) {
md.push(this.partials.typeParametersTable(model.typeParameters));
} else {
md.push(
this.partials.typeParametersList(model.typeParameters, {
headingLevel: options.headingLevel,
}),
);
md.push(this.partials.typeParametersList(model.typeParameters));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,7 @@ export function signature(
if (this.helpers.useTableFormat('parameters')) {
md.push(this.partials.typeParametersTable(model.typeParameters));
} else {
md.push(
this.partials.typeParametersList(model.typeParameters, {
headingLevel: options.headingLevel,
}),
);
md.push(this.partials.typeParametersList(model.typeParameters));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
import { heading, italic } from '@plugin/libs/markdown/index.js';
import { bold, italic } from '@plugin/libs/markdown/index.js';
import { MarkdownThemeContext } from '@plugin/theme/index.js';
import { TypeParameterReflection } from 'typedoc';

export function typeParametersList(
this: MarkdownThemeContext,
model: TypeParameterReflection[],
options: { headingLevel: number },
): string {
const rows: string[] = [];
model?.forEach((typeParameter) => {
const row: string[] = [];

row.push(heading(options.headingLevel + 1, typeParameter.name));

const nameCol: string[] = [];
const nameCol: string[] = [bold(typeParameter.name)];

if (typeParameter.type) {
nameCol.push(
`${italic('extends')}: ${this.partials.someType(typeParameter.type)}`,
`${italic('extends')} ${this.partials.someType(typeParameter.type)}`,
);
}

if (typeParameter.default) {
nameCol.push(
`${this.i18n.theme_default_type()} ${this.partials.someType(typeParameter.default)}`,
`= ${this.partials.someType(typeParameter.default, { forceCollapse: true })}`,
);
}

row.push(nameCol.join(''));
row.push('• ' + nameCol.join(' '));

if (typeParameter.comment) {
row.push(this.partials.comment(typeParameter.comment));
} else {
if (nameCol.join('').length === 0) {
row.push('\\-');
}
}

rows.push(row.join('\n\n'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,8 @@ There is no association list partial for properties as these are handled as a st
options: { kind?: ReflectionKind | undefined },
) =>
partials.typeDeclarationTable.apply(context, [model, options]) as string,
typeParametersList: (
model: TypeParameterReflection[],
options: { headingLevel: number },
) => partials.typeParametersList.apply(context, [model, options]) as string,
typeParametersList: (model: TypeParameterReflection[]) =>
partials.typeParametersList.apply(context, [model]) as string,
typeParametersTable: (model: TypeParameterReflection[]) =>
partials.typeParametersTable.apply(context, [model]) as string,
breadcrumbs: () => partials.breadcrumbs.apply(context, []) as string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

## Type Parameters

### P
**P** = [`DisposableClass`](DisposableClass.md)

Default type [`DisposableClass`](DisposableClass.md)

### A

Default type [`ClassWithModifiers`](ClassWithModifiers.md)
**A** = [`ClassWithModifiers`](ClassWithModifiers.md)

## Constructors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ Comments for ClassWithTypeParameters

## Type Parameters

### A
**A**

\-

### B

*extends*: `string`
**B** *extends* `string`

Comments for param B

### C

Default type `boolean`
**C** = `boolean`

Comments for param C

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ Comments for current function 1

#### Type Parameters

##### Value

\-
**Value**

#### Parameters

Expand All @@ -42,9 +40,7 @@ Comments for iterable arg
### Type Parameters

#### Value

\-
**Value**

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ Comments for function

### Type Parameters

#### T

\-
**T**

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ Function with type parameters

## Type Parameters

### T
**T**

Comments for T

### Item

Default type `string` \| `boolean`
**Item** = `string` \| `boolean`

## Returns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## Type Parameters

### T

\-
**T**

## Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ And some more comments

## Type Parameters

### A
**A**

This is a parameter.

### B
**B**

Comments for a parameter.
This sentence is on a soft new line.

### C
**C**

This is a parameter.

Documentation with a double line

### D
**D**

<p>These are comments with paras</p>
<p>These are comments with paras</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ Comments for InterfaceWithTypeParameters

## Type Parameters

### A

\-
**A**

## Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ Comments for ConditionalType

## Type Parameters

### T

\-
**T**
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ Comments for PartialMappedType

## Type Parameters

### T

\-
**T**
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ Comments for ReadonlyMapedType

## Type Parameters

### T

\-
**T**
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ Comments for object with special characters

## Type Parameters

### T
**T**

\-

### U

\-
**U**

## Type declaration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ Comments for TypeWithTypeParams

## Type Parameters

### T
**T**

\-

### R

\-
**R**
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

## Type Parameters

### P
**P** = [`DisposableClass`](DisposableClass.md)

Default type [`DisposableClass`](DisposableClass.md)

### A

Default type [`ClassWithModifiers`](ClassWithModifiers.md)
**A** = [`ClassWithModifiers`](ClassWithModifiers.md)

## Constructors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ Comments for ClassWithTypeParameters

## Type Parameters

### A
**A**

\-

### B

*extends*: `string`
**B** *extends* `string`

Comments for param B

### C

Default type `boolean`
**C** = `boolean`

Comments for param C

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ Comments for current function 1

#### Type Parameters

##### Value

\-
**Value**

#### Parameters

Expand All @@ -46,9 +44,7 @@ Comments for iterable arg
### Type Parameters

#### Value

\-
**Value**

### Parameters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ Comments for function

### Type Parameters

#### T

\-
**T**

### Parameters

Expand Down
Loading

0 comments on commit fbfd19b

Please sign in to comment.