Skip to content

Commit 2dc3027

Browse files
committed
Update embedding-HOWTO.md
1 parent 9fe0c0e commit 2dc3027

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎v3/docs/embedding-HOWTO.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@ Look at the Git history to see when this document was last updated; the more tim
99
elapsed since that date, the more likely things are out-of-date.
1010

1111
I'm assuming that you're competent in Python, JavaScript, command-line-fu, and Google-fu,
12-
and general [command-line BS](http://www.pgbovine.net/command-line-bullshittery.htm),
13-
so I won't do much hand-holding in these directions.
14-
15-
This guide isn't meant to be comprehensive; you will undoubtedly still
12+
and [command-line BS](http://www.pgbovine.net/command-line-bullshittery.htm). This guide isn't meant to be comprehensive; you may still
1613
be confused about details after reading it, so feel free to email
1714
philip@pgbovine.net if you have questions.
1815

1916

2017
## iframe embedding
2118

22-
An easy (although somewhat limited) way to embed an OPT visualization on your website is to enclose it within an [iframe](http://www.w3schools.com/tags/tag_iframe.asp).
19+
An easy way to embed an OPT visualization on your website is to enclose it within an [iframe](http://www.w3schools.com/tags/tag_iframe.asp).
2320

2421
If you generate a visualization (e.g., <a href="http://pythontutor.com/visualize.html#code=x+%3D+5%0Ay+%3D+10%0Az+%3D+x+%2B+y&mode=display&cumulative=false&py=2&curInstr=3">click here</a>)
2522
and then click the "Generate embed code" button at the bottom of the page, the following code will be generated:
@@ -32,7 +29,9 @@ and then click the "Generate embed code" button at the bottom of the page, the f
3229

3330
If you copy-and-paste the above code into your HTML webpage, then it will embed the given visualization as an iframe.
3431

35-
See `v3/iframe-embed-demo.html` for a working demo showing several embedded iframes ([online here](http://pythontutor.com/iframe-embed-demo.html)).
32+
Change `http://` to `https://` in the `src` attribute if you want to embed it in a webpage served over https.
33+
34+
See [v3/iframe-embed-demo.html](../iframe-embed-demo.html) for a working demo showing several embedded iframes ([online here](http://pythontutor.com/iframe-embed-demo.html)).
3635

3736

3837
### iframe embedding parameters
@@ -42,7 +41,7 @@ after the hash mark (`#` character) in the `src=` URL string. Note that OPT uses
4241
question mark `?` query string. Here are the currently-supported parameters:
4342

4443
- `code` - The Python code to visualize (mandatory: URL-encoded string)
45-
- `py` - Python interpreter version (mandatory: `2` for Python 2.7 or `3` for Python 3.2)
44+
- `py` - Language version (mandatory: `2` for Python 2.7 or `3` for Python 3.3, other languages: js, ts, ruby, java, c, cpp)
4645
- `verticalStack` - Set to `true` if you want the code and visualization to stack atop one another (optional)
4746
- `curInstr` - A (zero-indexed) integer of the execution point to directly jump to in the visualization (optional)
4847
- `cumulative` - Set to `true` if you want exited functions to be displayed (optional)
@@ -76,6 +75,7 @@ or, say, a USB drive), they can play with the visualization without an Internet
7675
Finally, multiple visualizations can be embedded in a single HTML webpage, although you need to be careful
7776
to redraw the SVG arrows when page elements are resized or moved.
7877

78+
7979
### The Nitty-Gritty
8080

8181
Let's attempt to go [literate programming](http://en.wikipedia.org/wiki/Literate_programming) style now ... load up

0 commit comments

Comments
 (0)