Skip to content

Conversation

@panbingkun
Copy link
Contributor

What changes were proposed in this pull request?

The pr aims to fix bug for Switch languages consistently across docs for all code snippets.

Why are the changes needed?

When a user chooses a different language for a code snippet, all code snippets on that page should switch to the chosen language. This was the behavior for, for example, Spark 2.0 doc: https://spark.apache.org/docs/2.0.0/structured-streaming-programming-guide.html
But it was broken for later docs, for example the Spark 3.4.1 doc: https://spark.apache.org/docs/latest/quick-start.html
We should fix this behavior change and possibly add test cases to prevent future regressions.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Manually test:

cd docs
SKIP_API=1 bundle exec jekyll serve --watch

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the DOCS label Aug 24, 2023
@panbingkun
Copy link
Contributor Author

@zhengruifeng
Copy link
Contributor

also cc @gengliangwang @jasonli-db

@HyukjinKwon
Copy link
Member

cc @sarutak too FYI

Copy link
Member

@gengliangwang gengliangwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work!

@gengliangwang
Copy link
Member

Thanks, merging to master/branch-3.5

gengliangwang pushed a commit that referenced this pull request Aug 25, 2023
… code snippets

### What changes were proposed in this pull request?
The pr aims to fix bug for `Switch languages consistently across docs for all code snippets`.

### Why are the changes needed?
When a user chooses a different language for a code snippet, all code snippets on that page should switch to the chosen language. This was the behavior for, for example, Spark 2.0 doc: https://spark.apache.org/docs/2.0.0/structured-streaming-programming-guide.html
But it was broken for later docs, for example the Spark 3.4.1 doc: https://spark.apache.org/docs/latest/quick-start.html
We should fix this behavior change and possibly add test cases to prevent future regressions.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Manually test:
```
cd docs
SKIP_API=1 bundle exec jekyll serve --watch
```

### Was this patch authored or co-authored using generative AI tooling?
No.

Closes #42657 from panbingkun/SPARK-44820.

Authored-by: panbingkun <pbk1982@gmail.com>
Signed-off-by: Gengliang Wang <gengliang@apache.org>
(cherry picked from commit 4748d85)
Signed-off-by: Gengliang Wang <gengliang@apache.org>
@zhengruifeng
Copy link
Contributor

@panbingkun thank you so much for helping fix this!

HyukjinKwon added a commit that referenced this pull request Sep 19, 2023
…r all code snippets (Spark 3.4 and below)

### What changes were proposed in this pull request?

This PR proposes to recover the availity of switching languages consistently across docs for all code snippets in Spark 3.4 and below by using the proper class selector in the JQuery. Previously the selector was a string `.nav-link tab_python` which did not comply multiple class selection: https://www.w3.org/TR/CSS21/selector.html#class-html. I assume it worked as a legacy behaviour somewhere. Now it uses the standard way `.nav-link.tab_python`.

Note that #42657 works because there's only single class assigned (after we refactored the site at #40269)

### Why are the changes needed?

This is a regression in our documentation site.

### Does this PR introduce _any_ user-facing change?

Yes, once you click the language tab, it will apply to the examples in the whole page.

### How was this patch tested?

Manually tested after building the site.

![Screenshot 2023-09-19 at 12 08 17 PM](https://github.com/apache/spark/assets/6477701/09d0c117-9774-4404-8e2e-d454b7f700a3)

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #42989 from HyukjinKwon/SPARK-45210.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit 796d878)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
HyukjinKwon added a commit that referenced this pull request Sep 19, 2023
…r all code snippets (Spark 3.4 and below)

### What changes were proposed in this pull request?

This PR proposes to recover the availity of switching languages consistently across docs for all code snippets in Spark 3.4 and below by using the proper class selector in the JQuery. Previously the selector was a string `.nav-link tab_python` which did not comply multiple class selection: https://www.w3.org/TR/CSS21/selector.html#class-html. I assume it worked as a legacy behaviour somewhere. Now it uses the standard way `.nav-link.tab_python`.

Note that #42657 works because there's only single class assigned (after we refactored the site at #40269)

### Why are the changes needed?

This is a regression in our documentation site.

### Does this PR introduce _any_ user-facing change?

Yes, once you click the language tab, it will apply to the examples in the whole page.

### How was this patch tested?

Manually tested after building the site.

![Screenshot 2023-09-19 at 12 08 17 PM](https://github.com/apache/spark/assets/6477701/09d0c117-9774-4404-8e2e-d454b7f700a3)

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #42989 from HyukjinKwon/SPARK-45210.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
HyukjinKwon added a commit that referenced this pull request Sep 19, 2023
…r all code snippets (Spark 3.4 and below)

### What changes were proposed in this pull request?

This PR proposes to recover the availity of switching languages consistently across docs for all code snippets in Spark 3.4 and below by using the proper class selector in the JQuery. Previously the selector was a string `.nav-link tab_python` which did not comply multiple class selection: https://www.w3.org/TR/CSS21/selector.html#class-html. I assume it worked as a legacy behaviour somewhere. Now it uses the standard way `.nav-link.tab_python`.

Note that #42657 works because there's only single class assigned (after we refactored the site at #40269)

### Why are the changes needed?

This is a regression in our documentation site.

### Does this PR introduce _any_ user-facing change?

Yes, once you click the language tab, it will apply to the examples in the whole page.

### How was this patch tested?

Manually tested after building the site.

![Screenshot 2023-09-19 at 12 08 17 PM](https://github.com/apache/spark/assets/6477701/09d0c117-9774-4404-8e2e-d454b7f700a3)

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #42989 from HyukjinKwon/SPARK-45210.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit 796d878)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
HyukjinKwon added a commit that referenced this pull request Sep 19, 2023
…r all code snippets (Spark 3.4 and below)

### What changes were proposed in this pull request?

This PR proposes to recover the availity of switching languages consistently across docs for all code snippets in Spark 3.4 and below by using the proper class selector in the JQuery. Previously the selector was a string `.nav-link tab_python` which did not comply multiple class selection: https://www.w3.org/TR/CSS21/selector.html#class-html. I assume it worked as a legacy behaviour somewhere. Now it uses the standard way `.nav-link.tab_python`.

Note that #42657 works because there's only single class assigned (after we refactored the site at #40269)

### Why are the changes needed?

This is a regression in our documentation site.

### Does this PR introduce _any_ user-facing change?

Yes, once you click the language tab, it will apply to the examples in the whole page.

### How was this patch tested?

Manually tested after building the site.

![Screenshot 2023-09-19 at 12 08 17 PM](https://github.com/apache/spark/assets/6477701/09d0c117-9774-4404-8e2e-d454b7f700a3)

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #42989 from HyukjinKwon/SPARK-45210.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
(cherry picked from commit 796d878)
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
viirya pushed a commit to viirya/spark-1 that referenced this pull request Oct 19, 2023
…r all code snippets (Spark 3.4 and below)

### What changes were proposed in this pull request?

This PR proposes to recover the availity of switching languages consistently across docs for all code snippets in Spark 3.4 and below by using the proper class selector in the JQuery. Previously the selector was a string `.nav-link tab_python` which did not comply multiple class selection: https://www.w3.org/TR/CSS21/selector.html#class-html. I assume it worked as a legacy behaviour somewhere. Now it uses the standard way `.nav-link.tab_python`.

Note that apache#42657 works because there's only single class assigned (after we refactored the site at apache#40269)

### Why are the changes needed?

This is a regression in our documentation site.

### Does this PR introduce _any_ user-facing change?

Yes, once you click the language tab, it will apply to the examples in the whole page.

### How was this patch tested?

Manually tested after building the site.

![Screenshot 2023-09-19 at 12 08 17 PM](https://github.com/apache/spark/assets/6477701/09d0c117-9774-4404-8e2e-d454b7f700a3)

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#42989 from HyukjinKwon/SPARK-45210.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants