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
-`guideline_id` is the parent guideline's ID (e.g., `gui_Abc123XyzQrs`)
21
+
-`guideline_id` is the parent guideline's ID (e.g., `gui_Kx9mPq2nL7Yz`)
22
22
-`CITATION-KEY` is the citation key in UPPERCASE-WITH-HYPHENS format
23
23
24
24
The `:cite:` role renders as a clickable `[CITATION-KEY]` link that navigates to the bibliography entry.
@@ -29,23 +29,23 @@ Each guideline can include an optional bibliography section with entries defined
29
29
30
30
```rst
31
31
.. guideline:: Union Field Validity
32
-
:id: gui_Abc123XyzQrs
32
+
:id: gui_Kx9mPq2nL7Yz
33
33
...
34
34
35
-
As documented in :cite:`gui_Abc123XyzQrs:RUST-REF-UNION`, unions have requirements.
35
+
As documented in :cite:`gui_Kx9mPq2nL7Yz:RUST-REF-UNION`, unions have requirements.
36
36
37
37
.. bibliography::
38
-
:id: bib_Abc123XyzQrs
38
+
:id: bib_Kx9mPq2nL7Yz
39
39
:status: draft
40
40
41
41
.. list-table::
42
42
:header-rows: 0
43
43
:widths: auto
44
44
:class: bibliography-table
45
45
46
-
* - :bibentry:`gui_Abc123XyzQrs:RUST-REF-UNION`
46
+
* - :bibentry:`gui_Kx9mPq2nL7Yz:RUST-REF-UNION`
47
47
- The Rust Reference. "Unions." https://doc.rust-lang.org/reference/items/unions.html
48
-
* - :bibentry:`gui_Abc123XyzQrs:CERT-C-INT34`
48
+
* - :bibentry:`gui_Kx9mPq2nL7Yz:CERT-C-INT34`
49
49
- SEI CERT C Coding Standard. "INT34-C." https://wiki.sei.cmu.edu/confluence/x/ItcxBQ
50
50
```
51
51
@@ -55,7 +55,7 @@ The `:bibentry:` role creates an anchor that the `:cite:` role links to, and ren
55
55
56
56
### 3. Why Namespacing?
57
57
58
-
The guideline ID prefix (`gui_Abc123XyzQrs:`) is required to avoid conflicts when multiple guidelines use the same citation key (e.g., both guidelines might cite `RUST-REF-UNION`). The prefix ensures each citation anchor is unique across the entire documentation.
58
+
The guideline ID prefix (`gui_Kx9mPq2nL7Yz:`) is required to avoid conflicts when multiple guidelines use the same citation key (e.g., both guidelines might cite `RUST-REF-UNION`). The prefix ensures each citation anchor is unique across the entire documentation.
59
59
60
60
When using `generate_guideline_templates.py`, the guideline ID is automatically included in all `:cite:` and `:bibentry:` roles.
61
61
@@ -83,10 +83,16 @@ Citation keys must follow these rules:
83
83
84
84
The bibliography validator extension checks:
85
85
- URL accessibility (HTTP status)
86
-
-Duplicate URLs across guidelines
86
+
-URL consistency across guidelines (same URL must use identical citation key and description)
87
87
- Citation key format compliance
88
88
- Citation references match definitions
89
89
90
+
**Duplicate URL Consistency:** When the same URL appears in multiple guidelines, all instances must use:
91
+
- The same citation key (e.g., all use `RUST-REF-UNION`)
92
+
- The same description text (e.g., all use `The Rust Reference. "Unions."`)
93
+
94
+
This ensures readers see consistent references throughout the documentation.
95
+
90
96
## Configuration
91
97
92
98
### conf.py Settings
@@ -101,8 +107,9 @@ bibliography_url_timeout = 10
101
107
# Whether broken URLs should fail the build
102
108
bibliography_fail_on_broken =True
103
109
104
-
# Whether duplicate URLs should fail the build
105
-
bibliography_fail_on_duplicates =True
110
+
# Whether inconsistent duplicate URLs should fail the build
111
+
# (same URL with different citation keys or descriptions)
112
+
bibliography_fail_on_inconsistent =True
106
113
```
107
114
108
115
### Build Commands
@@ -200,35 +207,84 @@ The `guidelines-ids.json` now includes bibliography data. All IDs follow the sam
200
207
}
201
208
```
202
209
203
-
## Error Messages
210
+
## Error Messages and Build Failures
211
+
212
+
All bibliography validation errors will **fail the build**. This ensures that invalid citations and mismatched guideline IDs are caught during development and CI.
213
+
214
+
The validation runs in two places:
215
+
1.**During document parsing**: The `:cite:` and `:bibentry:` roles check format and log errors
216
+
2.**During consistency check**: The `bibliography_validator` scans all guidelines and raises `BibliographyValidationError` if any errors are found
217
+
218
+
All error messages include copy-pasteable fixes to help contributors quickly resolve issues.
204
219
205
220
### Broken URL
206
221
```
207
-
WARNING: [bibliography_validator] Broken URL in src/gui_Foo.rst:
222
+
WARNING: [bibliography_validator] Broken URL in src/gui_Rm4kWp8sN2Qx.rst:
0 commit comments