Naming Convention Question: Should a rehype plugin that supports MDX include "mdx" in its name? #195
-
I'm working on a new Rehype plugin related to image elements. The plugin finds I'm a bit unsure about the naming convention: Should the plugin name include "mdx" to reflect that it supports MDX syntax, or is it better to keep it more general?.
I wonder some users may consider that the plugin is only for mdx content if the name consists "mdx". Another thought I had: Would it make more sense to split the plugin into two separate ones—one that only supports standard Markdown (markdown image syntax and HTML image elements), and another that also supports MDX? However, it's also true that if a plugin supports MDX for images, it inherently has to support regular HAST I'd really appreciate your thoughts and experiences on naming and plugin structure in this kind of scenario. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
If it works specifically for MDX, for example if it generates MDX specific nodes, I’d name it If it supports hast without MDX, I would name it I am curious why you need to handle JSX elements. |
Beta Was this translation helpful? Give feedback.
-
Thank you @remcohaszing. The plugin is not specifically for MDX, but covers it and has special treatment for MDX nodes. So, I think also that the name of
Just wanted to cover html syntax |
Beta Was this translation helpful? Give feedback.
If it works specifically for MDX, for example if it generates MDX specific nodes, I’d name it
rehype-mdx-image-xxx
.If it supports hast without MDX, I would name it
rehype-image-xxx
. It can have special treatment for MDX nodes. I think this best describes your plugin.I am curious why you need to handle JSX elements.