Skip to content

docs: Add API version label to search result item#13005

Merged
htuch merged 12 commits intoenvoyproxy:masterfrom
dio:version-label
Sep 14, 2020
Merged

docs: Add API version label to search result item#13005
htuch merged 12 commits intoenvoyproxy:masterfrom
dio:version-label

Conversation

@dio
Copy link
Member

@dio dio commented Sep 8, 2020

Commit Message: This adds API version labels to search result items. This overrides the sphinx-docs' searchtools.js.

Additional Description:

A sample of search result page: https://379378-65214191-gh.circle-artifacts.com/0/generated/docs/search.html?q=route&check_keywords=yes&area=default

Depends on: #13008.

Risk Level: Low, cosmetics.
Testing: N/A
Docs Changes: N/A
Release Notes: N/A

Fixes #10311

Signed-off-by: Dhi Aurrahman dio@tetrate.io

This adds version label to search result items.

Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
@dio
Copy link
Member Author

dio commented Sep 8, 2020

@dio dio changed the title docs: Add version label docs: Add version label to search result item Sep 8, 2020
dio added 4 commits September 8, 2020 12:25
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
@dio dio marked this pull request as ready for review September 8, 2020 11:08
@dio dio changed the title docs: Add version label to search result item docs: Add API version label to search result item Sep 8, 2020
@htuch
Copy link
Member

htuch commented Sep 8, 2020

@dio I added "Fixed #10311" to the top-level comment, since I think this is a solution for that, nice.

*/

// Modified from https://raw.githubusercontent.com/sphinx-doc/sphinx/3.x/sphinx/themes/basic/static/searchtools.js
// to have renderApiVersionLabel to render the API version for each search result item.
Copy link
Member

Choose a reason for hiding this comment

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

@dio could you do a baseline PR to check in the original searchtools.js, that way we can review just the delta here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. #13008.

@htuch
Copy link
Member

htuch commented Sep 8, 2020

FYI @snowp

@htuch htuch self-assigned this Sep 8, 2020
@dio dio mentioned this pull request Sep 8, 2020
htuch pushed a commit that referenced this pull request Sep 10, 2020
This imports searchtools.js from https://raw.githubusercontent.com/sphinx-doc/sphinx/3.x/sphinx/themes/basic/static/searchtools.js.

#13005 (comment)

Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
dio added 5 commits September 11, 2020 04:22
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
@dio
Copy link
Member Author

dio commented Sep 11, 2020

@htuch
Copy link
Member

htuch commented Sep 11, 2020

LGTM, but I disclaim any knowledge of CSS.

@dio looking at the rendered results at https://380399-65214191-gh.circle-artifacts.com/0/generated/docs/search.html?q=cluster&check_keywords=yes&area=default and the CSS, it looks like you are also modifying the test of the doc style. Is there a reason we need to do that in this PR?

@dio
Copy link
Member Author

dio commented Sep 11, 2020

It is not. The only entry that is mandatory is: .api-version-label I will remove the rest and pick a neutral color for api version label.

dio added 2 commits September 12, 2020 06:28
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
/* To style the API version label of a search result item */
.api-version-label {
border-radius: 20%;
background-color: #c0c0c0;
Copy link
Member Author

Choose a reason for hiding this comment

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

"silver". We can always change it later when we want to re-style the entire docs.

image

@dio
Copy link
Member Author

dio commented Sep 11, 2020

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I think if you do want a separate PR delving into color schemes that's totally legit, but that's the bike shed painting :)

@htuch htuch merged commit 3d37973 into envoyproxy:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better handle v2/v3 split in docs search

2 participants