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

Feat Request: sphinx-book-theme (pydata fork) #62

Open
dylanh724 opened this issue Jan 9, 2025 · 3 comments
Open

Feat Request: sphinx-book-theme (pydata fork) #62

dylanh724 opened this issue Jan 9, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@dylanh724
Copy link

dylanh724 commented Jan 9, 2025

You guys support pydata, but sphinx-book-theme is a very popular fork (many enterprise folks use it, including Unreal Engine docs) - would love to see official support.

Our [source-available] docs for Xsolla Backend at https://docs.goxbe.io also use this theme.

Would love to see official support! In Sphinx 8, here's what we currently do to make it work:

  1. Fix this breaking bug: Breaking: Frontend UI poof bug #60

  2. Add a algoliaDocSearchSphinxBookThemeSupport.css to adjust container z-index and ensure the theme search is hidden:

/* 
##################################################################################
- Initial template suggestion from yafimvo @ 
  https://github.com/jupyter-book/jupyter-book/issues/1324#issuecomment-1512757574 
##################################################################################
*/

/* -- sphinx-book-theme Support --------------------------------------------------- */
/* Hide the old theme's (!Algolia's) search wrapper window when hitting Ctrl+K */
.search-button__wrapper, #search-input {
    display: none !important;
}

/* Make sure Algolia's search container is always on top */
.DocSearch.DocSearch-Container {
    z-index: 10000;
}

That's pretty much it, iirc!

@dylanh724
Copy link
Author

@kai687 Here's a full guide:

executablebooks/sphinx-book-theme#394 (comment)

@dylanh724
Copy link
Author

dylanh724 commented Jan 24, 2025

You also need this on init to unregister the old CTRL+K to prevent console errs, but they're anonymous so it's difficult to unregister. I opened a ticket:

pydata/pydata-sphinx-theme#2106

In f12 console, you can temporarily unregister in sphinx-book-theme via:

const sphinxPyDataCtrlKListener = getEventListeners(window).keydown[0].listener;
window.removeEventListener("keydown", sphinxPyDataCtrlKListener, true);

However, this func doesn't exist in regular js.

@dylanh724
Copy link
Author

dylanh724 commented Jan 24, 2025

Additionally, need to set kbd:not(.compound) { padding: unset; }, it seems, to prevent skewed hotkey visuals: #68 (comment)

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants