Skip to content

Commit e58e8aa

Browse files
authored
Merge branch 'main' into cumulative-docs-guide
2 parents f8f9d0b + 573f873 commit e58e8aa

File tree

153 files changed

+4258
-1142
lines changed

Some content is hidden

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

153 files changed

+4258
-1142
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+

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@
7070
</PackageVersion>
7171
<PackageVersion Include="xunit.v3" Version="2.0.2" />
7272
</ItemGroup>
73-
</Project>
73+
</Project>

docs-builder.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.ApiExplorer.Tests",
107107
EndProject
108108
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Documentation.Site", "src\Elastic.Documentation.Site\Elastic.Documentation.Site.csproj", "{89B83007-71E6-4B57-BA78-2544BFA476DB}"
109109
EndProject
110+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Documentation.LegacyDocs", "src\Elastic.Documentation.LegacyDocs\Elastic.Documentation.LegacyDocs.csproj", "{111E7029-BB29-4039-9B45-04776798A8DD}"
111+
EndProject
112+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Documentation.LegacyDocs.Tests", "tests\Elastic.Documentation.LegacyDocs.Tests\Elastic.Documentation.LegacyDocs.Tests.csproj", "{164F55EC-9412-4CD4-81AD-3598B57632A6}"
113+
EndProject
110114
Global
111115
GlobalSection(SolutionConfigurationPlatforms) = preSolution
112116
Debug|Any CPU = Debug|Any CPU
@@ -184,6 +188,14 @@ Global
184188
{89B83007-71E6-4B57-BA78-2544BFA476DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
185189
{89B83007-71E6-4B57-BA78-2544BFA476DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
186190
{89B83007-71E6-4B57-BA78-2544BFA476DB}.Release|Any CPU.Build.0 = Release|Any CPU
191+
{111E7029-BB29-4039-9B45-04776798A8DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
192+
{111E7029-BB29-4039-9B45-04776798A8DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
193+
{111E7029-BB29-4039-9B45-04776798A8DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
194+
{111E7029-BB29-4039-9B45-04776798A8DD}.Release|Any CPU.Build.0 = Release|Any CPU
195+
{164F55EC-9412-4CD4-81AD-3598B57632A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
196+
{164F55EC-9412-4CD4-81AD-3598B57632A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
197+
{164F55EC-9412-4CD4-81AD-3598B57632A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
198+
{164F55EC-9412-4CD4-81AD-3598B57632A6}.Release|Any CPU.Build.0 = Release|Any CPU
187199
EndGlobalSection
188200
GlobalSection(NestedProjects) = preSolution
189201
{4D198E25-C211-41DC-9E84-B15E89BD7048} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
@@ -212,5 +224,7 @@ Global
212224
{C883AC18-7C6A-482E-A9D7-C44DF8633425} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
213225
{0331559E-4ED1-4A56-9C35-3EAD4D7E696D} = {67B576EE-02FA-4F9B-94BC-3630BC09ECE5}
214226
{89B83007-71E6-4B57-BA78-2544BFA476DB} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
227+
{111E7029-BB29-4039-9B45-04776798A8DD} = {BE6011CC-1200-4957-B01F-FCCA10C5CF5A}
228+
{164F55EC-9412-4CD4-81AD-3598B57632A6} = {67B576EE-02FA-4F9B-94BC-3630BC09ECE5}
215229
EndGlobalSection
216230
EndGlobal

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/ApiRenderContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ StaticFileContentHashProvider StaticFileContentHashProvider
1717
: RenderContext<OpenApiDocument>(BuildContext, Model)
1818
{
1919
public required string NavigationHtml { get; init; }
20+
public required INavigationItem CurrentNavigation { get; init; }
2021
}

0 commit comments

Comments
 (0)