add-include-file
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
{% capture samplecode %}{% include_relative {{include.file}} %}{% endcapture %}
|
||||
{% if include.k8slink %}{% capture ghlink %}https://raw.githubusercontent.com/kubernetes/kubernetes/blob/{{page.githubbranch}}{{include.k8slink}}{% endcapture %}{% endif %}
|
||||
{% if include.ghlink %}{% capture ghlink %}https://raw.githubusercontent.com/kubernetes/kubernetes.github.io/{{page.docsbranch}}{{include.ghlink}}{% endcapture %}{% endif %}
|
||||
{% capture mysample %}
|
||||
```{{include.language}}
|
||||
{{ samplecode | raw | strip }}
|
||||
```
|
||||
{: id="{{include.file | handleize}}"}
|
||||
{% endcapture %}
|
||||
<table class="includecode">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
{% if ghlink %}<a href="{{ghlink}}" download="{{include.file}}">{% endif %}
|
||||
<code>{{include.file}}</code>
|
||||
{% if ghlink %}</a>{% endif %}
|
||||
<img src="/images/copycode.svg" style="max-height:24px" onclick="copyCode('{{include.file | handleize}}')" title="Copy {{include.file}} to clipboard">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ mysample | markdownify }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user