Skip to content

Conversation

@SoonIter
Copy link
Member

@SoonIter SoonIter commented Jul 9, 2025

Summary

feat: File Code Block of ```tsx file="./filename"

Users can import an external file as a code block.

As we support this feature in the core. This also means that the syntax external code blocks are used in plugin-preview and plugin-playground will change.

before

<code src="./example.tsx" />

after

```tsx file="./example.tsx"
```

Related Issue

close #2182

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Jul 9, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 196cef1
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/6870a498e46e270008c2c88a
😎 Deploy Preview https://deploy-preview-2361--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jul 9, 2025

Deploy Preview for rspress ready!

Name Link
🔨 Latest commit 196cef1
🔍 Latest deploy log https://app.netlify.com/projects/rspress/deploys/6870a49874f48800088ef9e4
😎 Deploy Preview https://deploy-preview-2361--rspress.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 60 (🔴 down 36 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (🟢 up 9 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@SoonIter SoonIter changed the title feat: File Code Block of ```tsx file="./filename" feat(mdx): File Code Block of ```tsx file="./filename" Jul 9, 2025
@SoonIter SoonIter changed the title feat(mdx): File Code Block of ```tsx file="./filename" feat(mdx)!: File Code Block of ```tsx file="./filename" Jul 10, 2025
@SoonIter SoonIter requested a review from JounQin July 10, 2025 09:29
@SoonIter SoonIter changed the title feat(mdx)!: File Code Block of ```tsx file="./filename" feat(mdx)!: support File Code Block of ```tsx file="./filename" to write demo code in another file Jul 10, 2025
@SoonIter SoonIter merged commit 683fbd7 into main Jul 11, 2025
11 checks passed
@SoonIter SoonIter deleted the syt/code-block branch July 11, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature][Compile-time Component]: '''tsx file="filename" for code block

3 participants