-
Notifications
You must be signed in to change notification settings - Fork 5
Add Python syntax highlighting to code blocks using react-syntax-highlighter #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…hlighter Co-authored-by: msaroufim <[email protected]>
|
@copilot you can expect the reference code to be exclusively python code, please simplify your code accordingly |
Co-authored-by: msaroufim <[email protected]>
Simplified the CodeBlock component to focus exclusively on Python syntax highlighting as requested. Removed the generic language prop and hardcoded "python" as the language. All tests continue to pass (83/83). Commit: 08207bf |
|
@copilot the code will show up in sections titled reference implementation, does your code also highlight those correcty? |
Yes, the code is highlighted correctly in sections titled "Reference Implementation"! The CodeBlock component is hardcoded for Python syntax highlighting and works perfectly in the leaderboard's Reference tab. Here's a demonstration showing the syntax highlighting in action: As you can see:
The implementation correctly highlights Python code in reference implementation sections as requested. |
msaroufim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I believe you

This PR implements Python syntax highlighting for code blocks across the website to improve code readability and user experience for reference implementations.
Implementation
The enhancement uses react-syntax-highlighter with the Prism.js backend, which provides:
Key Changes
Enhanced CodeBlock Component:
react-syntax-highlighterwith theoneLighttheme for clean, readable highlightingUpdated Usage:
Visual Impact
The screenshot demonstrates the improvement with real GPU kernel code:
Testing
This enhancement significantly improves the developer experience when viewing Python reference implementations on the platform.
Fixes #41.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.