diff --git a/website/src/docs/JsDoc.jsx b/website/src/docs/JsDoc.jsx index 1ba80e0a..1a7a034f 100644 --- a/website/src/docs/JsDoc.jsx +++ b/website/src/docs/JsDoc.jsx @@ -2,19 +2,15 @@ import jsdoc from '../../../doc.json'; // doc.json is built with `npm run jsdoc- const docs = jsdoc.docs.reduce((acc, obj) => Object.assign(acc, { [obj.longname]: obj }), {}); import { MiniRepl } from './MiniRepl'; -const getTag = (title, item) => item.tags?.find((t) => t.title === title)?.text; - export function JsDoc({ name, h = 3, hideDescription, punchcard, canvasHeight }) { const item = docs[name]; if (!item) { console.warn('Not found: ' + name); return
; } - const synonyms = getTag('synonyms', item)?.split(', ') || []; const CustomHeading = `h${h}`; const description = item.description?.replaceAll(/\{@link ([a-zA-Z\.]+)?#?([a-zA-Z]*)\}/g, (_, a, b) => { - // console.log(_, 'a', a, 'b', b); return `${a}${b ? `#${b}` : ''}`; }) || ''; return ( @@ -22,9 +18,9 @@ export function JsDoc({ name, h = 3, hideDescription, punchcard, canvasHeight }) {!!h && {item.longname}} {!hideDescription && ( <> - {!!synonyms.length && ( + {!!item.synonyms_text && ( - Synonyms: {synonyms.join(', ')} + Synonyms: {item.synonyms_text} )}