Skip to content

Commit 134ca2f

Browse files
committed
Implement "note" field for oop
1 parent 0b0054a commit 134ca2f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import ItemDescription from '@src/components/ItemDescription.astro';
1818
import EnhancedMarkdown from '@src/components/EnhancedMarkdown.astro';
1919
import PreviewImages from '@src/components/PreviewImages.astro';
2020
21+
import { marked } from 'marked';
22+
2123
export async function getStaticPaths() {
2224
const functions = await getCollection('functions');
2325
return functions.map(func => ({
@@ -118,6 +120,10 @@ let funcSyntaxes = parseFunctionSyntaxes(func.id, func.data);
118120
<h4>OOP Syntax <a class="small-text" href="/reference/OOP">Help! I don't understand this!</a></h4>
119121
<ul>
120122

123+
{funcInfo.oop.note && (
124+
<li><i><Fragment set:html={marked("<b>Note:</b> " + funcInfo.oop.note)} /></i></li>
125+
)}
126+
121127
{funcInfo.oop.constructorclass ? (
122128
<li>
123129
<strong>Constructor</strong>:

web/src/utils/functions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type FunctionItem = Awaited<ReturnType<typeof getCollection>>[number];
77

88
type BaseOOP = {
99
element: string;
10+
note?: string;
1011
};
1112

1213
// /!\ constructor is a reserved word in JS/TS, so we use constructorclass

0 commit comments

Comments
 (0)