-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix nav-bar text and links #56
Conversation
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.
Other things related to this:
-
Create a
CSS_FILENAME = "paynsys_sphinx_theme.css"
constant at the top of this file. -
Make the
get_html_theme_path
return aPath
instance and not a list. Add docstrings to this function too. -
Use
theme_css_path = theme_path / f"static/css/{CSS_FILENAME}
instead of theos.path.join
method.
src/pyansys_sphinx_theme/__init__.py
Outdated
if not os.path.isfile(theme_css_path): | ||
raise FileNotFoundError(f"Unable to locate pyansys-sphinx theme at {theme_css_path}") |
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.
These lines are important, as they check if the CSS file exists.
What I am surprised is the fact that, if our CSS is not being loaded as you said, then why this logic did not trigger?
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.
it is because, i think the file is loading in to static/ css when we are doing add_css_file. but we are putting the full path make it to load static/ css / html_path which we are adding
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.
You are right, I just checked the official docs: https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_css_file
Steps to solve for this:
|
Co-authored-by: Alex Kaszynski <[email protected]>
Co-authored-by: Alex Kaszynski <[email protected]>
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.
We're mixing the usage of os
and pathlib.Path
right now, but this is good to go as is. We can refactor later.
Please incorporate my suggestions.
Co-authored-by: Alex Kaszynski <[email protected]>
* fix nav-bar text and links * add css path * add css path using pathlib * Update src/pyansys_sphinx_theme/__init__.py Co-authored-by: Alex Kaszynski <[email protected]> * Update theme path Co-authored-by: Alex Kaszynski <[email protected]> * Update path using pathlib Co-authored-by: Alex Kaszynski <[email protected]> * update path using pathlib Co-authored-by: Alex Kaszynski <[email protected]>
fix #55 wrong nav-bar text and link colors