Skip to content

Commit fd07587

Browse files
authored
fixes problems with enums without initializers not loading (#86)
1 parent 28b4cec commit fd07587

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
<doxygen-name [access]="def.access" [static]="def.static"
22
><h1>{{ def.name }}</h1></doxygen-name
33
>
4-
<h3>Parameters</h3>
54
<div
65
*ngFor="let parameter of def.parameters"
7-
class="odd:bg-black/5 dark:odd:bg-white/5">
6+
class="bg-black/5 dark:bg-secondary/5 my-6 rounded shadow-md">
87
<div class="flex flex-row">
98
<div class="pl-2 py-4" id="{{ parameter.name }}">
109
<code>{{ parameter.name }}</code>
1110
</div>
12-
<div class="pl-2 py-4">
11+
<div class="pl-2 py-4" *ngIf="parameter.initializer">
1312
<code>{{ parameter.initializer }}</code>
1413
</div>
1514
</div>
1615
<div class="pb-2 pl-2">
1716
<doxygen-description
18-
[description]="def.detailedDescription"></doxygen-description>
17+
[description]="parameter.detailedDescription"></doxygen-description>
1918
</div>
2019
</div>
2120
<doxygen-location [location]="def.location"></doxygen-location>

src/search/doxygen-parse.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ function getDoxygenParagraph(para: Element): DoxygenParagraph {
9191

9292
const doxygenMemberDefParseFns = {
9393
define: (def: DoxygenBaseDef, el: Element): DoxygenDefineMemberDef => {
94-
console.log('define', el);
9594
const defineParams: DoxygenDefineParameter[] = [];
9695

9796
for (const paramEl of Array.from(el.querySelectorAll('param'))) {
@@ -119,14 +118,13 @@ const doxygenMemberDefParseFns = {
119118
};
120119
},
121120
enum: (def: DoxygenBaseDef, el: Element): DoxygenEnumMemberDef => {
122-
console.log('TODO enum', el);
123121
const enumValueParameters: DoxygenEnumParameter[] = [];
124122
for (const paramEl of Array.from(el.querySelectorAll('enumvalue'))) {
125123
const detailedDescription = getDetailedDescription(paramEl);
126124

127125
let param: DoxygenEnumParameter = {
128126
name: paramEl.querySelector('name').textContent.trim(),
129-
initializer: paramEl.querySelector('initializer').textContent.trim(),
127+
initializer: paramEl.querySelector('initializer')?.textContent.trim() || '',
130128
access: paramEl.getAttribute('prot') as any,
131129
brief: paramEl.querySelector('briefdescription').textContent.trim(),
132130
detailedDescription: detailedDescription,
@@ -325,7 +323,6 @@ const doxygenMemberDefParseFns = {
325323

326324
const doxygenCompoundDefParseFns = {
327325
page: (def: DoxygenBaseDef, el: Element): DoxygenPageDef => {
328-
console.log('page def el', el);
329326

330327
return {
331328
...def,
@@ -338,7 +335,6 @@ const doxygenCompoundDefParseFns = {
338335
};
339336
},
340337
file: (def: DoxygenBaseDef, el: Element): DoxygenFileDef => {
341-
console.log('TODO file def', el);
342338

343339
const sections = {
344340
define: [] as DoxygenDefineMemberDef[],
@@ -531,7 +527,7 @@ function doxygenInnerNamespace(el: Element): DoxygenInnerNamespaceDef {
531527
function getDetailedDescription(el: Element): DoxygenParagraph[] {
532528
const detailedDescription: DoxygenParagraph[] = [];
533529
const detailedDescEl = el.querySelector('detaileddescription');
534-
530+
535531
if (detailedDescEl) {
536532
for (const para of Array.from(detailedDescEl.children)) {
537533
const doxygenParagraph = getDoxygenParagraph(para);

0 commit comments

Comments
 (0)