TheNeuralBit commented on a change in pull request #13565:
URL: https://github.com/apache/beam/pull/13565#discussion_r569882120



##########
File path: website/www/site/content/en/documentation/io/developing-io-java.md
##########
@@ -17,9 +17,6 @@ limitations under the License.
 -->
 # Developing I/O connectors for Java
 
-**IMPORTANT:** Use ``Splittable DoFn`` to develop your new I/O. For more 
details, read the
-[new I/O connector overview](/documentation/io/developing-io-overview/).

Review comment:
       There are still several changes like this that look like you've reverted 
changes that happened on master already - see also create-external-table.md, 
and dsls/dataframes/overview.md

##########
File path: 
website/www/site/content/en/documentation/transforms/python/aggregation/combineperkey.md
##########
@@ -38,7 +38,7 @@ We use the function
 [`sum`](https://docs.python.org/3/library/functions.html#sum)
 which takes an `iterable` of numbers and adds them together.
 
-{{< highlight py >}}
+{{< highlight language="py" 
py="sdks/python/apache_beam/examples/snippets/transforms/aggregation/combineperkey.py"
 >}}

Review comment:
       None of these have `notebook=` arguments, so the "run" button just goes 
to https://colab.sandbox.google.com/github/apache/beam/blob/master/-py.ipynb 
(which doesn't work of course).
   
   Are there existing notebooks that these can point to, or are we planning on 
creating those later?
   
   I think we should not show the "run" button when notebook isn't specified.

##########
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:
       The existing `highlight` shortcode accepts either positional parameters 
`{{< highlight java >}}` or named parameters `{{< highlight lang="java" >}}`. 
This new shortcode should maintain that behavior as much as possible. Let's 
make it so that `{{< highlight java >}}` and `{{< highlight lang="java" >}}` 
still work with some default behavior, so we don't need to update all the 
current usages.
   
   Here's how I think this shortcode should work:
   - If only the language is specified (`highlight java` OR `highlight 
lang="java"`), create a box with just the "copy to clipboard" button.
   - If a "file" named argument is specified, add a "View source code" button 
to the box. Note this argument should be named "file" not "py" - we could use 
it to link to code in other languages. 
   - If a "notebook" named argument is specified, add a "Run code" button to 
the box. This fixes the issue in my last comment.
   
   Note in this proposal file and notebook are completely considerations. A 
snippet might have just a (Copy, Run Code) or it might have just (Copy, View 
Code, Run Code).

##########
File path: website/www/site/content/en/contribute/_index.md
##########
@@ -127,173 +128,9 @@ script which is part of the Beam repo:
 1. Assign the issue to yourself. To get the permission to do so, email
    the [dev@ mailing list](/community/contact-us)
    to introduce yourself and to be added as a contributor in the Beam issue 
tracker including your
-   ASF Jira Username. For example [this welcome email](
-   
https://lists.apache.org/thread.html/e6018c2aaf7dc7895091434295e5b0fafe192b975e3e3761fcf0cda7@%3Cdev.beam.apache.org%3E).
+   ASF Jira Username. For example [this welcome 
email](https://lists.apache.org/thread.html/e6018c2aaf7dc7895091434295e5b0fafe192b975e3e3761fcf0cda7@%3Cdev.beam.apache.org%3E).
 1. If your change is large or it is your first change, it is a good idea to
    [discuss it on the dev@ mailing list](/community/contact-us/).
 1. For large changes create a design doc
    ([template](https://s.apache.org/beam-design-doc-template),
    [examples](https://s.apache.org/beam-design-docs)) and email it to the 
[dev@ mailing list](/community/contact-us).
-
-### Development Setup {#development-setup}
-
-1. If you need help with git forking, cloning, branching, committing, pull 
requests, and squashing commits, see
-   [Git workflow 
tips](https://cwiki.apache.org/confluence/display/BEAM/Git+Tips)
-1. Familiarize yourself with gradle and the project structure. At the root of 
the git repository, run:

Review comment:
       Has this information moved somewhere else, or are we getting rid of it?

##########
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:
       It looks like something else has gone wrong with the style, now the 
buttons are separated from the box:
   
   
![image](https://user-images.githubusercontent.com/675055/106818501-3a250c00-662d-11eb-836a-9a25c68cde71.png)
   




----------------------------------------------------------------
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]


Reply via email to