Skip to content

Commit 91289e1

Browse files
Add incomplete note to func page if it's missing example
1 parent b6a607b commit 91289e1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

web/src/pages/reference/[func].astro

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ funcExamples = funcExamples.map((example: any) => {
7171
}
7272
});
7373
74+
const isDocIncomplete = funcInfo.incomplete === true || funcExamples.length === 0;
75+
7476
let notesContent: NotesType = [];
7577
if (Array.isArray(funcInfo.notes) && funcInfo.notes.length > 0) {
7678
notesContent = funcInfo.notes;
@@ -121,7 +123,7 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
121123
return (
122124
<ItemDescription
123125
description={funcInfo.description}
124-
incomplete={funcInfo.incomplete}
126+
incomplete={isDocIncomplete}
125127
/>
126128
);
127129
}
@@ -160,15 +162,15 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
160162
<div class="added-updated-description-box-body">
161163
<ItemDescription
162164
description={funcInfo.description}
163-
incomplete={funcInfo.incomplete}
165+
incomplete={isDocIncomplete}
164166
/>
165167
</div>
166168
</div>
167169
);
168170
})() : (
169171
<ItemDescription
170172
description={funcInfo.description}
171-
incomplete={funcInfo.incomplete}
173+
incomplete={isDocIncomplete}
172174
/>
173175
)}
174176

0 commit comments

Comments
 (0)