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
Copy file name to clipboardExpand all lines: docs/source/components/configuration.rst
+38-7Lines changed: 38 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,15 +178,17 @@ Configures how **Sphinx-CodeLinks** discovers and processes source files within
178
178
exclude = []
179
179
include = []
180
180
gitignore = true
181
+
follow_links = false
181
182
comment_type = "cpp"
182
183
183
184
**Configuration fields:**
184
185
185
186
- ``src_dir`` - Root directory for source file discovery (relative to Sphinx project root or the directory where the TOML config file is located if given)
186
187
- ``exclude`` - List of glob patterns to exclude from processing
187
188
- ``include`` - List of glob patterns to include (if empty, includes all files)
188
-
- ``gitignore`` - Whether to respect ``.gitignore`` rules when discovering files (Nested .gitignore is NOT supported yet)
189
-
- ``comment_type`` - Comment style for the programming language ("cpp" and "python" are currently supported)
189
+
- ``gitignore`` - Whether to respect ``.gitignore``, ``.ignore``, and related ignore files when discovering files
190
+
- ``follow_links`` - Whether to follow symbolic links during file discovery
191
+
- ``comment_type`` - Comment style for the programming language
190
192
191
193
.. _`source_dir`:
192
194
@@ -251,7 +253,9 @@ Defines a list of glob patterns for files to explicitly include in discovery. Wh
251
253
"include/**/*.hpp"
252
254
]
253
255
254
-
**Priority:** The ``include`` option has the highest priority and overrides both ``exclude`` and ``gitignore`` settings.
256
+
**Priority:** When ``include`` patterns are specified, only files matching those patterns
257
+
are considered (this overrides ``gitignore`` exclusions for matched files).
258
+
``exclude`` patterns are then applied to remove files from that set.
255
259
256
260
**Common inclusion patterns:**
257
261
@@ -317,7 +321,9 @@ Specifies the comment syntax style used in the source code files. This determine
317
321
gitignore
318
322
^^^^^^^^^
319
323
320
-
Controls whether to respect ``.gitignore`` files when discovering source files. When enabled, files and directories listed in ``.gitignore`` will be automatically excluded from processing.
324
+
Controls whether to respect ignore files when discovering source files.
325
+
When enabled, files and directories matched by ignore rules will be automatically
326
+
excluded from processing.
321
327
322
328
**Type:** ``bool``
323
329
**Default:** ``true``
@@ -329,10 +335,34 @@ Controls whether to respect ``.gitignore`` files when discovering source files.
- ``false`` - Ignore ``.gitignore`` files and process all matching files
338
+
When set to ``true`` (recommended), the following ignore sources are respected:
334
339
335
-
.. important:: **Current Limitation:** This option only supports the root-level ``.gitignore`` file. Nested ``.gitignore`` files in subdirectories or parent directories are not currently processed.
340
+
- ``.gitignore`` files (including nested ``.gitignore`` files in subdirectories)
341
+
- ``.ignore`` files (same syntax as ``.gitignore``, useful for non-git projects)
342
+
- ``.git/info/exclude``
343
+
- Global gitignore (e.g. ``~/.config/git/ignore``)
344
+
- Parent directory ignore files
345
+
346
+
When set to ``false``, all ignore files are disregarded and every matching file is processed.
347
+
348
+
follow_links
349
+
^^^^^^^^^^^^
350
+
351
+
Controls whether symbolic links are followed during file discovery.
352
+
When disabled, symbolic links to directories are not traversed.
353
+
354
+
**Type:** ``bool``
355
+
**Default:** ``false``
356
+
357
+
.. code-block:: toml
358
+
359
+
[codelinks.projects.my_project.source_discover]
360
+
follow_links = true
361
+
362
+
**Behavior:**
363
+
364
+
- ``false`` - Symbolic links to directories are skipped (default, safer)
0 commit comments