OneCompiler's Editor can be embedded into 3rd party websites as an iFrame.
You can see a quick demo in action here https://onecompiler.github.io/editor-embed-demo/

Following are the different options available to embed the editor

Embedding default editor


Embedding a specific language


Embedding a code


More options via query parameters

Query ParameterDescription
availableLanguages=trueTo limit the languages in the Language selection popup
hideLanguageSelection=trueTo hide the language selection button
hideNew=trueTo hide the 'New' button
hideRun=trueTo hide the 'Run' button
hideNewFileOption=trueDisables new file creation button
disableCopyPaste=trueDisables copy/paste functionality
disableAutoComplete=trueDisables code auto complete functionality
hideStdin=trueTo hide the STDIN section
hideResult=trueTo hide the Result section including STDIN
hideTitle=trueTo hide the Title/Code ID
theme=darkFor Darkmode editor
fontSize=20To set the font size of the editor. Default: 14, Range: 8-32
listenToEvents=trueEditor will keep listening for events like code change/ run from parent website
codeChangeEvent=trueEditor will send the code change event to the parent website
hideEditorOptions=trueTo hide the editor options Icon.

Capturing the code into parent website

Add the codeChangeEvent=true query param


In the parent website catch the onmessage events. Following is the sample code to demonstrate


Changing the Editor code programmatically

The parent websites can send the code to the Editor with follwong event


Note: Make sure you have enabled listenToEvents flag via query parameter

Run code in editor programmatically

The parent websites can trigger the Run code button programmatically, using the following code


Note: Make sure you have enabled listenToEvents flag via query parameter

Demo

https://onecompiler.github.io/editor-embed-demo/