Skip to content

Commit 6b50eff

Browse files
committed
1 parent 7f7cd92 commit 6b50eff

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/conf.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import sys
1111
import urllib3
1212
import shutil
13+
import numpy as np
1314
sys.path.insert(0, os.path.abspath('..'))
1415

1516
import imkar # noqa
@@ -117,7 +118,8 @@
117118
"navbar_start": ["navbar-logo"],
118119
"navbar_end": ["navbar-icon-links", "theme-switcher"],
119120
"navbar_align": "content",
120-
"header_links_before_dropdown": 8,
121+
"header_links_before_dropdown": None, # will be automatically set later based on headers.rst
122+
"header_dropdown_text": "Packages", # Change dropdown name from "More" to "Packages"
121123
"icon_links": [
122124
{
123125
"name": "GitHub",
@@ -183,3 +185,13 @@ def download_files_from_gallery(link, folders_in):
183185
# add project to the list of projects if not in header
184186
if not contains_project:
185187
fout.write(f' {project} <{project}>\n')
188+
189+
# count the number of gallery headings
190+
count_gallery_headings = np.sum(
191+
['https://pyfar-gallery.readthedocs.io' in line for line in lines])
192+
193+
194+
# set dropdown header after gallery headings
195+
html_theme_options['header_links_before_dropdown'] = count_gallery_headings+1
196+
197+

0 commit comments

Comments
 (0)