Skip to content

Commit 5df98f2

Browse files
committed
Merge branch 'main' into feature/versions
# Conflicts: # src/Elastic.ApiExplorer/Endpoints/EndpointView.cshtml # src/Elastic.ApiExplorer/Landing/LandingView.cshtml # src/Elastic.ApiExplorer/Operations/OperationView.cshtml # src/Elastic.Documentation.Site/_ViewModels.cs # src/Elastic.Markdown/Slices/Index.cshtml
2 parents d0cb519 + 1b88283 commit 5df98f2

Some content is hidden

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

54 files changed

+541
-402
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 |

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: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,15 @@
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-
LegacyPages = [],
17-
CurrentVersion = null,
18-
VersionDropdown = null,
1914
UrlPathPrefix = null,
20-
GithubEditUrl = null,
21-
ReportIssueUrl = null,
2215
AllowIndexing = false,
2316
CanonicalBaseUrl = null,
2417
GoogleTagManager = new GoogleTagManagerConfiguration(),
2518
Features = new FeatureFlags([]),
26-
Parents =
27-
[
28-
],
29-
Products = null,
3019
StaticFileContentHashProvider = Model.StaticFileContentHashProvider
3120
};
3221
}

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";

src/Elastic.ApiExplorer/Landing/LandingView.cshtml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,15 @@
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-
LegacyPages = [],
17-
CurrentVersion = null,
18-
VersionDropdown = null,
1914
UrlPathPrefix = null,
20-
GithubEditUrl = null,
21-
ReportIssueUrl = null,
2215
AllowIndexing = false,
2316
CanonicalBaseUrl = null,
2417
GoogleTagManager = new GoogleTagManagerConfiguration(),
2518
Features = new FeatureFlags([]),
26-
Parents =
27-
[
28-
],
29-
Products = null,
3019
StaticFileContentHashProvider = Model.StaticFileContentHashProvider
3120
};
3221
}

src/Elastic.ApiExplorer/Operations/OperationNavigationItem.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public OperationNavigationItem(int depth, string url, ApiOperation apiOperation,
4747
public int Depth { get; }
4848
public ApiOperation Model { get; }
4949
public string Url { get; }
50+
public bool Hidden => false;
5051

5152
public string NavigationTitle { get; }
5253

5354
public INodeNavigationItem<INavigationModel, INavigationItem>? Parent { get; set; }
55+
56+
public int NavigationIndex { get; set; }
57+
5458
}

0 commit comments

Comments
 (0)