Skip to content

Commit

Permalink
Configure position and disable require.js via nbsphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Jul 21, 2023
1 parent b9be19a commit 2793b0c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@
"myst_parser",
"sphinx_inline_tabs",
"sphinxcontrib.bibtex",
"sphinx_docsearch",
"sphinx_last_updated_by_git",
"nbsphinx",
"nbsphinx", # to be kept below JS-enabled extensions always
"IPython.sphinxext.ipython_console_highlighting",
"sphinx_gallery.load_style",
"hoverxref.extension",
"sphinx_docsearch",
]


Expand Down Expand Up @@ -156,6 +156,8 @@
"check_switcher": True,
# for dark mode toggle, version switcher, and social media links
"navbar_end": ["theme-switcher", "version-switcher", "navbar-icon-links"],
# add Algolia to the persistent navbar, this removes the default search icon
"navbar_persistent": "algolia-searchbox",
"use_edit_page_button": True,
"pygment_light_style": "xcode",
"pygment_dark_style": "monokai",
Expand Down Expand Up @@ -286,6 +288,10 @@

# -- nbsphinx configuration options ------------------------------------------

# Important: ensure require.js is not loaded. this is needed to avoid
# a conflict with the sphinx-docsearch extension for Algolia search

nbsphinx_requirejs_path = ""
nbsphinx_prolog = r"""
{% set github_docname =
Expand Down Expand Up @@ -380,9 +386,9 @@
docsearch_index_name = "pybamm"

# Searchbox settings
docsearch_container = "search-button__search-container"
docsearch_container = "#algolia-docsearch"
docsearch_placeholder = "Search PyBaMM `Ctrl` + `K`"
docsearch_initial_query = "API"
# docsearch_initial_query = "API"

# -- Jinja templating --------------------------------------------------------
# Credit to: https://ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
Expand Down

0 comments on commit 2793b0c

Please sign in to comment.