mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 13:48:34 +00:00
add hideDescription flag to JsDoc
This commit is contained in:
parent
3992356517
commit
5733e00908
@ -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 && <CustomHeading>{item.longname}</CustomHeading>}
|
||||
<div dangerouslySetInnerHTML={{ __html: description }} />
|
||||
{!hideDescription && <div dangerouslySetInnerHTML={{ __html: description }} />}
|
||||
<ul>
|
||||
{item.params?.map((param, i) => (
|
||||
<li key={i}>
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user