|
14 | 14 | import sys
|
15 | 15 | sys.path.insert(0, os.path.abspath('..'))
|
16 | 16 |
|
| 17 | +import doubleml |
| 18 | + |
17 | 19 |
|
18 | 20 | # -- Project information -----------------------------------------------------
|
19 | 21 |
|
|
69 | 71 | #
|
70 | 72 | html_theme = 'pydata_sphinx_theme'
|
71 | 73 |
|
| 74 | +# html_logo = '../img/logo.png' |
| 75 | +html_extra_path = ['../img/logo.png'] |
| 76 | +html_favicon = '../img/favicon.ico' |
| 77 | + |
| 78 | +# Define the json_url for our version switcher. |
| 79 | +json_url = 'https://docs.doubleml.org/stable/_static/switcher.json' |
| 80 | + |
| 81 | +# Define the version we use for matching in the version switcher. |
| 82 | +version_match = os.environ.get("READTHEDOCS_VERSION") |
| 83 | +# If READTHEDOCS_VERSION doesn't exist, we're not on RTD |
| 84 | +# If it is an integer, we're in a PR build and the version isn't correct. |
| 85 | +if not version_match or version_match.isdigit(): |
| 86 | + # For local development, infer the version to match from the package. |
| 87 | + release = doubleml.__version__ |
| 88 | + if "dev" in release or "rc" in release: |
| 89 | + version_match = "latest" |
| 90 | + # We want to keep the relative reference if we are in dev mode |
| 91 | + # but we want the whole url if we are effectively in a released version |
| 92 | + json_url = "_static/switcher.json" |
| 93 | + else: |
| 94 | + version_match = "v" + release |
| 95 | + |
72 | 96 | html_theme_options = {
|
| 97 | + "navbar_start": ["navbar-logo", "version-switcher"], |
73 | 98 | 'github_url': 'https://github.com/DoubleML/doubleml-for-py',
|
74 | 99 | 'navigation_with_keys': False,
|
| 100 | + 'switcher': { |
| 101 | + 'json_url': json_url, |
| 102 | + 'version_match': version_match, |
| 103 | + } |
75 | 104 | }
|
76 | 105 |
|
77 |
| -# html_logo = '../img/logo.png' |
78 |
| -html_extra_path = ['../img/logo.png'] |
79 |
| -html_favicon = '../img/favicon.ico' |
80 |
| - |
81 | 106 | html_sidebars = {'**': ['logo.html',
|
82 | 107 | 'search-field.html',
|
83 | 108 | 'sidebar-nav-bs.html'],
|
|
0 commit comments