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
**Distributed documentation** is the architectural approach that allows documentation sets to be built independently while still enabling cross-repository linking and validation.
7
+
**Distributed documentation** is the architectural approach that allows repositories to build their own documentation independently.
8
8
9
9
## Purpose
10
10
@@ -54,10 +54,10 @@ The distributed documentation system relies on several key components:
54
54
55
55
*[Link Index](link-index.md) - Per-repository file of linkable resources
56
56
*[Link Service](link-service.md) - Central storage for Link Index files
57
-
*[Link Registry](link-registry.md) - Catalog of all available Link Index files
57
+
*[Link Catalog](link-catalog.md) - Catalog of all available Link Index files
58
58
*[Outbound Crosslinks](outbound-crosslinks.md) - Links from one repository to another
59
59
*[Inbound Crosslinks](inbound-crosslinks.md) - Links from other repositories to yours
60
60
61
61
## Local development
62
62
63
-
Even during local development, `docs-builder` can access the Link Service to validate cross-repository links without requiring you to clone and build all related repositories.
63
+
Even during local development, `docs-builder` can access the [Link Service](link-service.md) to validate cross-repository links without requiring you to clone and build all related repositories.
Copy file name to clipboardExpand all lines: docs/building-blocks/inbound-crosslinks.md
+8-17Lines changed: 8 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,19 +16,18 @@ Inbound crosslink validation allows you to:
16
16
17
17
## How it works
18
18
19
-
When you build your documentation, `docs-builder` can validate inbound crosslinks by:
19
+
A regular [build](../cli/docset/build.md) of a documentation set won't validate inbound links automatically.
20
20
21
-
1.**Fetching your published Link Index** - Gets your repository's [Link Index](link-index.md) from the [Link Service](link-service.md)
22
-
2.**Comparing with local changes** - Compares your current local state with the published Link Index
23
-
3.**Detecting differences** - Identifies files that have been moved, renamed, or deleted
24
-
4.**Checking references** - Queries the Link Service to see if other repositories link to the changed files
25
-
5.**Reporting warnings** - Alerts you to potential breaking changes
21
+
You have to use the [inbound-links validate-link-reference](../cli/links/inbound-links-validate-link-reference.md) after a build to validate all inbound links.
22
+
23
+
The reason for this is that validating all inbound links has to download all published [Link Index](link-index.md) files
24
+
for the current [Content Source](../configure/content-sources.md).
26
25
27
26
## Validation commands
28
27
29
28
### Validate all inbound links
30
29
31
-
Check all inbound crosslinks for your repository:
30
+
Check all inbound links for all published [Link Index](link-index.md) files declared in the [Link Catalog](link-catalog.md)
Copy file name to clipboardExpand all lines: docs/building-blocks/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ The central S3-backed service where Link Index files are published and stored. T
30
30
31
31
A JSON file (`links.json`) containing all linkable resources for a specific repository branch. Published to the Link Service after each successful build.
32
32
33
-
### [Link Registry](link-registry.md)
33
+
### [Link Catalog](link-catalog.md)
34
34
35
35
A catalog file listing all available Link Index files across all repositories and branches. Used by the assembler to coordinate builds and by documentation builds for validation.
36
36
@@ -48,7 +48,7 @@ Links from other documentation sets to yours. Validated to prevent breaking chan
48
48
49
49
1. Each repository builds its documentation set independently
50
50
2. Successful builds publish a Link Index to the Link Service
51
-
3. The Link Registry catalogs all available Link Index files
51
+
3. The Link Catalog catalogs all available Link Index files
52
52
4. Documentation builds validate crosslinks using these Link Index files
53
-
5. The assembler combines documentation sets using the Link Registry
53
+
5. The assembler combines documentation sets using the Link Catalog
54
54
6. Teams can work independently while maintaining link integrity across repositories
Copy file name to clipboardExpand all lines: docs/building-blocks/outbound-crosslinks.md
+21-25Lines changed: 21 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,38 +31,31 @@ See the [Search API documentation](elasticsearch://reference/api/search.md)
31
31
32
32
## How it works
33
33
34
+
You have to explicitly opt in to another repository's `Link Index` by adding it to your `docset.yml` file:
35
+
36
+
```yaml
37
+
cross_links:
38
+
- docs-content
39
+
```
40
+
41
+
34
42
When `docs-builder` encounters a crosslink:
35
43
36
44
1. **Parse** - Extracts the repository name and path from the link
37
-
2.**Fetch** - Downloads the target repository's [Link Index](link-index.md) from the Link Service
38
-
3.**Resolve** - Looks up the path in the Link Index to get the actual URL
39
-
4.**Validate** - Verifies the link exists and generates a warning if not
40
-
5.**Transform** - Replaces the crosslink with the resolved URL in the output
45
+
3. **Resolve** - Looks up the path in the locally cached [Link Index](link-index.md) to get the actual URL
46
+
4. **Validate** - Verifies the link exists and generates an error if not
47
+
5. **Transform** - Replaces the crosslink with the fully resolved URL in the output
41
48
42
49
## Validation
43
50
44
51
During a build, `docs-builder`:
45
52
46
-
***Validates immediately** - Checks all outbound crosslinks against published Link Index files
47
-
***Reports errors** - Warns about broken links before you publish
48
-
***Suggests fixes** - If a file was moved, the Link Index may include redirect information
49
-
50
-
### Local validation
51
-
52
-
Even during local development, you can validate outbound crosslinks:
53
-
54
-
```bash
55
-
docs-builder --path ./docs
56
-
```
57
-
58
-
This will:
59
-
* Fetch Link Index files from the Link Service
60
-
* Validate all crosslinks in your local documentation
61
-
* Report any broken links
53
+
* **Validates immediately** - Checks all outbound cross-links against locally fetched [Link Index](link-index.md) files
54
+
* **Reports errors** - Reports errors about broken links before you publish
62
55
63
56
## Configuration
64
57
65
-
To enable crosslinks to a repository, add it to your `docset.yml`:
58
+
To enable cross-links to a repository, add it to your `docset.yml`:
66
59
67
60
```yaml
68
61
cross_links:
@@ -71,6 +64,13 @@ cross_links:
71
64
- fleet
72
65
```
73
66
67
+
This instructs `docs-builder` to fetch the `Link Index` from the [Link Service](link-service.md) during the build process which are then cached locally.
68
+
`docs-builder`will validate locally cached `Link Index` files against the remote `Link Index` files on each build fetching updates as needed.
69
+
70
+
Now you can create crosslinks e.g `elasticsearch://path/to/file.md`
71
+
72
+
The explicit opt-in prevents each repository build having the fetch all the links for all the repositories in the [`Link Catalog`](link-catalog.md) of which there may be many.
73
+
74
74
## Best practices
75
75
76
76
### Link to files, not URLs
@@ -98,10 +98,6 @@ You can link to specific headings within a page:
For assembled documentation, the assembler handles version mapping. For local builds, crosslinks resolve to the default branch of the target repository.
104
-
105
101
## Related concepts
106
102
107
103
* [Inbound Crosslinks](inbound-crosslinks.md) - Links from other repositories to yours
0 commit comments