File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33This document is a starting point for anyone who wants to embed
44Online Python Tutor (OPT) visualizations in their webpage. View it online at:
55
6- https://github.com/pgbovine/OnlinePythonTutor/blob /master/v3/docs/embedd .md
6+ https://github.com/pgbovine/OnlinePythonTutor/edit /master/v3/docs/embedding-HOWTO .md
77
88Look at the Git history to see when this document was last updated; the more time
99elapsed since that date, the more likely things are out-of-date.
@@ -18,3 +18,17 @@ philip@pgbovine.net if you have questions.
1818And please excuse the sloppy writing; I'm not trying to win any style awards here :)
1919
2020
21+ ## High-Level Overview
22+
23+ To embed a visualization, you:
24+
25+ 1 . Run the target Python program offline to generate an execution trace, which is one (really, really long)
26+ string representing a JavaScript (JSON) object.
27+ 2 . Copy that long string into a JavaScript .js file.
28+ 3 . Include some other stuff in your .js file and then embed it within your HTML webpage.
29+
30+ Note that the embedded visualization is ** read-only** -- that is, the user can interact with the visualization
31+ by stepping forward and backward, but they cannot edit the code.
32+
33+ If the user wants to click the 'Edit code' button to edit the code, then they are
34+ brought to the [ code editor page] ( http://pythontutor.com/visualize.html ) .
You can’t perform that action at this time.
0 commit comments