1+ import json
2+ import os
3+
4+ version = os .environ .get ("WEBSITE_VERSION" , "dev" )
5+ language = os .environ .get ("WEBSITE_LANGUAGE" , "en" )
6+
7+ baseurl = 'https://discover-cookbook.numfocus.org'
8+
9+ # Load language data from languages.json
10+ language_json_path = os .path .join (os .path .dirname (__file__ ), '_static' , 'languages.json' )
11+ language_data = []
12+ current_language_name = None
13+ if os .path .exists (language_json_path ):
14+ with open (language_json_path , 'r' , encoding = 'utf-8' ) as f :
15+ all_languages = json .load (f )
16+
17+ # Get the current language name
18+ current_language_name = next ((lang ['name_local' ] for lang in all_languages if lang ['code' ] == language ), language )
19+
20+ # Filter out hidden languages for the dropdown
21+ language_data = [lang for lang in all_languages if not lang .get ('hidden' , False )]
22+
23+ html_context = {
24+ "languages" : language_data ,
25+ "current_language_name" : current_language_name ,
26+ "current_language" : language ,
27+ "current_version" : version ,
28+ "baseurl" : baseurl
29+ }
30+
31+ html_baseurl = baseurl
32+
33+ author = 'Community'
34+ comments_config = {'hypothesis' : False , 'utterances' : False }
35+ copyright = '2023'
36+ exclude_patterns = ['**.ipynb_checkpoints' , '.DS_Store' , 'Thumbs.db' , '_build' ]
37+ extensions = ['sphinx_togglebutton' , 'sphinx_copybutton' , 'myst_nb' , 'jupyter_book' , 'sphinx_external_toc' , 'sphinx.ext.intersphinx' , 'sphinx_design' , 'sphinx_book_theme' , 'sphinx_tags' , 'sphinx_jupyterbook_latex' , 'sphinx_multitoc_numbering' ]
38+ external_toc_exclude_missing = False
39+ external_toc_path = '_toc.yml'
40+ html_baseurl = ''
41+ html_favicon = ''
42+ html_logo = 'logo.png'
43+ html_sourcelink_suffix = ''
44+ html_static_path = ['_static' ]
45+ html_theme = 'sphinx_book_theme'
46+ templates_path = ["_templates" ]
47+ html_theme_options = {
48+ 'search_bar_text' : 'Search this book...' ,
49+ 'launch_buttons' : {'notebook_interface' : 'classic' , 'binderhub_url' : '' , 'jupyterhub_url' : '' , 'thebe' : False , 'colab_url' : '' , 'deepnote_url' : '' },
50+ 'path_to_docs' : 'DISCOVER' ,
51+ 'repository_url' : 'https://github.com/numfocus/DISCOVER-Cookbook/' ,
52+ 'repository_branch' : 'main' ,
53+ 'extra_footer' : '' ,
54+ 'home_page_in_toc' : True ,
55+ 'announcement' : '' ,
56+ 'analytics' : {'google_analytics_id' : '' , 'plausible_analytics_domain' : '' , 'plausible_analytics_url' : 'https://plausible.io/js/script.js' },
57+ 'use_repository_button' : True ,
58+ 'use_edit_page_button' : False ,
59+ 'use_issues_button' : True ,
60+
61+
62+ "article_header_start" : ["toggle-primary-sidebar" ,"version-switcher" ,"language-switcher" ],
63+ "navigation_with_keys" : False ,
64+ "show_version_warning_banner" : True ,
65+ "switcher" : {
66+ "json_url" : "https://discover-cookbook.numfocus.org/versions.json" ,
67+ "version_match" : version ,
68+ },
69+ }
70+
71+ html_title = 'DISCOVER'
72+ latex_engine = 'pdflatex'
73+ myst_enable_extensions = ['colon_fence' , 'dollarmath' , 'linkify' , 'substitution' , 'tasklist' ]
74+ myst_url_schemes = ['mailto' , 'http' , 'https' ]
75+ nb_execution_allow_errors = False
76+ nb_execution_cache_path = ''
77+ nb_execution_excludepatterns = []
78+ nb_execution_in_temp = False
79+ nb_execution_mode = 'force'
80+ nb_execution_timeout = 30
81+ nb_output_stderr = 'show'
82+ numfig = True
83+ pygments_style = 'sphinx'
84+ suppress_warnings = ['etoc.toctree' ]
85+ tags_create_tags = True
86+ tags_extension = ['md' ]
87+ use_jupyterbook_latex = True
88+ use_multitoc_numbering = True
0 commit comments