Khan / Khan/live-editor

Idea: Pass initial code as URL parameter

Open
#586 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

There are some great uses for the live editor outside of Khan Academy, such as embedding it in an article on a webpage. In this way you can not only quickly and easily showcase a program or code snippet, but allow visitors to change it and interact with it.

Unfortunately, the only way to start off with code already in the editor is to manually create a program on Khan Academy and use its program ID in the source URL. It would be really cool to be able to pass the initial code to some page as an encoded URL parameter, resulting in an embeddable live editor initialized with that code.

I'm thinking something like this:
``

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the live editor entry point represented by the /computer-programming/pjs/new?code URL and trace how an editor is initialized from its source URL. Define how encoded code should be accepted for an embeddable page, then verify that the supplied example initializes the editor with the requested program and remains editable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.