Skip to content

Commit 72d4dde

Browse files
committed
Update v3/docs/embedding-HOWTO.md
1 parent 2216e84 commit 72d4dde

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎v3/docs/embedding-HOWTO.md‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This document is a starting point for anyone who wants to embed
44
Online 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

88
Look at the Git history to see when this document was last updated; the more time
99
elapsed since that date, the more likely things are out-of-date.
@@ -18,3 +18,17 @@ philip@pgbovine.net if you have questions.
1818
And 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).

0 commit comments

Comments
 (0)