1-
1+ {% assign counter = 0 %}
22{% for example in examples %}
3+ {% assign counter=counter | plus:1 %}
34 < div class ="section ">
4- < div class ="row auto-eg-padding ">
5- < div class =" row twelve columns ">
6- < h4 id ="{{ example.name | replace:' ','-' | remove:',' | downcase | strip_html }} "> < a class ="no_underline plot-blue " href ="#{{ example.name | replace:' ','-' | remove:',' | downcase | strip_html }} "> {{ example.name }}</ a > </ h4 >
7- </ div >
8- < div class ="row ">
9- < div class ="{% if example.arrangement contains 'horizontal' %}twelve{% else %}six{% endif %} columns ">
10- {% if example.markdown_content %}
11- {{ example.markdown_content | markdownify }}
12- {% endif %}
13- {% if example.content != "" %}
14- < div class ="z-depth-1 ">
15- < pre > < code class ="{{page.language}} "> {{ example.content | xml_escape }}</ code > </ pre >
16- </ div >
17- {% endif %}
18- {% if example.description %}
19- < blockquote >
20- {{ example.description }}
21- </ blockquote >
22- {% endif %}
5+ < div class ="row auto-eg-padding ">
6+ < div class =" row twelve columns ">
7+ < h4 id ="{{ example.name | replace:' ','-' | remove:',' | downcase | strip_html }} ">
8+ < a class ="no_underline plot-blue " href ="#{{ example.name | replace:' ','-' | remove:',' | downcase | strip_html }} "> {{ example.name }}</ a >
9+ </ h4 >
2310 </ div >
24- {% if example.plot_url %}
11+
12+ < div class ="row ">
2513 < div class ="{% if example.arrangement contains 'horizontal' %}twelve{% else %}six{% endif %} columns ">
26- < div class ="border " style ="text-align:center; ">
14+ {% if example.markdown_content %}
15+ {{ example.markdown_content | markdownify }}
16+ {% endif %}
17+ {% if example.content != "" %}
18+ < div class ="z-depth-1 ">
19+ < pre > < code class ="{{page.language}} "> {{ example.content | xml_escape }}</ code > </ pre >
20+ </ div >
21+ {% endif %}
22+ {% if example.description %}
23+ < blockquote >
24+ {{ example.description }}
25+ </ blockquote >
26+ {% endif %}
27+ </ div >
28+ {% if example.plot_url %}
29+ < div class ="{% if example.arrangement contains 'horizontal' %}twelve{% else %}six{% endif %} columns ">
2730 {% if example.plot_url contains '.gif' or example.plot_url contains '.png' %}
28- < img src ="{{ example.plot_url }} " />
31+ < img src ="{{ example.plot_url }} " />
2932 {% else %}
30- < iframe id ="auto-examples " src ="{{ example.plot_url }}{% if example.plot_url contains 'plot.ly' %}.embed{% endif %} "
33+ < iframe id ="auto-examples " src ="{{ example.plot_url }}{% if example.plot_url contains 'plot.ly' %}.embed{% endif %} "
3134 style ="width: {% if example.width %}{{example.width}}px;{% else %}100%;{% endif %} height: {% if example.height %}{{example.height}}px;{% else %}550px;{% endif %} border: none; "> </ iframe >
3235 {% endif %}
3336 </ div >
34- </ div >
35- {% endif %}
36- </ div >
37+ {% elsif page.language == "plotly_js" and (example.content contains "'myDiv'" or example.content contains '"myDiv"') %}
38+ < div class ="{% if example.arrangement contains 'horizontal' %}twelve{% else %}six{% endif %} columns ">
39+ < form style ="margin-bottom: 35px; font-weight: 'Open Sans', sans-serif; " action ="https://codepen.io/pen/define " method ="POST " target ="_blank ">
40+ < input type ="hidden " name ="data "
41+ value ="{"title":"Plotly.js {{example.name}}","html":"<head>\n\t<!-- Load plotly.js into the DOM -->\n\t<script src='https://cdn.plot.ly/plotly-latest.min.js'></script>\n</head>\n\n<body>\n\t<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>\n</body>","js":{{example.content | jsonify | escape | replace: "your access token ", "pk.eyJ1IjoiZXRwaW5hcmQiLCJhIjoiY2luMHIzdHE0MGFxNXVubTRxczZ2YmUxaCJ9.hwWZful0U2CQxit4ItNsiQ"}}}">
42+ < input style =" float: right; background-color:#119dff; border-radius: 4px; color: white; " class ="codepen-submit " type ="submit " value ="Try It On CodePen! ">
43+ </ form >
44+ {% capture unique_myDiv %}myDiv_{{counter}}{% endcapture %}
45+ < div style ="max-width: 100%; margin: auto " id ="{{unique_myDiv}} "> </ div >
46+ < script >
47+ { { example . content | replace : 'myDiv' , unique_myDiv | replace : "your access token" , "pk.eyJ1IjoiZXRwaW5hcmQiLCJhIjoiY2luMHIzdHE0MGFxNXVubTRxczZ2YmUxaCJ9.hwWZful0U2CQxit4ItNsiQ" } }
48+ </ script >
49+ </ div >
50+ {% endif %}
3751 </ div >
38-
3952 </ div >
40- {% endfor %}
53+ {% endfor %}
54+
0 commit comments