Skip to content

Commit 4ce3a72

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main' into redirect_health_check
2 parents ab66a05 + 01f24f9 commit 4ce3a72

File tree

76 files changed

+3424
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3424
-642
lines changed

.github/workflows/smoke-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ jobs:
3939
4040
- name: Verify landing-page-path output
4141
run: test ${{ steps.docs-build.outputs.landing-page-path }} == ${{ matrix.landing-page-path-output }}
42+
43+
- name: Verify link validation
44+
run: |
45+
dotnet run --project src/tooling/docs-builder -- inbound-links validate-link-reference -p test-repo
46+

docs/contribute/locally.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ This guide uses the first option. If you'd like to clone the repository and buil
3939
```
4040

4141
This downloads the latest binary, makes it executable, and installs it to your user PATH.
42+
You can optionally specify a specific version to install:
43+
44+
```sh
45+
DOCS_BUILDER_VERSION=0.40.0 curl -sL https://ela.st/docs-builder-install | sh
46+
```
4247

4348
To download and install the binary file manually, refer to [Releases](https://github.com/elastic/docs-builder/releases) on GitHub.
4449

@@ -68,6 +73,11 @@ If you get a `Permission denied` error, make sure that you aren't trying to run
6873
```
6974

7075
This downloads the latest binary, makes it executable, and installs it to your user PATH.
76+
You can optionally specify a specific version to install:
77+
78+
```powershell
79+
$env:DOCS_BUILDER_VERSION = '0.40.0'; iwr -useb https://ela.st/docs-builder-install.ps1 | iex
80+
```
7181

7282
To download and install the binary file manually, refer to [Releases](https://github.com/elastic/docs-builder/releases) on GitHub.
7383

docs/syntax/frontmatter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ The products frontmatter is a list of objects, each object has an `id` field.
6161
| `cloud-terraform` | Elastic Cloud Terraform |
6262
| `ecs` | Elastic Common Schema (ECS) |
6363
| `ecs-logging` | ECS Logging |
64+
| `edot-cf` | EDOT Cloud Forwarder |
6465
| `edot-sdk` | Elastic Distribution of OpenTelemetry SDK |
6566
| `edot-collector` | Elastic Distribution of OpenTelemetry Collector |
6667
| `elastic-agent` | Elastic Agent |

docs/syntax/images.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
11
# Images
22

3-
Images include screenshots, inline images, icons, and more. Syntax for images is like the syntax for links, with two differences:
3+
Images include screenshots, inline images, icons, and more. Syntax for images is like the syntax for links, with the following differences:
4+
45
1. instead of link text, you provide an image description
56
2. an image description starts with `![` not just `[`
7+
3. there are restrictions on the scope of image paths
8+
9+
:::{note}
610

7-
Images can be referenced from the top-level `_static` dir or a local image dir.
11+
If a page uses an image that exists outside the folder that contains the `toc.yml` file or `docset.yml` file that contains that page, the image will fail to render and will generate warnings. Likewise, if a snippet in a [file inclusion](/syntax/file_inclusion.md) includes an image and is used in pages that exist in different `toc.yml`, the images will break.
12+
:::
813

914
## Block-level images
1015

1116
```markdown
12-
![APM](images/apm.png)
17+
![APM](/syntax/images/apm.png)
1318
```
1419

15-
![APM](images/apm.png)
20+
![APM](/syntax/images/apm.png)
21+
1622

1723
Or, use the `image` directive.
1824

1925
```markdown
20-
:::{image} images/observability.png
26+
:::{image} /syntax/images/observability.png
2127
:alt: Elasticsearch
2228
:width: 250px
2329
:::
2430
```
2531

26-
:::{image} images/observability.png
32+
:::{image} /syntax/images/observability.png
2733
:alt: Elasticsearch
2834
:width: 250px
2935
:::
@@ -33,36 +39,37 @@ Or, use the `image` directive.
3339
Screenshots are images displayed with a box-shadow. Define a screenshot by adding the `:screenshot:` attribute to a block-level image directive.
3440

3541
```markdown
36-
:::{image} images/apm.png
42+
43+
:::{image} /syntax/images/apm.png
3744
:screenshot:
3845
:::
3946
```
4047

41-
:::{image} images/apm.png
48+
:::{image} /syntax/images/apm.png
4249
:screenshot:
4350
:::
4451

4552
## Inline images
4653

4754
```markdown
48-
Here is the same image used inline ![Elasticsearch](images/observability.png "elasticsearch =50%x50%")
55+
Here is the same image used inline ![Elasticsearch](/syntax/images/observability.png "elasticsearch =50%x50%")
4956
```
5057

51-
Here is the same image used inline ![Elasticsearch](images/observability.png "elasticsearch =50%x50%")
58+
Here is the same image used inline ![Elasticsearch](/syntax/images/observability.png "elasticsearch =50%x50%")
5259

5360

5461
### Inline image titles
5562

5663
Titles are optional making this the minimal syntax required
5764

5865
```markdown
59-
![Elasticsearch](images/observability.png)
66+
![Elasticsearch](/syntax/images/observability.png)
6067
```
6168

6269
Including a title can be done by supplying it as an optional argument.
6370

6471
```markdown
65-
![Elasticsearch](images/observability.png "elasticsearch")
72+
![Elasticsearch](/syntax/images/observability.png "elasticsearch")
6673
```
6774

6875
### Inline image sizing
@@ -92,17 +99,16 @@ If `H` is omitted `W` is used as the height as well.
9299
### SVG
93100

94101
```markdown
95-
![Elasticsearch](images/alerts.svg)
102+
![Elasticsearch](/syntax/images/alerts.svg)
96103
```
97-
![Elasticsearch](images/alerts.svg)
104+
![Elasticsearch](/syntax/images/alerts.svg)
98105

99106
### GIF
100107

101108
```markdown
102-
![Elasticsearch](images/timeslider.gif)
109+
![Elasticsearch](/syntax/images/timeslider.gif)
103110
```
104-
![Elasticsearch](images/timeslider.gif)
105-
111+
![Elasticsearch](/syntax/images/timeslider.gif)
106112

107113
## Asciidoc syntax
108114

docs/syntax/links.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Links
22

3-
A markdown link looks like this:
3+
A Markdown link looks like this:
44

55
```markdown
66
[Link text](destination.md)
77
```
8+
89
It has two components:
10+
911
- Link **text** enclosed in square brackets `[ ]`
1012
- Link **destination** enclosed in parentheses `( )`
1113

@@ -133,6 +135,41 @@ You can also auto-generate text for specific headings within files:
133135
<!-- Uses the "Configuration" section title from current file -->
134136
```
135137

138+
## Reference-style links
139+
140+
`docs-builder` supports reference-style external links.
141+
142+
::::{tab-set}
143+
144+
:::{tab-item} Output
145+
146+
- [Link]: This link uses the reference name as text.
147+
- [Your own text][Link]: This link overrides the reference name.
148+
149+
% References are typically added at the bottom of the page
150+
151+
[Link]: https://elastic.co/docs
152+
153+
:::
154+
155+
:::{tab-item} Markdown
156+
157+
```markdown
158+
- [Link]: This link uses the reference name as text.
159+
- [Your own text][Link]: This link overrides the reference name.
160+
161+
% References are typically added at the bottom of the page
162+
163+
[Link]: https://elastic.co/docs
164+
```
165+
166+
:::
167+
168+
169+
::::
170+
171+
Reference-style links are useful when adding links to tables, for example, or to update frequently used links more easily. Place them at the end of the document to simplify their management.
172+
136173
## Legacy features
137174

138175
### Inline anchors

install.ps1

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# PowerShell script to install docs-builder binary
22

33
# Use AppData\Local for user-specific installation instead of Program Files
4-
$targetDir = Join-Path -Path $env:LOCALAPPDATA -ChildPath "docs-builder"
4+
$targetDir = Join-Path -Path $env:LOCALAPPDATA -ChildPath "docs-builder"
55
$targetPath = Join-Path -Path $targetDir -ChildPath "docs-builder.exe"
66

7+
$version = $env:DOCS_BUILDER_VERSION
8+
if (-not $version) { $version = 'latest' }
9+
710
# Check if docs-builder already exists
811
if (Test-Path -Path $targetPath) {
912
Write-Host "docs-builder is already installed."
@@ -20,10 +23,15 @@ if (-not (Test-Path -Path $targetDir)) {
2023
New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
2124
}
2225

23-
# Download the latest Windows binary from releases
26+
if ($version -eq 'latest') {
27+
$downloadUrl = "https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-win-x64.zip"
28+
} else {
29+
$downloadUrl = "https://github.com/elastic/docs-builder/releases/download/$version/docs-builder-win-x64.zip"
30+
}
31+
2432
$tempZipPath = "$env:TEMP\docs-builder-win-x64.zip"
2533
Write-Host "Downloading docs-builder binary..."
26-
Invoke-WebRequest -Uri "https://github.com/elastic/docs-builder/releases/latest/download/docs-builder-win-x64.zip" -OutFile $tempZipPath
34+
Invoke-WebRequest -Uri $downloadUrl -OutFile $tempZipPath
2735

2836
# Create a temporary directory for extraction
2937
$tempExtractPath = "$env:TEMP\docs-builder-extract"
@@ -53,8 +61,8 @@ if ($currentPath -notlike "*$targetDir*") {
5361
}
5462

5563
# Clean up temporary files
56-
Remove-Item -Path $tempZipPath -Force
64+
Remove-Item -Path $tempZipPath -Force
5765
Remove-Item -Path $tempExtractPath -Recurse -Force
5866

59-
Write-Host "docs-builder has been installed successfully and is available in your PATH."
60-
Write-Host "You may need to restart your terminal or PowerShell session for the PATH changes to take effect."
67+
Write-Host "docs-builder ($version) has been installed successfully and is available in your PATH."
68+
Write-Host "You may need to restart your terminal or PowerShell session for the PATH changes to take effect."

install.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
1212
ARCH="arm64"
1313
fi
1414

15+
VERSION="${DOCS_BUILDER_VERSION:-latest}"
16+
1517
# Determine binary to download based on OS
1618
if [ "$OS" = "darwin" ]; then
1719
BINARY="docs-builder-mac-$ARCH.zip"
@@ -55,8 +57,14 @@ fi
5557

5658
echo "Downloading docs-builder for $OS/$ARCH..."
5759

60+
if [ "$VERSION" = "latest" ]; then
61+
DOWNLOAD_URL="https://github.com/elastic/docs-builder/releases/latest/download/$BINARY"
62+
else
63+
DOWNLOAD_URL="https://github.com/elastic/docs-builder/releases/download/$VERSION/$BINARY"
64+
fi
65+
5866
# Download the appropriate binary
59-
if ! curl -LO "https://github.com/elastic/docs-builder/releases/latest/download/$BINARY"; then
67+
if ! curl -LO "$DOWNLOAD_URL"; then
6068
echo "Error: Failed to download $BINARY. Please check your internet connection."
6169
exit 1
6270
fi
@@ -87,5 +95,5 @@ fi
8795
# Clean up the downloaded zip file
8896
rm -f "$BINARY"
8997

90-
echo "docs-builder has been installed successfully and is available in your PATH."
91-
echo "You can run 'docs-builder --help' to see available commands."
98+
echo "docs-builder ($VERSION) has been installed successfully and is available in your PATH."
99+
echo "You can run 'docs-builder --help' to see available commands."

src/Elastic.ApiExplorer/Endpoints/ApiEndpoint.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ public EndpointNavigationItem(int depth, string url, ApiEndpoint apiEndpoint, La
5858
public ApiEndpoint Index { get; }
5959
public string Url { get; }
6060
public string NavigationTitle { get; }
61+
public bool Hidden => false;
6162

6263
public IReadOnlyCollection<OperationNavigationItem> NavigationItems { get; set; } = [];
6364

6465
public INodeNavigationItem<INavigationModel, INavigationItem> NavigationRoot { get; }
6566

6667
public INodeNavigationItem<INavigationModel, INavigationItem>? Parent { get; set; }
68+
69+
public int NavigationIndex { get; set; }
6770
}

src/Elastic.ApiExplorer/Endpoints/EndpointView.cshtml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,16 @@
77
{
88
DocSetName = "Api Explorer",
99
Description = "",
10-
Layout = null,
11-
PageTocItems = [],
1210
CurrentNavigationItem = Model.CurrentNavigationItem,
1311
Previous = null,
1412
Next = null,
1513
NavigationHtml = Model.NavigationHtml,
16-
LegacyPage = null,
1714
UrlPathPrefix = null,
18-
GithubEditUrl = null,
19-
ReportIssueUrl = null,
15+
VersionDropdown = null,
2016
AllowIndexing = false,
2117
CanonicalBaseUrl = null,
2218
GoogleTagManager = new GoogleTagManagerConfiguration(),
2319
Features = new FeatureFlags([]),
24-
Parents =
25-
[
26-
],
27-
Products = null,
2820
StaticFileContentHashProvider = Model.StaticFileContentHashProvider
2921
};
3022
}

src/Elastic.ApiExplorer/Landing/LandingNavigationItem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ public class LandingNavigationItem : INodeNavigationItem<ApiLanding, EndpointNav
3434
public int Depth { get; }
3535
public ApiLanding Index { get; }
3636
public INodeNavigationItem<INavigationModel, INavigationItem>? Parent { get; set; }
37+
public int NavigationIndex { get; set; }
3738
public IReadOnlyCollection<EndpointNavigationItem> NavigationItems { get; set; } = [];
3839
public string Url { get; }
40+
public bool Hidden => false;
3941

4042
//TODO
4143
public string NavigationTitle { get; } = "API Documentation";

0 commit comments

Comments
 (0)