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
The codeImport function from src\lib\plugins\code-import.ts is actually making the job of extracting the content. ✅
However its not being rendered by src\components\CodeImport.tsx but by src\components\Code.tsx ⚠️
The src\lib\md-plugins.ts file exports the codeImport function from feat: render all docs #1 as remarkPlugins. ✅
4.The same src\lib\md-plugins.ts file exports another codeImport function from src\lib\plugins\rehype-code.ts ⚠️
The second codeImport function specifies that node.name !== 'CodeImport' gets rendered by a 'code' element.
Then, src\components\MDXRender.tsx maps 'code' elements to the Code.ts component
The codeImport function from src\lib\plugins\rehype-code.ts Actually does the same as src\components\CodeImport.tsx by manually composing the elements.
//codeImport function from src\lib\plugins\rehype-code.ts
This issue was found during the elaboration of the installation guide. The main intention was to import content from other mdx files to compose another mdx file to be rendered by the app.
Trying to bypass the rehype plugin was not enough, in the mean time a "MDXIimport" component must be added as a hot fix.
The text was updated successfully, but these errors were encountered:
cold-briu
changed the title
CodeImport.tsx is not being used.
CodeImport.tsx is not being used and the current rehype plugin won't properly render mdx imports
Sep 21, 2023
The codeImport function from src\lib\plugins\code-import.ts is actually making the job of extracting the content. ✅
However its not being rendered by src\components\CodeImport.tsx but by src\components\Code.tsx⚠️
The src\lib\md-plugins.ts file exports the codeImport function from feat: render all docs #1 as remarkPlugins. ✅
4.The same src\lib\md-plugins.ts file exports another codeImport function from src\lib\plugins\rehype-code.ts⚠️
The second codeImport function specifies that node.name !== 'CodeImport' gets rendered by a 'code' element.
Then, src\components\MDXRender.tsx maps 'code' elements to the Code.ts component
The codeImport function from src\lib\plugins\rehype-code.ts Actually does the same as src\components\CodeImport.tsx by manually composing the elements.
This issue was found during the elaboration of the installation guide. The main intention was to import content from other mdx files to compose another mdx file to be rendered by the app.
Trying to bypass the rehype plugin was not enough, in the mean time a "MDXIimport" component must be added as a hot fix.
The text was updated successfully, but these errors were encountered: