@@ -24,24 +24,6 @@ def holoviz_icon_white(cur_file):
2424 return str (icon_path )
2525
2626
27- def setup (app ):
28- try :
29- from nbsite .paramdoc import param_formatter , param_skip
30- app .connect ('autodoc-process-docstring' , param_formatter )
31- app .connect ('autodoc-skip-member' , param_skip )
32- except ImportError :
33- print ('no param_formatter (no param?)' )
34-
35- nbbuild .setup (app )
36- app .connect ("builder-inited" , remove_mystnb_static )
37-
38- def remove_mystnb_static (app ):
39- # Ensure our myst_nb.css is loaded by removing myst_nb static_path
40- # from config
41- app .config .html_static_path = [
42- p for p in app .config .html_static_path if 'myst_nb' not in p
43- ]
44-
4527extensions = [
4628 'myst_nb' ,
4729 'sphinx_design' ,
@@ -105,7 +87,8 @@ def remove_mystnb_static(app):
10587 'gallery.css' ,
10688 'alert.css' ,
10789 'dataframe.css' ,
108- 'scroller.css'
90+ 'scroller.css' ,
91+ 'hv-sidebar-dropdown.css' ,
10992]
11093
11194# A single line footer that includes the copyright and the last updated date.
@@ -123,8 +106,8 @@ def remove_mystnb_static(app):
123106# The layout.html template in pydata-sphinx-theme removes the default
124107# sidebar-nav-bs.html template.
125108html_sidebars = {
126- "index" : ["sidebar-nav-bs-alt" ],
127- "**" : ["sidebar-nav-bs-alt" ],
109+ "index" : ["sidebar-nav-bs-alt" , "hv-sidebar-dropdown" ],
110+ "**" : ["sidebar-nav-bs-alt" , "hv-sidebar-dropdown" ],
128111}
129112
130113# To be reused in a conf.py file to define the `copyright` string reused
@@ -207,3 +190,94 @@ def linkcode_resolve(domain, info):
207190 return f"{ GITHUB_BASE_URL } { package } /blob/main/{ package } /{ fn } { linespec } "
208191 else :
209192 return f"{ GITHUB_BASE_URL } { package } /blob/v{ pver } /{ package } /{ fn } { linespec } "
193+
194+
195+ nbsite_hv_sidebar_dropdown = {
196+ 'dropdown_value' : {
197+ 'href' : 'https://holoviz.org' ,
198+ 'text' : 'HoloViz.org' ,
199+ },
200+ 'libraries' : {
201+ 'panel' : {
202+ 'text' : 'Panel' ,
203+ 'url' : 'https://param.holoviz.org' ,
204+ 'title' : 'Assembling objects from many different libraries into a layout or app, whether in a Jupyter notebook or in a standalone servable dashboard' ,
205+ },
206+ 'hvplot' : {
207+ 'text' : 'hvPlot' ,
208+ 'url' : 'https://hvplot.holoviz.org' ,
209+ 'title' : 'Quickly return interactive HoloViews, GeoViews, or Panel objects from Pandas, Xarray, or other data structures' ,
210+ },
211+ 'holoviews' : {
212+ 'text' : 'HoloViews' ,
213+ 'url' : 'https://holoviews.org' ,
214+ 'title' : 'Declarative objects for instantly visualizable data, building Bokeh plots from convenient high-level specifications' ,
215+ },
216+ 'geoviews' : {
217+ 'text' : 'GeoViews' ,
218+ 'url' : 'https://geoviews.org' ,
219+ 'title' : 'Visualizable geographic data that that can be mixed and matched with HoloViews objects' ,
220+ },
221+ 'datashader' : {
222+ 'text' : 'Datashader' ,
223+ 'url' : 'https://datashader.org' ,
224+ 'title' : 'Rasterizing huge datasets quickly as fixed-size images' ,
225+ },
226+ 'param' : {
227+ 'text' : 'Param' ,
228+ 'url' : 'https://param.holoviz.org' ,
229+ 'title' : 'Make your Python code clearer and more reliable by declaring Parameters' ,
230+ },
231+ 'lumen' : {
232+ 'text' : 'Lumen' ,
233+ 'url' : 'https://lumen.holoviz.org' ,
234+ 'title' : 'Framework for visual analytics that allows users to build data-driven dashboards from a simple YAML specification' ,
235+ },
236+ 'colorcet' : {
237+ 'text' : 'Colorcet' ,
238+ 'url' : 'https://colorcet.holoviz.org' ,
239+ 'title' : 'A wide range of perceptually uniform continuous colormaps and perceptually based categorical color sets for use with the other libraries' ,
240+ },
241+ },
242+ 'others' : {
243+ 'examples' : {
244+ 'text' : 'Examples Gallery' ,
245+ 'url' : 'https://examples.holoviz.org' ,
246+ 'title' : ' Visualization-focused examples using HoloViz for specific topics ' ,
247+ },
248+ 'blog' : {
249+ 'text' : 'Blog' ,
250+ 'url' : 'https://blog.holoviz.org' ,
251+ 'title' : 'HoloViz blog' ,
252+ },
253+ },
254+ }
255+
256+
257+ def remove_mystnb_static (app ):
258+ # Ensure our myst_nb.css is loaded by removing myst_nb static_path
259+ # from config
260+ app .config .html_static_path = [
261+ p for p in app .config .html_static_path if 'myst_nb' not in p
262+ ]
263+
264+
265+ def add_hv_sidebar_dropdown_context (app , pagename , templatename , context , doctree , * args ) -> None :
266+ # Inject it in the context to make it available to the template namespace.s
267+ context ['hv_sidebar_dropdown' ] = app .config .nbsite_hv_sidebar_dropdown
268+
269+
270+ def setup (app ):
271+ try :
272+ from nbsite .paramdoc import param_formatter , param_skip
273+ app .connect ('autodoc-process-docstring' , param_formatter )
274+ app .connect ('autodoc-skip-member' , param_skip )
275+ except ImportError :
276+ print ('no param_formatter (no param?)' )
277+
278+ nbbuild .setup (app )
279+ app .connect ("builder-inited" , remove_mystnb_static )
280+
281+ # hv_sidebar_dropdown
282+ app .add_config_value ('nbsite_hv_sidebar_dropdown' , {}, 'html' )
283+ app .connect ("html-page-context" , add_hv_sidebar_dropdown_context )
0 commit comments