Jakub-Sadowski commented on a change in pull request #13565:
URL: https://github.com/apache/beam/pull/13565#discussion_r570094191
##########
File path: website/www/site/layouts/shortcodes/highlight.html
##########
@@ -12,20 +12,36 @@
{{ $content := (trim .Inner "\n\r") | htmlUnescape | safeHTML }}
{{ $ctx := . }}
-{{ with (.Get "class") }}
- <div class={{ . }}>
- {{ with ($ctx.Get "lang") }}
+{{ $py := .Get "py" }}
+{{ with (.Get "language") }}
+ <div class='{{ printf "language-%s" . }} snippet'>
+ <div class="notebook-skip code-snippet">
+ {{ with $py }}
+ <a target="_blank" type="button" data-bs-toggle="tooltip"
data-bs-placement="bottom" title="Run code"
href="https://colab.research.google.com/github/{{ $ctx.Site.Params.branch_repo
}}/{{ $ctx.Get `notebook` }}-py.ipynb">
+ <img src="/images/run-icon.svg"/>
+ </a>
+ <a target="_blank" type="button" data-bs-toggle="tooltip"
data-bs-placement="bottom" title="View source code" href="https://github.com/{{
$ctx.Site.Params.branch_repo }}/{{ $ctx.Get `py` }}">
+ <img src="/images/code-icon.svg"/>
+ </a>
+ <a class="copy" type="button" data-bs-toggle="tooltip"
data-bs-placement="bottom" title="Copy to clipboard">
+ <img src="/images/copy-icon.svg"/>
+ </a>
+ {{ else }}
+ <a class="copy" type="button" data-bs-toggle="tooltip"
data-bs-placement="bottom" title="Copy to clipboard">
+ <img src="/images/copy-icon.svg"/>
+ </a>
+ {{ end }}
{{ highlight $content . "" }}
- {{ else }}
- {{ highlight $content "" "" }}
- {{ end }}
+ </div>
</div>
{{ else }}
- {{ with (.Get 0) }}
- <div class={{ printf "language-%s" . }}>
- {{ highlight $content . "" }}
+ <div class="snippet">
+ <div class="notebook-skip code-snippet without_switcher">
+ <a class="copy" type="button" data-bs-toggle="tooltip"
data-bs-placement="bottom" title="Copy to clipboard">
+ <img src="/images/copy-icon.svg"/>
+ </a>
+ {{ highlight $content "" "" }}
</div>
- {{ else }}
- {{ highlight $content "" "" }}
- {{ end }}
+ </div>
Review comment:
Yes, ur right, I will modify it accordingly
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]