From 5733e0090848ee8f7df5e652b4f2c90304788d85 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sat, 7 Jan 2023 22:11:47 +0100 Subject: [PATCH] add hideDescription flag to JsDoc --- website/src/docs/JsDoc.jsx | 4 ++-- website/src/pages/technical-manual/docs.mdx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/website/src/docs/JsDoc.jsx b/website/src/docs/JsDoc.jsx index d75409c7..3c8dd1eb 100644 --- a/website/src/docs/JsDoc.jsx +++ b/website/src/docs/JsDoc.jsx @@ -2,7 +2,7 @@ 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'; -export function JsDoc({ name, h = 3 }) { +export function JsDoc({ name, h = 3, hideDescription }) { const item = docs[name]; if (!item) { console.warn('Not found: ' + name); @@ -16,7 +16,7 @@ export function JsDoc({ name, h = 3 }) { return ( <> {!!h && {item.longname}} -
+ {!hideDescription &&
}
    {item.params?.map((param, i) => (
  • diff --git a/website/src/pages/technical-manual/docs.mdx b/website/src/pages/technical-manual/docs.mdx index 229b9a63..b0417984 100644 --- a/website/src/pages/technical-manual/docs.mdx +++ b/website/src/pages/technical-manual/docs.mdx @@ -47,6 +47,7 @@ Usage: - `name`: function name, as named with `@name` in jsdoc - `h`: level of heading. `0` will hide the heading. Hiding it allows using a manual heading which results in a nav link being generated in the right sidebar. +- `hideDescription`: if set, the description will be hidden ### Writing jsdoc