You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -420,6 +422,29 @@ Enables the extraction of marked RST text from source code comments. When enable
420
422
[codelinks.projects.my_project.analyse]
421
423
get_rst = false
422
424
425
+
.. _`git_root`:
426
+
427
+
git_root
428
+
^^^^^^^^
429
+
430
+
Specifies an explicit path to the Git repository root directory. This option is particularly useful in environments where the standard Git root auto-detection fails, such as:
431
+
432
+
- **Bazel builds**: Where the execution path differs from the standard repository layout
433
+
- **Deeply nested configurations**: Where ``conf.py`` is located in a deep subdirectory far from the repository root
434
+
- **Custom build systems**: Where the working directory is different from the source repository
435
+
436
+
When not set, **Sphinx-CodeLinks** will automatically traverse parent directories to locate the ``.git`` folder.
437
+
438
+
**Type:** ``str`` (path)
439
+
**Default:** Not set (auto-detection)
440
+
441
+
.. code-block:: toml
442
+
443
+
[codelinks.projects.my_project.analyse]
444
+
git_root = "/absolute/path/to/repo"
445
+
446
+
.. note:: When ``git_root`` is explicitly set, **Sphinx-CodeLinks** will use this path directly without attempting auto-detection. Ensure the path points to a valid Git repository containing a ``.git`` directory.
0 commit comments