summaryrefslogtreecommitdiff
path: root/lib/godoc/example.html
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:36 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:36 +0100
commit04b08da9af0c450d645ab7389d1467308cfc2db8 (patch)
treedb247935fa4f2f94408edc3acd5d0d4f997aa0d8 /lib/godoc/example.html
parent917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff)
downloadgolang-upstream/1.1_hg20130304.tar.gz
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'lib/godoc/example.html')
-rw-r--r--lib/godoc/example.html23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/godoc/example.html b/lib/godoc/example.html
index ede31d61f..cda2a8491 100644
--- a/lib/godoc/example.html
+++ b/lib/godoc/example.html
@@ -5,11 +5,24 @@
<div class="expanded">
<p class="exampleHeading toggleButton">▾ <span class="text">Example{{example_suffix .Name}}</span></p>
{{with .Doc}}<p>{{html .}}</p>{{end}}
- <p>Code:</p>
- <pre class="code">{{.Code}}</pre>
- {{with .Output}}
- <p>Output:</p>
- <pre class="output">{{html .}}</pre>
+ {{$output := .Output}}
+ {{with .Play}}
+ <div class="play">
+ <div class="input"><textarea class="code">{{html .}}</textarea></div>
+ <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>
+ <a class="share" title="Share this code">Share</a>
+ </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>