Conversation
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
* renamed file * updated conf.py to load corresponding navbar js * Added comments Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
…if doxygen files are opened * Updated rtd theme options Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
| if config.html_theme == "sphinx_book_theme": | ||
| app.add_js_file("js/customize-navbar-book.js") | ||
|
|
||
| elif config.html_theme == "sphinx_rtd_theme": | ||
| app.add_js_file("js/customize-navbar-rtd.js") | ||
| config.html_theme_options["collapse_navigation"] = False |
There was a problem hiding this comment.
Sorry for being nosey here, but could there be some kind of explicit option to get these files?
For ROCm documentation our theme is a slightly modified version of the Sphinx Book Theme (custom headers and footers), and I'm certain the js file for that theme would work for us as well, so it would be nice if we could enable this fix somehow.
There was a problem hiding this comment.
We are planning to provide these files as part of an extension which will be part of Doxysphinx. So hopefully you won't need to add anything manually.
There was a problem hiding this comment.
What I meant is the current logic wouldn't work for us because config.html_theme wouldn't be sphinx_rtd_theme, so it would be good to have another way to enable this.
There was a problem hiding this comment.
@Maetveis So you have an own version of the sphinx book theme with a different name, e.g. "sphinx-book-theme-custom" right? In that case as you said his extension won't do anything for you.
But you could still use the jsfile as it's in the doxysphinx-theme package directory.
Maybe a little bit cumbersome to reference though, however here's a rough sketch of the idea (untested!):
#<conf.py>
from pathlib import Path
from importlib.resources import files
# ...
patch_js_path = Path(files("doxysphinx_theme")) / "_static/js/customize-navbar-book.js"
html_theme_options = {
'extra_scripts': [str(patch_js_path)]
}But this might be only working in python 3.11+.
There was a problem hiding this comment.
Yes that's exactly what we have.
I think I'll be able to make something like that work, the only slight issue with it is that I need to "know" implementation details of doxysphinx, I guess that is a price for having "forked" a theme.
I'll try this out and maybe do a PR if I come up with a way to have less coupling. Thank you for the help.
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
Signed-off-by: Aniket Salve(XC-DX/EPG2) <aniketdilip.salve@bosch.com>
Added custom JS for rtd theme and books theme in order to maintain the last navigation state highlighted in navbar when doxygen files are opened