Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] Add support for docs link redirects with tabs interconnected #3409

Closed
ch3yne opened this issue May 16, 2024 · 2 comments · Fixed by #3861
Closed

[Improvement] Add support for docs link redirects with tabs interconnected #3409

ch3yne opened this issue May 16, 2024 · 2 comments · Fixed by #3861
Assignees
Labels
good first issue Good for newcomers improvement Improvements on everything

Comments

@ch3yne
Copy link
Contributor

ch3yne commented May 16, 2024

What would you like to be improved?

In the constructed document, there are tab options in different languages. In similar situations, need to switch between these tabs synchronously to viewing in a single language.

How should we improve?

<Tabs groupId='language' queryString>
  <TabItem value='shell' label='Shell'>Shell</TabItem>
  <TabItem value='java' label='Java'>Java</TabItem>
  <TabItem value='python' label='Python'>Python</TabItem>
</Tabs>

<Tabs groupId='language'>
  <TabItem value='shell' label='Shell'>Shell</TabItem>
  <TabItem value='java' label='Java'>Java</TabItem>
  <TabItem value='python' label='Python'>Python</TabItem>
</Tabs>

Example: Link to view the tab for java

[link](./link?language=java)
@ch3yne ch3yne added good first issue Good for newcomers improvement Improvements on everything labels May 16, 2024
@c00kie123
Copy link

Hey, what do you think of this change?

<Tabs groupId='language' queryString>
  <TabItem value='shell' label='Shell'>Shell</TabItem>
  <TabItem value='java' label='Java'>Java</TabItem>
  <TabItem value='python' label='Python'>Python</TabItem>
</Tabs>

<Tabs groupId='language' queryString>
  <TabItem value='shell' label='Shell'>Shell</TabItem>
  <TabItem value='java' label='Java'>Java</TabItem>
  <TabItem value='python' label='Python'>Python</TabItem>
</Tabs>

@ch3yne
Copy link
Contributor Author

ch3yne commented May 20, 2024

queryString is fine to define it once or multiple times when use the same groupId.

shaofengshi pushed a commit to shaofengshi/gravitino that referenced this issue Jun 24, 2024
…roupId='language' queryString> (apache#3861)

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

This pull request updates all `<Tabs>` components in the documentation
to support multi-language switching by adding `groupId='language'` and
`queryString` attributes. It also ensures that all related links in the
documentation include the appropriate `queryString` parameter for
language selection.

Changes include:
- Updating all `<Tabs>` components to the following format:
  ```markdown
  <Tabs groupId='language' queryString>
    <TabItem value="Json" label="Json">
      ```json
      {
        "direction": "asc",
        "nullOrder": "NULLS_LAST",
        "sortTerm":  {
          "type": "field",
          "fieldName": ["score"]
        }
      }
      ```
    </TabItem>
    <TabItem value="java" label="Java">
      ```java
SortOrders.of(NamedReference.field("score"), SortDirection.ASCENDING,
NullOrdering.NULLS_LAST);
      ```
    </TabItem>
  </Tabs>
****

### Why are the changes needed?

Fix: apache#3409
These changes are needed to enable multi-language support in the
documentation, allowing users to easily switch between different
language examples. This improves the usability and accessibility of the
documentation for a wider audience.

### Does this PR introduce any user-facing change?
Yes, this PR introduces the following user-facing changes:

Users can now switch between different language examples in the
documentation using a consistent interface.
Documentation links will now include queryString parameters to ensure
the correct language example is displayed.
How was this patch tested?
The changes were tested by:

-Not yet

Co-authored-by: LanceLin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement Improvements on everything
Projects
None yet
4 participants