You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: add rawdescription on miscellaneous symbols #1646
add rawdescription on miscellaneous symbols, so that you can use Markdown from @storybook/addon-docs/blocks. This enables to display docs for functions, variables etc. in the same way storybook already does with addon-docs. In my project I created a custom doc block like so:
import{Markdown}from'@storybook/addon-docs/blocks';import{getCompodocJson}from'./get-compodoc-json';interfaceDescriptionProps{symbol: string;compodoc?: unknown;}/** Renders the description of a symbol of a compodoc as markdown. */exportconstDescription: React.FC<DescriptionProps>=(props)=>{const{ symbol, compodoc =getCompodocJson()}=props;constentry=findEntry(compodoc,symbol);return<Markdown>{entry?.rawdescription??''}</Markdown>;};constCOMPODOC_SYMBOL_KINDS=['injectables','classes','directives','components','pipes','miscellaneous.functions',]asconst;typeCompodocEntryKind=(typeofCOMPODOC_SYMBOL_KINDS)[number];interfaceCompodocEntry{name: string;description: string;rawdescription: string;}constfindEntry=(compodoc: unknown,symbol: string)=>{for(constkindofCOMPODOC_SYMBOL_KINDS){constentry=resolveEntries(compodoc,kind).find((c)=>symbol===c.name);if(entry){returnentry;}}for(constkindofCOMPODOC_SYMBOL_KINDS){constentry=resolveEntries(compodoc,kind).find((c)=>symbol.endsWith(c.name),);if(entry){returnentry;}}returnundefined;};functionresolveEntries(compodoc: unknown,kind: CompodocEntryKind){returnkind.split('.').reduce((obj,path)=>obj&&typeofobj==='object'&&(objasRecord<string,unknown>)[path],compodoc,)asCompodocEntry[];}
Activity
fix(jsdoc): preserve description for custom JSDoc tags and add rawdes…
vogloblinsky commentedon May 23, 2026
Closed by 55489d9