Skip to content

Commit 9c8781c

Browse files
committed
adds tables and doxygen datatype def
1 parent 2ce0b4f commit 9c8781c

22 files changed

+516
-125
lines changed

src/components/doxygen-datatype-def/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ ng_ts_project(
2121
deps = [
2222
"//src/components/doxygen-child-block",
2323
"//src/components/doxygen-function-def",
24+
"//src/components/doxygen-functions-table",
2425
"//src/components/doxygen-member-components/doxygen-description",
2526
"//src/components/doxygen-member-components/doxygen-location",
2627
"//src/components/doxygen-member-components/doxygen-name",
2728
"//src/components/doxygen-parent-block",
2829
"//src/components/doxygen-refid-link",
30+
"//src/components/doxygen-type-name",
2931
"//src/components/doxygen-typedef-def",
32+
"//src/components/doxygen-types-table",
3033
"//src/components/doxygen-variable-def",
34+
"//src/components/doxygen-variables-table",
3135
"//src/search:doxygen-def-types",
3236
"@npm//@angular/common",
3337
"@npm//@angular/core",

src/components/doxygen-datatype-def/doxygen-datatype-def.component.html

Lines changed: 7 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -11,107 +11,11 @@ <h1>{{ def.name }}</h1>
1111
[description]="def.detailedDescription"></doxygen-description>
1212
</div>
1313

14-
<div *ngIf="def.publicFunctions.length > 0">
15-
<h2 id="public-functions">Public Functions</h2>
16-
<div class="functions" *ngFor="let function of def.publicFunctions">
17-
<doxygen-child-block>
18-
<doxygen-name
19-
[access]="function.access"
20-
[const]="function.const"
21-
[inline]="function.inline"
22-
[virtual]="function.virtual"
23-
[explicit]="function.explicit">
24-
<div *ngIf="function.id; else noID">
25-
<a [doxygenRefidLink]="function.id"
26-
><h3>{{ function.name }}</h3></a
27-
>
28-
</div>
29-
<ng-template #noID
30-
><h3>{{ function.name }}</h3></ng-template
31-
>
32-
</doxygen-name>
33-
<doxygen-function-def [def]="function"></doxygen-function-def>
34-
</doxygen-child-block>
35-
</div>
36-
</div>
37-
38-
<div *ngIf="def.privateFunctions.length > 0">
39-
<h2 id="private-functions">Private Functions</h2>
40-
<div class="functions" *ngFor="let function of def.privateFunctions">
41-
<doxygen-child-block>
42-
<doxygen-name
43-
[access]="function.access"
44-
[const]="function.const"
45-
[inline]="function.inline"
46-
[virtual]="function.virtual"
47-
[explicit]="function.explicit">
48-
<a [doxygenRefidLink]="function.id"
49-
><h3>{{ function.name }}</h3></a
50-
></doxygen-name
51-
>
52-
<doxygen-function-def [def]="function"></doxygen-function-def>
53-
</doxygen-child-block>
54-
</div>
55-
</div>
56-
57-
<div *ngIf="def.publicTypes.length > 0">
58-
<h2 id="public-types">Public Types</h2>
59-
<div *ngFor="let type of def.publicTypes">
60-
<doxygen-child-block>
61-
<doxygen-name [static]="type.static" [access]="type.access">
62-
<a [doxygenRefidLink]="type.id"
63-
><h3>{{ type.name }}</h3></a
64-
>
65-
</doxygen-name>
66-
<doxygen-typedef-def [def]="type"></doxygen-typedef-def>
67-
</doxygen-child-block>
68-
</div>
69-
</div>
70-
71-
<div *ngIf="def.privateTypes.length > 0">
72-
<h2 id="private-types">Private Types</h2>
73-
<div *ngFor="let type of def.privateTypes">
74-
<doxygen-child-block>
75-
<doxygen-name [static]="type.static" [access]="type.access">
76-
<a [doxygenRefidLink]="type.id"
77-
><h3>{{ type.name }}</h3></a
78-
></doxygen-name
79-
>
80-
<doxygen-typedef-def [def]="type"></doxygen-typedef-def>
81-
</doxygen-child-block>
82-
</div>
83-
</div>
84-
<div *ngIf="def.publicVariables.length > 0">
85-
<h2 id="public-variables">Public Variables</h2>
86-
<div *ngFor="let variable of def.publicVariables">
87-
<doxygen-child-block>
88-
<doxygen-name
89-
[access]="variable.access"
90-
[mutable]="variable.mutable"
91-
[static]="variable.static">
92-
<a [doxygenRefidLink]="variable.id"
93-
><h3>{{ variable.name }}</h3></a
94-
></doxygen-name
95-
>
96-
<doxygen-variable-def [def]="variable"></doxygen-variable-def>
97-
</doxygen-child-block>
98-
</div>
99-
</div>
100-
101-
<div *ngIf="def.privateVariables.length > 0">
102-
<h2 id="private-variables">Private Variables</h2>
103-
<div *ngFor="let variable of def.privateVariables">
104-
<doxygen-child-block>
105-
<doxygen-name
106-
[access]="variable.access"
107-
[mutable]="variable.mutable"
108-
[static]="variable.static">
109-
<a [doxygenRefidLink]="variable.id"
110-
><h3>{{ variable.name }}</h3></a
111-
></doxygen-name
112-
>
113-
<doxygen-variable-def [def]="variable"></doxygen-variable-def
114-
></doxygen-child-block>
115-
</div>
116-
</div>
14+
<doxygen-types-table class="block my-8" [def]="def"></doxygen-types-table>
15+
<doxygen-variables-table
16+
class="block my-8"
17+
[def]="def"></doxygen-variables-table>
18+
<doxygen-functions-table
19+
class="block my-8"
20+
[def]="def"></doxygen-functions-table>
11721
</doxygen-parent-block>

src/components/doxygen-datatype-def/doxygen-datatype-def.module.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import {RouterModule} from '@angular/router';
1212

1313
import {DoxygenDataTypeDefComponent} from './doxygen-datatype-def.component';
1414
import {DoxygenRefidLinkModule} from '../doxygen-refid-link/doxygen-refid-link.module';
15+
import {DoxygenTypeNameModule} from '../doxygen-type-name/doxygen-type-name.module';
16+
import {DoxygenVariablesTableModule} from '../doxygen-variables-table/doxygen-variables-table.module';
17+
import {DoxygenFunctionsTableModule} from '../doxygen-functions-table/doxygen-functions-table.module';
18+
import {DoxygenTypesTableModule} from '../doxygen-types-table/doxygen-types-table.module';
1519

1620
@NgModule({
1721
declarations: [DoxygenDataTypeDefComponent],
@@ -27,6 +31,10 @@ import {DoxygenRefidLinkModule} from '../doxygen-refid-link/doxygen-refid-link.m
2731
DoxygenLocationModule,
2832
RouterModule,
2933
DoxygenRefidLinkModule,
34+
DoxygenTypeNameModule,
35+
DoxygenVariablesTableModule,
36+
DoxygenFunctionsTableModule,
37+
DoxygenTypesTableModule,
3038
],
3139
exports: [DoxygenDataTypeDefComponent],
3240
})

src/components/doxygen-function-def/doxygen-function-def.component.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<div *ngIf="def.detailedDescription.length > 0">
2-
<doxygen-description
3-
[description]="def.detailedDescription"></doxygen-description>
4-
</div>
5-
<table *ngIf="def.parameters.length > 0">
6-
<tr>
1+
<doxygen-description
2+
[description]="def.detailedDescription"></doxygen-description>
3+
4+
<table class="my-4">
5+
<tr *ngIf="def.parameters.length > 0">
76
<th><h2 id="parameters" class="text-base font-bold m-0">Parameters</h2></th>
87
<th class="w-full"></th>
98
</tr>
@@ -28,7 +27,7 @@
2827

2928
<tr>
3029
<th><h2 id="returns" class="text-base font-bold m-0">Returns</h2></th>
31-
<th></th>
30+
<th class="w-full"></th>
3231
</tr>
3332
<tr>
3433
<td class="text-right whitespace-nowrap align-top py-2">
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
load("//tools:angular_ts_project.bzl", "ng_ts_project")
2+
3+
package(default_visibility = ["//src:__subpackages__"])
4+
5+
ng_ts_project(
6+
name = "doxygen-functions-table",
7+
srcs = [
8+
"doxygen-functions-table.component.ts",
9+
"doxygen-functions-table.module.ts",
10+
],
11+
angular_assets = [
12+
"doxygen-functions-table.component.html",
13+
],
14+
deps = [
15+
"//src/components/doxygen-member-components/doxygen-description",
16+
"//src/components/doxygen-paragraph",
17+
"//src/components/doxygen-refid-link",
18+
"//src/components/doxygen-type-name",
19+
"//src/components/hidden-table-rows",
20+
"//src/search:doxygen-def-types",
21+
"@npm//@angular/common",
22+
"@npm//@angular/core",
23+
"@npm//@angular/router",
24+
],
25+
)
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<table hasHiddenRows>
2+
<tr *ngIf="def.publicStaticFunctions && def.publicStaticFunctions.length > 0">
3+
<th class="h-7 relative">
4+
<h2
5+
id="public-static-fns"
6+
class="absolute text-base font-bold m-0 left-2 top-1 bottom-0 whitespace-nowrap">
7+
Public Static Functions
8+
</h2>
9+
</th>
10+
<th class="w-full"></th>
11+
</tr>
12+
<tr
13+
*ngFor="let fn of def.publicStaticFunctions"
14+
class="odd:bg-black/5 dark:odd:bg-white/5">
15+
<td class="align-top text-right whitespace-nowrap py-2">
16+
<doxygen-type-name [def]="fn.return"></doxygen-type-name>
17+
</td>
18+
<td class="align-top py-2">
19+
<h3
20+
[id]="'public-static-fn--' + fn.name.toLowerCase()"
21+
class="block m-0 text-base font-normal">
22+
<a class="whitespace-nowrap" [doxygenRefidLink]="fn.id"
23+
><code>{{ fn.name }}</code></a
24+
>
25+
</h3>
26+
<doxygen-description
27+
class="block mt-2"
28+
[description]="fn.detailedDescription"></doxygen-description>
29+
</td>
30+
</tr>
31+
32+
<tr *ngIf="def.publicFunctions && def.publicFunctions.length > 0">
33+
<th class="h-7 relative">
34+
<h2
35+
id="public-fns"
36+
class="absolute text-base font-bold m-0 left-2 top-1 bottom-0 whitespace-nowrap">
37+
Public Functions
38+
</h2>
39+
</th>
40+
<th class="w-full"></th>
41+
</tr>
42+
<tr
43+
*ngFor="let fn of def.publicFunctions"
44+
class="odd:bg-black/5 dark:odd:bg-white/5">
45+
<td class="align-top text-right whitespace-nowrap py-2">
46+
<doxygen-type-name [def]="fn.return"></doxygen-type-name>
47+
</td>
48+
<td class="align-top py-2">
49+
<h3
50+
[id]="'public-fn--' + fn.name.toLowerCase()"
51+
class="block m-0 text-base font-normal">
52+
<a class="whitespace-nowrap" [doxygenRefidLink]="fn.id"
53+
><code>{{ fn.name }}</code></a
54+
>
55+
</h3>
56+
<doxygen-description
57+
class="block mt-2"
58+
[description]="fn.detailedDescription"></doxygen-description>
59+
</td>
60+
</tr>
61+
62+
<tr *ngIf="def.protectedFunctions && def.protectedFunctions.length > 0">
63+
<th class="h-7 relative">
64+
<span class="absolute left-2 top-1 bottom-0 whitespace-nowrap"
65+
>Protected Functions</span
66+
>
67+
</th>
68+
<th class="w-full"></th>
69+
</tr>
70+
<tr
71+
*ngFor="let fn of def.protectedFunctions"
72+
class="odd:bg-black/5 dark:odd:bg-white/5">
73+
<td class="align-top text-right whitespace-nowrap py-2">
74+
<doxygen-type-name [def]="fn.return"></doxygen-type-name>
75+
</td>
76+
<td class="align-top py-2">
77+
<div>
78+
<a class="whitespace-nowrap" [doxygenRefidLink]="fn.id"
79+
><code>{{ fn.name }}</code></a
80+
>
81+
</div>
82+
<doxygen-description
83+
class="block mt-2"
84+
[description]="fn.detailedDescription"></doxygen-description>
85+
</td>
86+
</tr>
87+
88+
<tr *ngIf="def.privateFunctions && def.privateFunctions.length > 0">
89+
<th class="h-7 relative">
90+
<span class="absolute left-2 top-1 bottom-0 whitespace-nowrap"
91+
>Private Functions</span
92+
>
93+
</th>
94+
<th class="w-full"></th>
95+
</tr>
96+
<tr
97+
*ngFor="let fn of def.privateFunctions"
98+
hiddenRow
99+
class="odd:bg-black/5 dark:odd:bg-white/5">
100+
<td class="align-top text-right whitespace-nowrap py-2">
101+
<doxygen-type-name [def]="fn.return"></doxygen-type-name>
102+
</td>
103+
<td class="align-top py-2">
104+
<div>
105+
<a class="whitespace-nowrap" [doxygenRefidLink]="fn.id"
106+
><code>{{ fn.name }}</code></a
107+
>
108+
</div>
109+
<doxygen-description
110+
class="block mt-2"
111+
[description]="fn.detailedDescription"></doxygen-description>
112+
</td>
113+
</tr>
114+
</table>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {Component, ChangeDetectionStrategy, Input} from '@angular/core';
2+
import {DoxygenFunctionMemberDef} from '../../search/doxygen-def-types';
3+
4+
export interface IDoxygenFunctionsTable {
5+
publicFunctions?: DoxygenFunctionMemberDef[];
6+
protectedFunctions?: DoxygenFunctionMemberDef[];
7+
privateFunctions?: DoxygenFunctionMemberDef[];
8+
publicStaticFunctions?: DoxygenFunctionMemberDef[];
9+
privateStaticFunctions?: DoxygenFunctionMemberDef[];
10+
}
11+
12+
@Component({
13+
selector: 'doxygen-functions-table',
14+
preserveWhitespaces: true,
15+
templateUrl: './doxygen-functions-table.component.html',
16+
changeDetection: ChangeDetectionStrategy.OnPush,
17+
})
18+
export class DoxygenFunctionsTableComponent {
19+
@Input()
20+
def: IDoxygenFunctionsTable;
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {NgModule} from '@angular/core';
2+
import {CommonModule} from '@angular/common';
3+
import {DoxygenRefidLinkModule} from '../doxygen-refid-link/doxygen-refid-link.module';
4+
import {DoxygenParagraphModule} from '../doxygen-paragraph/doxygen-paragraph.module';
5+
import {DoxygenTypeNameModule} from '../doxygen-type-name/doxygen-type-name.module';
6+
import {DoxygenDescriptionModule} from '../doxygen-member-components/doxygen-description/doxygen-description.module';
7+
import {HiddenTableRowsModule} from '../hidden-table-rows/hidden-table-rows.module';
8+
import {DoxygenFunctionsTableComponent} from './doxygen-functions-table.component';
9+
10+
@NgModule({
11+
declarations: [DoxygenFunctionsTableComponent],
12+
imports: [
13+
CommonModule,
14+
DoxygenRefidLinkModule,
15+
DoxygenParagraphModule,
16+
DoxygenTypeNameModule,
17+
DoxygenDescriptionModule,
18+
HiddenTableRowsModule,
19+
],
20+
exports: [DoxygenFunctionsTableComponent],
21+
})
22+
export class DoxygenFunctionsTableModule {}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
<p *ngFor="let paragraph of description">
2-
<doxygen-paragraph [paragraph]="paragraph"></doxygen-paragraph>
1+
<p *ngIf="description.length === 0; else hasDescription" class="my-0">
2+
<em *ngIf="!brief; else hasBrief">(no description)</em>
3+
<ng-template #hasBrief>{{ brief }}</ng-template>
34
</p>
5+
<ng-template #hasDescription>
6+
<p *ngFor="let paragraph of description" class="last:mb-0 first:mt-0">
7+
<doxygen-paragraph [paragraph]="paragraph"></doxygen-paragraph>
8+
</p>
9+
</ng-template>

src/components/doxygen-member-components/doxygen-description/doxygen-description.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import {DoxygenParagraph} from '../../../search/doxygen-def-types';
1010
export class DoxygenDescriptionComponent {
1111
@Input()
1212
description: DoxygenParagraph[];
13-
brief: string;
13+
14+
@Input()
15+
brief?: string;
1416

1517
constructor() {}
1618
}

0 commit comments

Comments
 (0)