|
3 | 3 | # For the full list of built-in configuration values, see the documentation:
|
4 | 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
|
5 | 5 |
|
| 6 | +import importlib.util |
6 | 7 | # -- Project information -----------------------------------------------------
|
7 | 8 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
8 | 9 | import os
|
|
13 | 14 |
|
14 | 15 | sys.path.insert(0, os.path.abspath('.'))
|
15 | 16 |
|
16 |
| -project = 'tensorrt_llm' |
17 |
| -copyright = '2024, NVidia' |
| 17 | +project = 'TensorRT-LLM' |
| 18 | +copyright = '2025, NVidia' |
18 | 19 | author = 'NVidia'
|
19 | 20 | branch_name = pygit2.Repository('.').head.shorthand
|
20 | 21 | html_show_sphinx = False
|
| 22 | + |
| 23 | +# Get the version from the version.py file |
| 24 | +version_path = os.path.abspath( |
| 25 | + os.path.join(os.path.dirname(__file__), "../../tensorrt_llm/version.py")) |
| 26 | +spec = importlib.util.spec_from_file_location("version_module", version_path) |
| 27 | +version_module = importlib.util.module_from_spec(spec) |
| 28 | +spec.loader.exec_module(version_module) |
| 29 | +version = version_module.__version__ |
| 30 | + |
21 | 31 | # -- General configuration ---------------------------------------------------
|
22 | 32 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
23 | 33 |
|
|
76 | 86 |
|
77 | 87 | html_theme = 'nvidia_sphinx_theme'
|
78 | 88 | html_static_path = ['_static']
|
| 89 | +html_extra_path = ["./_static/switcher.json"] |
| 90 | +html_theme_options = { |
| 91 | + "switcher": { |
| 92 | + "json_url": "./_static/switcher.json", |
| 93 | + "version_match": version, |
| 94 | + "check_switcher": True, |
| 95 | + }, |
| 96 | +} |
79 | 97 |
|
80 | 98 | # ------------------------ C++ Doc related --------------------------
|
81 | 99 | # Breathe configuration
|
|
0 commit comments