Skip to content

Commit

Permalink
ESY-6296 Code examples
Browse files Browse the repository at this point in the history
- handle code examples withour header or json
  • Loading branch information
m-lilja committed Mar 5, 2024
1 parent 0768cfe commit 63aa137
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions _includes/code-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@

<p class="code-view-header">
{{ include.title}}
{% if include.json %}
<button aria-describedby="tooltipCopy" class="code-view-copy tooltip" aria-label="Copy json to clipboard" value='{{include.json}}' onclick='javascript:navigator.clipboard.writeText(this.value)'><i class="at-clipboard small" aria-hidden="true"></i><div role="tooltip">Copy json to clipboard</div></button>
{% endif %}
</p>
{% if include.header %}
````http
{{include.header}}
````

{% endif %}
{% if include.json %}
````jsonc
{{include.json}}
````
````
{% endif %}

0 comments on commit 63aa137

Please sign in to comment.