Replies: 3 comments 21 replies
-
This is exactly the issue we might face with this. @ericvalcik |
Beta Was this translation helpful? Give feedback.
-
I could find an acceptable solution: https://codesandbox.io/p/sandbox/73vs4k?file=/pages/index.mdx Basically, with the help of a custom component ( |
Beta Was this translation helpful? Give feedback.
-
The comments above refer to Nextra 2. This is a comment for Nextra 3 users. Using See an example at my tutorial Dynamically read and process a MDX File |
Beta Was this translation helpful? Give feedback.
-
In my component page, I'd like to 1) display some source code as example, and 2) show how it renders – in the same page. Code samples arestored in a
../examples
directory, so that I can unit-test and reuse them.In my page, I tried with the following code. However, it doesn't highlight the syntax of the
code
block with shiki.Example: https://codesandbox.io/p/sandbox/smoosh-darkness-3dqm88?file=/pages/index.mdx
In Docusaurus, we have the CodeBlock component – which already highlight the source, while the Nextra's
Pre
does not.Some related discussions I could find: #1045, #2119, #1195 (where the linked doc doesn't seem to help my case).
Beta Was this translation helpful? Give feedback.
All reactions