Skip to content

Conversation

@Gupta-02
Copy link
Contributor

This PR implements an interactive code editor component for Python tutorial pages, enabling users to edit and run code snippets directly in the browser with syntax highlighting and execution feedback. This enhances the learning experience by allowing hands-on Python practice without requiring local environment setup.

Fixes #1128

Type of Change
New feature (e.g., new page, component, or functionality)
Bug fix (non-breaking change that fixes an issue)
UI/UX improvement (design, layout, or styling updates)
Performance optimization (e.g., code splitting, caching)
Documentation update (README, contribution guidelines, etc.)
Other (please specify):
Changes Made
InteractiveCodeEditor Component: Created a comprehensive code editor using Monaco Editor (VS Code) and Pyodide for browser-based Python execution
Python Runtime Integration: Implemented Pyodide WebAssembly runtime for secure, client-side Python code execution
MDX Component System: Added PythonCodeEditor wrapper component for seamless integration with Docusaurus MDX content
Responsive UI Design: Built mobile-friendly interface with syntax highlighting, code editing controls, and real-time output display
Theme Compatibility: Ensured full support for both light and dark themes with proper styling
Tutorial Integration: Added example interactive editor to the Python introduction tutorial page
Error Handling: Implemented robust error handling for code execution and runtime loading
Dependencies
New dependencies added:
@monaco-editor/react: Monaco Editor React wrapper for professional code editing
pyodide: WebAssembly-based Python runtime for browser execution
No new dependencies required (compatible with existing setup)
Checklist
My code follows the style guidelines of this project.
I have tested my changes across major browsers and devices
My changes do not generate new console warnings or errors .
I ran npm run build and attached screenshot(s) in this PR.
This is already assigned Issue to me, not an unassigned issue.
Screenshots:
[Attach screenshot showing the interactive code editor on the Python tutorial page]

Files Changed:

InteractiveCodeEditor.tsx (new)
PythonCodeEditor.tsx (new)
interactive-code-editor.css (new)
MDXComponents.js (modified)
custom.css (modified)
intro-python.md (modified)
Tested
Monaco Editor: Professional code editing with IntelliSense-like features
Pyodide: WebAssembly Python runtime (no server-side execution needed)
MDX Integration: Seamless embedding in tutorial content
Performance: Lazy-loaded Pyodide for optimal page load times
Security: Client-side execution with no backend dependencies

image

Gupta-02 and others added 5 commits November 5, 2025 19:40
- Added Kingsumo embed script below the leaderboard section
- Script loads from https://kingsumo.com/js/embed.js
- Addresses issue recodehive#758 for giveaway page integration
- Add comprehensive blog standards document (wiki/blog-standards.md)
- Update contributing guidelines with blog writing section
- Standardize existing blog posts to match new standards:
  * Fix frontmatter consistency across all blogs
  * Remove invalid commented meta tags
  * Improve SEO descriptions and formatting
  * Ensure proper date formats and required fields

Closes recodehive#567 - Blog structure standardization
- Add SocialShare component with Twitter, LinkedIn, Facebook, and native share buttons
- Create BlogPostItem wrapper to display sharing buttons on individual blog posts
- Add responsive CSS styling for social sharing buttons
- Only show sharing buttons on actual blog posts (not tag or author pages)
- Include proper accessibility attributes and hover effects
- Support both light and dark themes

Fixes recodehive#1127
- Monaco Editor + Pyodide integration for browser-based Python execution
- MDX component for easy tutorial integration
- Added example to Python intro tutorial

Fixes recodehive#1128
@vercel
Copy link
Contributor

vercel bot commented Nov 12, 2025

@Gupta-02 is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs.

In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊

Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv.

We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰

🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨

📚Your perks for contribution to this community 👇🏻

  1. Get free Consultation use code recode50 to get free: Mentorship for free.

  2. Get the Ebook for free use code recode at checkout: Data Science cheatsheet for Beginners.

  3. Check out this weekly Newsletter: Sanjay's Newsletter.

If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@github-actions github-actions bot added recode this is label for leaderboard hacktoberfest-accepted level 3 50 points labels Nov 12, 2025
@github-actions github-actions bot added this to the recode:launch 3.0 milestone Nov 12, 2025
@github-actions
Copy link

✅ Synchronized metadata from Issue #1128:

  • Labels: level 3, recode, hacktoberfest-accepted
  • Milestone: recode:launch 3.0

@vercel
Copy link
Contributor

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
recode-website Ready Ready Preview Comment Nov 12, 2025 1:52pm

@sanjay-kv sanjay-kv added the under review Review under the maintainers or the admins label Nov 12, 2025
@sanjay-kv
Copy link
Member

@Adez017 for review.

</motion.section>

{/* Kingsumo Giveaway Script */}
<script src="https://kingsumo.com/js/embed.js"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you messed up two separate work in one branch .

@Adez017
Copy link
Member

Adez017 commented Nov 12, 2025

@Gupta-02 , i think you messed up three different issues on the same PR . i would advice please create different branch and open the PR for better review and management . CC: @sanjay-kv

@Adez017 Adez017 moved this to In Progress in @recode-web Nov 12, 2025
@sanjay-kv
Copy link
Member

@Gupta-02 this feature is really good just a code cleanup is required.

@github-actions
Copy link

✅ Synchronized metadata from Issue #1128:

  • Labels: level 3, recode, hacktoberfest-accepted
  • Milestone: recode:launch 3.0

@Gupta-02
Copy link
Contributor Author

@Adez017 Rather keeping a different branch can i add just code cleanup and update it so my workspace again becomes messy to write and then do u requested video too right
I hope u will understand!

- Improve TypeScript types and remove 'any' usage
- Add useCallback for performance optimization
- Enhance error handling and Pyodide loading logic
- Consolidate CSS styles and improve maintainability
- Make PythonCodeEditor flexible for any Python code
- Add clipboard API fallback for better browser compatibility
@github-actions
Copy link

✅ Synchronized metadata from Issue #1128:

  • Labels: level 3, recode, hacktoberfest-accepted
  • Milestone: recode:launch 3.0

@Gupta-02
Copy link
Contributor Author

@Adez017 Implemented the code editor clean up

@Adez017
Copy link
Member

Adez017 commented Nov 13, 2025

@Adez017 Rather keeping a different branch can i add just code cleanup and update it so my workspace again becomes messy to write and then do u requested video too right I hope u will understand!

@Gupta-02 You’ve done a good job 👏, but here at Recode Hive we follow certain practices for better code modularity and project management. I hope you understand that creating a single PR addressing multiple issues can make things harder to review and maintain.
CC: @sanjay-kv

@Gupta-02
Copy link
Contributor Author

Okay I will try if not please close pr I will do fresh one again

@github-actions
Copy link

✅ Synchronized metadata from Issue #1128:

  • Labels: level 3, recode, hacktoberfest-accepted
  • Milestone: recode:launch 3.0

@sanjay-kv
Copy link
Member

its a great update, appreciate if you can raise a new PR

@Adez017
Copy link
Member

Adez017 commented Nov 13, 2025

its a great update, appreciate if you can raise a new PR

Closing this PR , its a great feature . really appreciate if you can open a fresh PR @Gupta-02

@Adez017 Adez017 closed this Nov 13, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in @recode-web Nov 13, 2025
@Gupta-02 Gupta-02 deleted the feature/interactive-code-editor branch November 17, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted level 3 50 points recode this is label for leaderboard under review Review under the maintainers or the admins

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Interactive Code Editor for Tutorials

3 participants