-
Notifications
You must be signed in to change notification settings - Fork 8
feat: dropdown for navigation bar #723
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
base: main
Are you sure you want to change the base?
Conversation
29fb239
to
f7b238c
Compare
…-sphinx-theme into feat/navbar-dropdown
raise ValueError(f"Error parsing YAML file '{navigation_yaml_file}': {exc}") | ||
|
||
|
||
NavEntry = Dict[str, Union[str, List["NavEntry"]]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a docstring for this so we remember its goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this feature, @Revathyvenugopal162. I left some suggestions.
Co-authored-by: Jorge Martínez <[email protected]>
Co-authored-by: Jorge Martínez <[email protected]>
…-sphinx-theme into feat/navbar-dropdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I am qualified to review this PR (at all), but I did enjoy doing it.
So feel free to discard all my comments.
Other than that, it looks like a great addition. If I were you I would consider it to port it to the upstream packages.
Good job!
…-sphinx-theme into feat/navbar-dropdown
Co-authored-by: German <[email protected]>
divs = li.find_all("div", {"class": "navbar-dropdown"}, recursive=False) | ||
if divs: | ||
ref = li.find("div", {"class": "ref-container"}) | ||
ref.append(soup.new_tag("i", attrs={"class": "fa-solid fa-chevron-down"})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that the chevrons have their class, so it is easier to customise it through CSS files.
I wonder if you have set an specific class name for the items in each dropdown, so we can do something similar (or use bs4 easily on them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, We have the specific container for navbar-dropdown
as you can see in the line L#131.
In this PR:
This PR introduces support for a dropdown list in the navigation bar, allowing users to enable this option if desired.
Images
Images included below to showcase the updated navigation bar and dropdown functionality.

