Jakub-Sadowski commented on a change in pull request #13565: URL: https://github.com/apache/beam/pull/13565#discussion_r570093423
########## 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: okay I will modify 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: Yes, ur right, I will modify it accordingly ########## 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: we are getting rid of it ########## 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: okay I will just take contents from website-revamp branch ########## File path: website/www/site/content/en/contribute/_index.md ########## @@ -21,55 +24,61 @@ See the License for the specific language governing permissions and limitations under the License. --> -# Apache Beam Contribution Guide +# Contribution guide + +<a class="arrow-list-header" data-toggle="collapse" href="#collapseOverview" role="button" aria-expanded="false" aria-controls="collapseOverview"> + {{< figure src="/images/arrow-icon_list.svg">}} Review comment: Yes it was all intentional, only form of the headings are to be fixed ########## File path: website/www/site/content/en/contribute/_index.md ########## @@ -21,55 +24,61 @@ See the License for the specific language governing permissions and limitations under the License. --> -# Apache Beam Contribution Guide +# Contribution guide + +<a class="arrow-list-header" data-toggle="collapse" href="#collapseOverview" role="button" aria-expanded="false" aria-controls="collapseOverview"> + {{< figure src="/images/arrow-icon_list.svg">}} + +## Overview + +</a> + +<div class="collapse dont-collapse-sm" id="collapseOverview"> -The Apache Beam community welcomes contributions from anyone! +There are lots of opportunities to contribute. You can for example: -If you have questions, please [reach out to the Beam community](/contribute/get-help). +* ask or answer questions on [[email protected]](/community/contact-us/) or + [stackoverflow](https://stackoverflow.com/questions/tagged/apache-beam) +* review proposed design ideas on [[email protected]](/community/contact-us/) +* file [bug reports](https://issues.apache.org/jira/projects/BEAM/issues) +* review [changes](https://github.com/apache/beam/pulls) +* work on the core programming model (what is a Beam pipeline and how does it + run?) +* improve the developer experience (for example, Windows guides) +* organize local meetups of users or contributors to Apache Beam -There are lots of opportunities to contribute: +...and many more. Most importantly, if you have an idea of how to contribute, then do it! - - ask or answer questions on [[email protected]](/community/contact-us/) or -[stackoverflow](https://stackoverflow.com/questions/tagged/apache-beam) - - review proposed design ideas on [[email protected]](/community/contact-us/) - - improve the documentation - - file [bug reports](https://issues.apache.org/jira/projects/BEAM/issues) - - test releases - - review [changes](https://github.com/apache/beam/pulls) - - write new examples - - improve your favorite language SDK (Java, Python, Go, etc) - - improve specific runners (Apache Flink, Apache Spark, Google - Cloud Dataflow, etc) - - improve or add IO connectors - - add new transform libraries (statistics, ML, image processing, etc) - - work on the core programming model (what is a Beam pipeline and how does it - run?) - - improve the developer experience (for example, Windows guides) - - add answers to the [contribution FAQ]( - https://cwiki.apache.org/confluence/display/BEAM/Contributor+FAQ) - - organize local meetups of users or contributors to Apache Beam +</div> -Most importantly, if you have an idea of how to contribute, then do it! +<a class="arrow-list-header" data-toggle="collapse" href="#collapseContributing" role="button" aria-expanded="false" aria-controls="collapseContributing"> + {{< figure src="/images/arrow-icon_list.svg">}} ## Contributing code + </a> + +<div class="collapse dont-collapse-sm" id="collapseContributing"> + Below is a tutorial for contributing code to Beam, covering our tools and typical process in detail. ### Prerequisites -To contribute code, you need +* a GitHub account +* a Linux, macOS, or Microsoft Windows development environment with Java JDK 8 installed +* [Docker](https://www.docker.com/) installed for some tasks including building worker containers and testing this website + changes locally +* [Go](https://golang.org) 1.12 or later installed for Go SDK development +* Python 3.6, 3.7, and 3.8. Yes, you need all four versions installed. + + pip, setuptools, virtualenv, and tox installed for Python development + +* for large contributions, a signed [Individual Contributor License + Agreement](https://www.apache.org/licenses/icla.pdf) (ICLA) to the Apache + Software Foundation (ASF). - - a GitHub account - - a Linux, macOS, or Microsoft Windows development environment with Java JDK 8 installed - - [Docker](https://www.docker.com/) installed for some tasks including building worker containers and testing this website - changes locally - - [Go](https://golang.org) 1.12 or later installed for Go SDK development - - Python 3.6, 3.7, and 3.8. Yes, you need all three versions installed. - - pip, setuptools, virtualenv, and tox installed for Python development - - for large contributions, a signed [Individual Contributor License - Agreement](https://www.apache.org/licenses/icla.pdf) (ICLA) to the Apache - Software Foundation (ASF). Review comment: Okay I will adjust the layout to content from website-revamp branch and the community will consider changing it later ########## File path: website/www/site/content/en/contribute/_index.md ########## @@ -21,55 +24,61 @@ See the License for the specific language governing permissions and limitations under the License. --> -# Apache Beam Contribution Guide +# Contribution guide + +<a class="arrow-list-header" data-toggle="collapse" href="#collapseOverview" role="button" aria-expanded="false" aria-controls="collapseOverview"> + {{< figure src="/images/arrow-icon_list.svg">}} + +## Overview + +</a> + +<div class="collapse dont-collapse-sm" id="collapseOverview"> -The Apache Beam community welcomes contributions from anyone! +There are lots of opportunities to contribute. You can for example: -If you have questions, please [reach out to the Beam community](/contribute/get-help). +* ask or answer questions on [[email protected]](/community/contact-us/) or + [stackoverflow](https://stackoverflow.com/questions/tagged/apache-beam) +* review proposed design ideas on [[email protected]](/community/contact-us/) +* file [bug reports](https://issues.apache.org/jira/projects/BEAM/issues) +* review [changes](https://github.com/apache/beam/pulls) +* work on the core programming model (what is a Beam pipeline and how does it + run?) +* improve the developer experience (for example, Windows guides) +* organize local meetups of users or contributors to Apache Beam -There are lots of opportunities to contribute: +...and many more. Most importantly, if you have an idea of how to contribute, then do it! Review comment: should be good now ########## File path: website/www/site/content/en/contribute/_index.md ########## @@ -21,55 +24,61 @@ See the License for the specific language governing permissions and limitations under the License. --> -# Apache Beam Contribution Guide +# Contribution guide + +<a class="arrow-list-header" data-toggle="collapse" href="#collapseOverview" role="button" aria-expanded="false" aria-controls="collapseOverview"> + {{< figure src="/images/arrow-icon_list.svg">}} + +## Overview + +</a> + +<div class="collapse dont-collapse-sm" id="collapseOverview"> -The Apache Beam community welcomes contributions from anyone! +There are lots of opportunities to contribute. You can for example: -If you have questions, please [reach out to the Beam community](/contribute/get-help). +* ask or answer questions on [[email protected]](/community/contact-us/) or + [stackoverflow](https://stackoverflow.com/questions/tagged/apache-beam) +* review proposed design ideas on [[email protected]](/community/contact-us/) +* file [bug reports](https://issues.apache.org/jira/projects/BEAM/issues) +* review [changes](https://github.com/apache/beam/pulls) +* work on the core programming model (what is a Beam pipeline and how does it + run?) +* improve the developer experience (for example, Windows guides) +* organize local meetups of users or contributors to Apache Beam -There are lots of opportunities to contribute: +...and many more. Most importantly, if you have an idea of how to contribute, then do it! Review comment: hmm weird okay, I will try again, and if without success then I will simply remove it ########## File path: website/www/site/content/en/contribute/_index.md ########## @@ -21,55 +24,61 @@ See the License for the specific language governing permissions and limitations under the License. --> -# Apache Beam Contribution Guide +# Contribution guide + +<a class="arrow-list-header" data-toggle="collapse" href="#collapseOverview" role="button" aria-expanded="false" aria-controls="collapseOverview"> + {{< figure src="/images/arrow-icon_list.svg">}} Review comment: okay I will check it out ########## File path: website/www/site/static/js/copy-to-clipboard.js ########## @@ -0,0 +1,42 @@ +// Licensed under the Apache License, Version 2.0 (the 'License'); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +$(document).ready(function() { + function copy() { + $(".copy").click(function(){ + var text=$(this).siblings()[$(this).siblings().length-1].childNodes[0].innerHTML; + const el=document.createElement('textarea'); + el.value=text;document.body.appendChild(el); + el.select();document.execCommand('copy'); + document.body.removeChild(el); + alert('copied to clipboard'); + }) + $(".just-copy").click(function(){ + var text=$(this).parent().siblings()[0].innerHTML; + const el=document.createElement('textarea'); + el.value=text;document.body.appendChild(el); + el.select();document.execCommand('copy'); + document.body.removeChild(el); + alert('copied to clipboard'); Review comment: From fastest ways I can change it to pop up under a button, but then there would be no popover when user hover on an icon ########## File path: website/www/site/content/en/contribute/_index.md ########## @@ -21,55 +24,61 @@ See the License for the specific language governing permissions and limitations under the License. --> -# Apache Beam Contribution Guide +# Contribution guide + +<a class="arrow-list-header" data-toggle="collapse" href="#collapseOverview" role="button" aria-expanded="false" aria-controls="collapseOverview"> + {{< figure src="/images/arrow-icon_list.svg">}} Review comment: It was designed that way because there was less text, so for now I moved the `div` lower ---------------------------------------------------------------- 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]
