mirror of https://github.com/docker/docs.git
18 lines
759 B
HTML
18 lines
759 B
HTML
<div class="group relative">
|
|
<button
|
|
x-data="{ code: '{{encoding.Base64Encode .Inner}}', copying: false }"
|
|
class="absolute top-3 right-3 text-gray-light-300 dark:text-gray-dark-600"
|
|
title="Copy"
|
|
@click="window.navigator.clipboard.writeText(atob(code).replaceAll(/^\$\s*/gm, ''));
|
|
copying = true;
|
|
setTimeout(() => copying = false, 2000);"
|
|
>
|
|
<span :class="{ 'group-hover:block' : !copying }" class="hidden icon-svg">{{ partial "icon" "content_copy" }}</span>
|
|
<span :class="{ 'group-hover:block' : copying }" class="hidden icon-svg">{{ partial "icon" "check_circle" }}</span>
|
|
</button>
|
|
{{ $result := transform.HighlightCodeBlock . }}
|
|
<div class="syntax-light dark:syntax-dark">
|
|
{{ $result.Wrapped }}
|
|
</div>
|
|
</div>
|