|
1 |
| -import { bold, italic } from '@plugin/libs/markdown/index.js'; |
| 1 | +import { heading, italic } from '@plugin/libs/markdown/index.js'; |
2 | 2 | import { MarkdownThemeContext } from '@plugin/theme/index.js';
|
3 | 3 | import { TypeParameterReflection } from 'typedoc';
|
4 | 4 |
|
5 | 5 | export function typeParametersList(
|
6 | 6 | this: MarkdownThemeContext,
|
7 | 7 | model: TypeParameterReflection[],
|
| 8 | + options: { headingLevel: number }, |
8 | 9 | ): string {
|
9 | 10 | const rows: string[] = [];
|
10 | 11 | model?.forEach((typeParameter) => {
|
11 | 12 | const row: string[] = [];
|
12 | 13 |
|
13 |
| - const nameCol: string[] = [bold(typeParameter.name)]; |
| 14 | + row.push(heading(options.headingLevel + 1, typeParameter.name)); |
| 15 | + |
| 16 | + const nameCol: string[] = []; |
14 | 17 |
|
15 | 18 | if (typeParameter.type) {
|
16 | 19 | nameCol.push(
|
17 |
| - `${italic('extends')} ${this.partials.someType(typeParameter.type)}`, |
| 20 | + `${italic('extends')}: ${this.partials.someType(typeParameter.type)}`, |
18 | 21 | );
|
19 | 22 | }
|
20 | 23 |
|
21 | 24 | if (typeParameter.default) {
|
22 |
| - nameCol.push(`= ${this.partials.someType(typeParameter.default)}`); |
| 25 | + nameCol.push( |
| 26 | + `${this.i18n.theme_default_type()} ${this.partials.someType(typeParameter.default)}`, |
| 27 | + ); |
23 | 28 | }
|
24 | 29 |
|
25 |
| - row.push('• ' + nameCol.join(' ')); |
| 30 | + row.push(nameCol.join('')); |
26 | 31 |
|
27 | 32 | if (typeParameter.comment) {
|
28 | 33 | row.push(this.partials.comment(typeParameter.comment));
|
| 34 | + } else { |
| 35 | + if (nameCol.join('').length === 0) { |
| 36 | + row.push('\\-'); |
| 37 | + } |
29 | 38 | }
|
30 | 39 |
|
31 | 40 | rows.push(row.join('\n\n'));
|
|
0 commit comments