Simply write the tag <code-states-visualizer input='ADD JSON HERE'></code-states-visualizer>
Note, that since the input json contains double quotes, we recommend using single quotes around the input. This way there's no need to escape any double quotes in the input json. For this reason, we also recommend using double quotes in your python example code, because otherwise you need to escape every single quote in the input you generate.
Here's an example of a Code States Visualizer in a markdown-file:
- Go over to http://www.pythontutor.com/
- Click the link labeled "Visualize your code and get live help now"
- Select Python 3.6 from the dropdown menu.
- Write your example code in the field below the dropdown menu. Note that if your code contains quotes, we recommend using double quotes. If you use single quotes, you need to escape all of them in the json when adding the input to Code State Visualizer's markdown.
- Open your browser's Network Monitor.
- Click the button "Visualize execution" below the field where you wrote your code.
- Select the request with the domain "www.pythontutor.com".
- Go to the request's Response-tab.
- Right click the json and select copy all.
- Paste the json to the input-part of the tag
code-states-visualizer input=''>
in your markdown-file.