storybook 如何自定义Doc的解析器/生成器以特定方式处理某些注解?

flvlnr44  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(64)

I have a component with the following JSDoc:

/**
* Displays stuff.
*
* XXX Be careful about "X".
*/

I'd like to generate something along the lines of:

Displays stuff.

<span className="tip">XXX</span> Be careful about "X".

How can I do that? Haven't found anything related to this in the doc.
I'd basically like to map some stuff to replace it. Such as:

  • XXX : Display a "tip"
  • TODO : Display a "tip"
  • FIXME : Display a "tip"
  • @see https://xxx.xx : Display a link to the url
  • @deprecated : Display a "tip"
  • etc.
n7taea2i

n7taea2i1#

目前无法自定义此功能。如果有人编写了处理标准注解(如@deprecated)的代码,并且该代码还可以扩展以处理自定义注解,我将对此感兴趣并希望能够实现这一目标。

相关问题