Skip to content

Commit 7887ee2

Browse files
committed
Expanded building blocks
1 parent 0bfe134 commit 7887ee2

File tree

9 files changed

+71
-84
lines changed

9 files changed

+71
-84
lines changed

docs/_docset.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ toc:
5454
- file: distributed-documentation.md
5555
- file: link-service.md
5656
- file: link-index.md
57-
- file: link-registry.md
57+
- file: link-catalog.md
5858
- file: outbound-crosslinks.md
5959
- file: inbound-crosslinks.md
6060
- folder: configure

docs/building-blocks/assembled-documentation.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,40 @@ navigation_title: Assembled Documentation
1111
The assembler:
1212

1313
1. Clones multiple documentation repositories
14-
2. Builds each documentation set independently
15-
3. Combines them according to a global navigation configuration
14+
2. Reads its [configuration files](../configure/site/index.md) and builds [a global navigation](../configure/site/navigation.md)
15+
3. Builds each documentation set independently using the global configuration and navigation to inform path prefixes
1616
4. Produces a unified documentation website
1717

18-
## Benefits
19-
20-
By assembling multiple documentation sets together, you can:
21-
22-
* **Centralize navigation** - Present a unified experience across multiple repositories
23-
* **Cross-link content** - Link between different documentation sets seamlessly
24-
* **Version coordination** - Control which versions of different repositories appear together
25-
* **Product-level organization** - Organize documentation by product rather than repository
26-
2718
## Configuration
2819

2920
Assembled documentation is configured through the site configuration, which defines:
3021

31-
* Which repositories to include
32-
* What versions of each repository to build
33-
* How to organize the global navigation
34-
* URL structure and routing
22+
* [assembler.yml](../configure/site/index.md) Which repositories to include and [their branching strategy](../contribute/branching-strategy.md)
23+
* [navigation.yml](../configure/site/index.md) Navigation and url prefixes for TOC's.
24+
* [versions.yml](../configure/site/versions.md) Defines the various versioning schemes of products/solutions being documented
25+
* [products.yml](../configure/site/products.md) Defines the product catalog (id, name) and ties it to a specific versioning scheme
3526

3627
See [Site Configuration](../configure/site/index.md) for complete details on configuring assembled documentation.
3728

29+
Important to note that `docs-builder` makes no assumptions about how repositories, products, solutions and versions tie into each other.
30+
3831
## Build process
3932

4033
The typical build process for assembled documentation:
4134

4235
1. **Clone** - Clone all configured repositories using `docs-builder assembler clone`
4336
2. **Build** - Build all documentation sets using `docs-builder assembler build`
44-
3. **Export** - Export the assembled site in various formats (HTML, Elasticsearch index, etc.)
37+
3. **Serve** - Serve the documentation on http://localhost:4000 using `docs-builder assembler serve`
38+
39+
This uses the embedded configuration files inside the `docs-builder` binary. To build a specific configuration:
40+
41+
1. **Init Config** - Fetch the latest config to `$(pwd)/config` `docs-builder assembler config init --local`
42+
2. **Clone** - Clone all configured repositories using `docs-builder assembler clone --local`
43+
3. **Build** - Build all documentation sets using `docs-builder assembler build --local`
44+
4. **Serve** - Serve the documentation on http://localhost:4000 using `docs-builder assembler serve`
4545

4646
## Related concepts
4747

4848
* [Documentation Set](documentation-set.md) - The individual units being assembled
4949
* [Distributed Documentation](distributed-documentation.md) - How documentation sets work independently
50-
* [Link Registry](link-registry.md) - How the assembler knows what to include
50+
* [Link Catalog](link-catalog.md) - How the assembler knows what to include

docs/building-blocks/distributed-documentation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ navigation_title: Distributed Documentation
44

55
# Distributed Documentation
66

7-
**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.
88

99
## Purpose
1010

@@ -54,10 +54,10 @@ The distributed documentation system relies on several key components:
5454

5555
* [Link Index](link-index.md) - Per-repository file of linkable resources
5656
* [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
5858
* [Outbound Crosslinks](outbound-crosslinks.md) - Links from one repository to another
5959
* [Inbound Crosslinks](inbound-crosslinks.md) - Links from other repositories to yours
6060

6161
## Local development
6262

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.

docs/building-blocks/inbound-crosslinks.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ Inbound crosslink validation allows you to:
1616

1717
## How it works
1818

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.
2020

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).
2625

2726
## Validation commands
2827

2928
### Validate all inbound links
3029

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)
3231

3332
```bash
3433
docs-builder inbound-links validate-all
@@ -39,6 +38,7 @@ docs-builder inbound-links validate-all
3938
Validate a locally built `links.json` against all published Link Index files:
4039

4140
```bash
41+
docs-builder inbound-links validate-link-reference
4242
docs-builder inbound-links validate-link-reference --file .artifacts/docs/html/links.json
4343
```
4444

@@ -80,16 +80,7 @@ Heading anchors are part of the Link Index. If other repositories link to specif
8080

8181
## Integration with CI/CD
8282

83-
You can integrate inbound link validation into your CI/CD pipeline:
84-
85-
```yaml
86-
- name: Validate inbound links
87-
run: |
88-
docs-builder inbound-links validate-link-reference \
89-
--file .artifacts/docs/html/links.json
90-
```
91-
92-
This will fail the build if you're about to break links from other repositories.
83+
Our preview CI job will run inbound link validation automatically.
9384

9485
## Best practices
9586

docs/building-blocks/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The central S3-backed service where Link Index files are published and stored. T
3030

3131
A JSON file (`links.json`) containing all linkable resources for a specific repository branch. Published to the Link Service after each successful build.
3232

33-
### [Link Registry](link-registry.md)
33+
### [Link Catalog](link-catalog.md)
3434

3535
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.
3636

@@ -48,7 +48,7 @@ Links from other documentation sets to yours. Validated to prevent breaking chan
4848

4949
1. Each repository builds its documentation set independently
5050
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
5252
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
5454
6. Teams can work independently while maintaining link integrity across repositories
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
---
2-
navigation_title: Link Registry
2+
navigation_title: Link Catalog
33
---
44

5-
# Link Registry
5+
# Link Catalog
66

7-
The **Link Registry** is a single JSON file that serves as a catalog of all available [Link Index](link-index.md) files across all repositories.
7+
The **Link Catalog** is a single JSON file that serves as a catalog of all available [Link Index](link-index.md) files across all repositories.
88

99
## Purpose
1010

11-
The Link Registry provides:
11+
The Link Catalog provides:
1212

1313
* **Discovery** - A single file to query for all available documentation across all repositories and branches
1414
* **Efficiency** - Avoid scanning the entire [Link Service](link-service.md) to find available Link Index files
1515
* **Assembler coordination** - The assembler uses this to determine which repositories and versions are available to build
1616

1717
## Location
1818

19-
The Link Registry is available at:
19+
The Link Catalog is available at:
2020

2121
```
2222
https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/link-index.json
2323
```
2424

2525
## Structure
2626

27-
The Link Registry contains:
27+
The Link Catalog contains:
2828

2929
* List of all organizations (e.g., `elastic`)
3030
* Repositories within each organization (e.g., `elasticsearch`, `kibana`)
@@ -36,31 +36,31 @@ The Link Registry contains:
3636

3737
## Maintenance
3838

39-
The Link Registry is automatically maintained:
39+
The Link Catalog is automatically maintained:
4040

4141
1. A repository's CI/CD pipeline publishes a new `links.json` to the Link Service
4242
2. The S3 bucket triggers an SQS message
4343
3. An AWS Lambda function listens to these SQS messages
44-
4. The Lambda function updates the Link Registry to include or update the entry for the new Link Index
44+
4. The Lambda function updates the Link Catalog to include or update the entry for the new Link Index
4545

46-
This process ensures the registry stays in sync with published Link Index files without manual intervention.
46+
This process ensures the catalog stays in sync with published Link Index files without manual intervention.
4747

4848
## Usage
4949

5050
### By the assembler
5151

5252
When running `docs-builder assembler clone` or `docs-builder assembler build`:
5353

54-
1. The assembler fetches the Link Registry
54+
1. The assembler fetches the Link Catalog
5555
2. It determines which repositories and versions to clone/build based on the site configuration
56-
3. It uses the commit SHAs from the registry to clone specific versions
56+
3. It uses the commit SHAs from the catalog to clone specific versions
5757
4. It falls back to the last known good commit if a repository's current state has build failures
5858

5959
### By documentation builds
6060

6161
During a documentation build:
6262

63-
1. `docs-builder` fetches the Link Registry
63+
1. `docs-builder` fetches the Link Catalog
6464
2. It determines which Link Index files to download for cross-repository validation
6565
3. It validates all crosslinks against the appropriate Link Index files
6666

@@ -73,6 +73,6 @@ During a documentation build:
7373

7474
## Related concepts
7575

76-
* [Link Service](link-service.md) - Where the Link Registry is stored
77-
* [Link Index](link-index.md) - The files cataloged by the Link Registry
78-
* [Assembled Documentation](assembled-documentation.md) - Uses the Link Registry to coordinate builds
76+
* [Link Service](link-service.md) - Where the Link Catalog is stored
77+
* [Link Index](link-index.md) - The files cataloged by the Link Catalog
78+
* [Assembled Documentation](assembled-documentation.md) - Uses the Link Catalog to coordinate builds

docs/building-blocks/link-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ https://elastic-docs-link-index.s3.us-east-2.amazonaws.com/{org}/{repo}/{branch}
8181
## Related concepts
8282

8383
* [Link Service](link-service.md) - Where Link Index files are stored
84-
* [Link Registry](link-registry.md) - Catalog of all Link Index files
84+
* [Link Catalog](link-catalog.md) - Catalog of all Link Index files
8585
* [Outbound Crosslinks](outbound-crosslinks.md) - Links that use the Link Index
8686
* [Inbound Crosslinks](inbound-crosslinks.md) - Links to resources in the Link Index

docs/building-blocks/link-service.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ When a documentation build completes successfully on a default integration branc
4242
1. The build generates a `links.json` file
4343
2. The CI/CD pipeline publishes the file to the Link Service
4444
3. An AWS Lambda function triggers on the S3 event
45-
4. The Lambda updates the [Link Registry](link-registry.md) to include the new Link Index
45+
4. The Lambda updates the [Link Catalog](link-catalog.md) to include the new Link Index
4646

4747
## Access during builds
4848

@@ -55,5 +55,5 @@ During both local and CI builds, `docs-builder`:
5555
## Related concepts
5656

5757
* [Link Index](link-index.md) - The files stored in the Link Service
58-
* [Link Registry](link-registry.md) - The catalog of all Link Index files
58+
* [Link Catalog](link-catalog.md) - The catalog of all Link Index files
5959
* [Distributed Documentation](distributed-documentation.md) - Why the Link Service exists

docs/building-blocks/outbound-crosslinks.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,31 @@ See the [Search API documentation](elasticsearch://reference/api/search.md)
3131

3232
## How it works
3333

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+
3442
When `docs-builder` encounters a crosslink:
3543

3644
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
4148

4249
## Validation
4350

4451
During a build, `docs-builder`:
4552

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
6255

6356
## Configuration
6457

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`:
6659

6760
```yaml
6861
cross_links:
@@ -71,6 +64,13 @@ cross_links:
7164
- fleet
7265
```
7366

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+
7474
## Best practices
7575

7676
### Link to files, not URLs
@@ -98,10 +98,6 @@ You can link to specific headings within a page:
9898
[Query DSL](elasticsearch://reference/query-dsl.md#match-query)
9999
```
100100

101-
### Specify versions
102-
103-
For assembled documentation, the assembler handles version mapping. For local builds, crosslinks resolve to the default branch of the target repository.
104-
105101
## Related concepts
106102

107103
* [Inbound Crosslinks](inbound-crosslinks.md) - Links from other repositories to yours

0 commit comments

Comments
 (0)