2013-07-31 19:01:10 -06:00
|
|
|
<div id="example_{{.Name}}" class="toggle">
|
|
|
|
<div class="collapsed">
|
|
|
|
<p class="exampleHeading toggleButton">▹ <span class="text">Example{{example_suffix .Name}}</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="expanded">
|
|
|
|
<p class="exampleHeading toggleButton">▾ <span class="text">Example{{example_suffix .Name}}</span></p>
|
|
|
|
{{with .Doc}}<p>{{html .}}</p>{{end}}
|
|
|
|
{{$output := .Output}}
|
|
|
|
{{with .Play}}
|
|
|
|
<div class="play">
|
2016-02-10 11:03:24 -07:00
|
|
|
<div class="input"><textarea class="code" spellcheck="false">{{html .}}</textarea></div>
|
2013-07-31 19:01:10 -06:00
|
|
|
<div class="output"><pre>{{html $output}}</pre></div>
|
|
|
|
<div class="buttons">
|
|
|
|
<a class="run" title="Run this code [shift-enter]">Run</a>
|
|
|
|
<a class="fmt" title="Format this code">Format</a>
|
2017-08-02 14:37:59 -06:00
|
|
|
{{if not $.GoogleCN}}
|
2013-07-31 19:01:10 -06:00
|
|
|
<a class="share" title="Share this code">Share</a>
|
2015-09-01 17:49:30 -06:00
|
|
|
{{end}}
|
2013-07-31 19:01:10 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<p>Code:</p>
|
|
|
|
<pre class="code">{{.Code}}</pre>
|
|
|
|
{{with .Output}}
|
|
|
|
<p>Output:</p>
|
|
|
|
<pre class="output">{{html .}}</pre>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|