Open AugustinMauroy opened 1 month ago
It is not the job of remote-mdx
. You should use a remark plugin for it, or should create a custom plugin.
For example, remark-flexible-code-titles
plugin can handle filenames in code fences like below.
```js:index.js
console.log("xx");
```typescript
import remarkCodeTitles from "remark-flexible-code-titles";
// ...
const foo = compileMDX({
source,
options: {
mdxOptions: {
remarkPlugins: [remarkCodeTitles]
}
}
});
// ...
If you want to use the exact syntax (like '''js filename="index.js"
) that you gave in your example, then you have to create a custom remark plugin, getting inspired from remark-flexible-code-titles
.
I would like to use remote-mdx for compiling MDX.
But I don't know how to access "meta" from a code box custom
Example