How to edit the code online and run the preview?

We are doing a help document similar to Baidu Map API, to achieve online editing code, and then run, and real-time preview function, similar to jsbin and some class library API documents like that (Baidu Map API demo), please provide the next idea, or whether there is a ready-made library to use, thank you!
is similar to the following figure. Edit the code in the middle and click run to preview the effect in real time on the right:

clipboard.png

Mar.13,2021

right iframe Click run reload?

Menu