diff options
| author | Peter Bacon Darwin | 2014-03-17 12:43:10 +0000 | 
|---|---|---|
| committer | Peter Bacon Darwin | 2014-03-17 12:43:10 +0000 | 
| commit | d09056d2872c81b86f49cc8a8a666e776eeb2254 (patch) | |
| tree | c0a1cfb1f3b087202e05a89b71a5fb80ff7854d0 /docs/config | |
| parent | 849e4472e178474b5b2be3d3a12d059a7c9b66dc (diff) | |
| download | angular.js-d09056d2872c81b86f49cc8a8a666e776eeb2254.tar.bz2 | |
docs(runnableExamples): add "edit in Plunker" button
The "runnableExample.template.html" template overrides the one in the
dgeni-packages "examples" package with a similar template that also has
a link to a special Plunker URL that can pull in the example from our
code.angularjs.org website.
Diffstat (limited to 'docs/config')
| -rw-r--r-- | docs/config/templates/runnableExample.template.html | 27 | 
1 files changed, 27 insertions, 0 deletions
| diff --git a/docs/config/templates/runnableExample.template.html b/docs/config/templates/runnableExample.template.html new file mode 100644 index 00000000..4fe2a38f --- /dev/null +++ b/docs/config/templates/runnableExample.template.html @@ -0,0 +1,27 @@ +{# Be aware that we need these extra new lines here or marked will not realise that the <div> +   is HTML and wrap each line in a <p> - thus breaking the HTML #} + +<div> +  <a ng-href="http://plnkr.co/edit/ngdoc:{$ doc.example.id $}@{{docsVersion}}?p=preview" class="btn pull-right" target="_blank"> +    <i class="glyphicon glyphicon-edit"> </i> +    Edit in Plunker</a> +  <div class="runnable-example" +      path="{$ doc.example.outputFolder $}" +      {%- for attrName, attrValue in doc.example.attributes %} +      {$ attrName $}="{$ attrValue $}"{% endfor %}> + +   {% for fileName, file in doc.example.files %} +    <div class="runnable-example-file" {% for attrName, attrValue in file.attributes %} +      {$ attrName $}="{$ attrValue $}"{% endfor %}> +      {% code -%} +      {$ file.fileContents $} +      {%- endcode %}   +    </div> +  {% endfor %} + +    <iframe class="runnable-example-frame" src="{$ doc.example.outputFolder $}/index.html" name="{$ doc.example.id $}"></iframe> +  </div> +</div> + +{# Be aware that we need these extra new lines here or marked will not realise that the <div> +   above is HTML and wrap each line in a <p> - thus breaking the HTML #}
\ No newline at end of file | 
