Skip to content

Commit f0b5a98

Browse files
committed
Restructure doc and add inline examples
1 parent 3799894 commit f0b5a98

File tree

9 files changed

+266
-182
lines changed

9 files changed

+266
-182
lines changed

docs/_snippets/applies_to-key.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
`applies_to` accepts the following keys in this structure:
1+
`applies_to` accepts the following keys in this structure.
22

33
* `serverless`: Applies to [Elastic Cloud Serverless](https://www.elastic.co/docs/deploy-manage/deploy/elastic-cloud/serverless).
44
* `security`: Applies to Serverless [security projects](https://www.elastic.co/docs/solutions/security/get-started/create-security-project).
@@ -10,6 +10,9 @@
1010
* `eck`: Applies to [Elastic Cloud on Kubernetes](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s) deployments.
1111
* `self`: Applies to [self-managed](https://www.elastic.co/docs/deploy-manage/deploy/self-managed) deployments.
1212
* `ess`: Applies to [Elastic Cloud Hosted](https://www.elastic.co/docs/deploy-manage/deploy/elastic-cloud/cloud-hosted) deployments.
13+
14+
The `products` key and its subkeys are used to indicate feature availability and applicability. The similarly named [`products` frontmatter field](/syntax/frontmatter.md#products) is used to drive elastic.co search filters:
15+
1316
* `product`: Applies to a specific product that uses a unique versioning scheme (e.g. not `stack`, `ece`, `eck`).
1417
* `apm_agent_dotnet`: Applies to the [Elastic APM .NET agent](https://www.elastic.co/docs/reference/apm/agents/dotnet).
1518
* `apm_agent_go`: Applies to the [Elastic APM Go agent](https://www.elastic.co/docs/reference/apm/agents/go).
@@ -30,7 +33,7 @@
3033
* `edot_node`: Applies to the [Elastic Distribution of OpenTelemetry Node.js](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/nodejs/) (EDOT Node.js).
3134
* `edot_php`: Applies to the [Elastic Distribution of OpenTelemetry PHP](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/php/) (EDOT PHP).
3235
* `edot_python`: Applies to the [Elastic Distribution of OpenTelemetry Python](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/python/) (EDOT Python).
33-
34-
:::{note}
35-
The `products` key and its subkeys are used to indicate feature availability and applicability. The similarly named [`products` frontmatter field](/syntax/frontmatter.md#products) is used to drive elastic.co search filters.
36+
37+
:::{important}
38+
A key without any value doesn't show any badge in the output.
3639
:::

docs/_snippets/applies_to-version.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* `Major.Minor`
44
* `Major.Minor.Patch`
55

6+
Regardless of the version format used in the source file, the version number is always rendered in the `Major.Minor.Patch` format.
7+
68
:::{note}
7-
Regardless of the version format used in the source file,
8-
the version number will always be rendered in the `Major.Minor.Patch` format.
9-
:::
9+
**Automatic Version Sorting**: When you specify multiple versions for the same product, the build system automatically sorts them in descending order (highest version first) regardless of the order you write them in the source file. For example, `stack: ga 8.18.6, ga 9.1.2, ga 8.19.2, ga 9.0.6` will be displayed as `stack: ga 9.1.2, ga 9.0.6, ga 8.19.2, ga 8.18.6`. Items without versions (like `ga` without a version or `all`) are sorted last.
10+
:::

docs/contribute/cumulative-docs/badge-placement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ There are more specific guidelines on badge placement to follow when using speci
3838

3939
### Page frontmatter
4040

41-
Use [`applies_to` in a page's frontmatter](/syntax/applies.md#page-annotations) to provide signals that a page applies to the reader.
41+
Use [`applies_to` in a page's frontmatter](/syntax/applies.md#syntax) to provide signals that a page applies to the reader.
4242

4343
::::{warning}
4444
Do **not** use [section-level](/syntax/applies.md#section-annotations) or [inline annotations](/syntax/applies.md#inline-annotations) with the page title.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
::::::{dropdown} Basic example
2+
3+
:::::{tab-set}
4+
5+
::::{tab-item} Output
6+
7+
**Spaces** let you organize your content and users according to your needs.
8+
9+
- Each space has its own saved objects.
10+
- {applies_to}`serverless: unavailable` Each space has its own navigation, called solution view.
11+
12+
::::
13+
14+
::::{tab-item} Markdown
15+
```markdown
16+
**Spaces** let you organize your content and users according to your needs.
17+
18+
- Each space has its own saved objects.
19+
- {applies_to}`serverless: unavailable` Each space has its own navigation, called solution view.
20+
```
21+
::::
22+
23+
:::::
24+
25+
::::::
26+
27+
::::::{dropdown} Product-specific applicability with version information
28+
29+
:::::{tab-set}
30+
31+
::::{tab-item} Output
32+
33+
- {applies_to}`edot_python: preview 1.7.0`
34+
- {applies_to}`apm_agent_java: beta 1.0.0`
35+
- {applies_to}`elasticsearch: ga 9.1.0`
36+
37+
::::
38+
39+
::::{tab-item} Markdown
40+
```markdown
41+
- {applies_to}`edot_python: preview 1.7.0`
42+
- {applies_to}`apm_agent_java: beta 1.0.0`
43+
- {applies_to}`elasticsearch: ga 9.1.0`
44+
```
45+
::::
46+
47+
:::::
48+
49+
::::::
50+
51+
::::::{dropdown} Multiple products and states in a single inline statement
52+
53+
:::::{tab-set}
54+
55+
::::{tab-item} Output
56+
57+
- {applies_to}`{ serverless: "ga" , stack: "ga 9.1.0" }`
58+
- {applies_to}`{ edot_python: "preview 1.7.0" , apm_agent_java: "beta 1.0.0" }`
59+
- {applies_to}`{ stack: "ga 9.0" , deployment: { eck: "ga 9.0" } }`
60+
61+
::::
62+
63+
::::{tab-item} Markdown
64+
```markdown
65+
- {applies_to}`{ serverless: "ga" , stack: "ga 9.1.0" }`
66+
- {applies_to}`{ edot_python: "preview 1.7.0" , apm_agent_java: "beta 1.0.0" }`
67+
- {applies_to}`{ stack: "ga 9.0" , deployment: { eck: "ga 9.0" } }`
68+
```
69+
::::
70+
71+
:::::
72+
73+
::::::
74+
75+
::::::{dropdown} Complex scenarios with different product types
76+
77+
:::::{tab-set}
78+
79+
::::{tab-item} Output
80+
81+
- {applies_to}`{ stack: "preview 9.1", product: { edot_python: "preview 1.4.0" } }`
82+
83+
Notice that, when mixing different statement types, the applies_to inline syntax requires JSON-like nesting for product-specific applicability.
84+
85+
::::
86+
87+
::::{tab-item} Markdown
88+
```markdown
89+
- {applies_to}`{ stack: "preview 9.1", product: { edot_python: "preview 1.4.0" } }`
90+
```
91+
92+
Notice that, when mixing different statement types, the applies_to inline syntax requires JSON-like nesting for product-specific applicability.
93+
94+
::::
95+
96+
:::::
97+
98+
::::::

docs/syntax/_snippets/line-level-applies-example.md

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
There are 3 typical scenarios to start from:
1+
:::::{dropdown} Document is primarily about using or interacting with Elastic Stack components or the Serverless UI
22

3-
* The documentation set or page is primarily about using or interacting with Elastic Stack components or the Serverless UI:
3+
```yml
4+
---
5+
applies_to:
6+
stack: ga
7+
serverless: ga
8+
---
9+
```
410

5-
```yml
6-
---
7-
applies_to:
8-
stack: ga
9-
serverless: ga
10-
---
11-
```
11+
:::::
1212

13-
* The documentation set or page is primarily about orchestrating, deploying or configuring an installation (only include relevant keys):
13+
:::::{dropdown} Document is primarily about orchestrating, deploying or configuring an installation
1414

1515
```yml
1616
---
@@ -24,7 +24,9 @@ There are 3 typical scenarios to start from:
2424

2525
```
2626

27-
* The documentation set or page is primarily about a product following its own versioning schema:
27+
:::::
28+
29+
:::::{dropdown} Document is primarily about a product following its own versioning schema
2830

2931
```yml
3032
---
@@ -33,21 +35,4 @@ There are 3 typical scenarios to start from:
3335
---
3436
```
3537

36-
It can happen that it’s relevant to identify several or all of these dimensions for a page. Use your own judgement and check existing pages in similar contexts.
37-
38-
```yml
39-
---
40-
applies_to:
41-
stack: ga
42-
serverless: ga
43-
deployment:
44-
ess: ga
45-
ece: ga
46-
eck: ga
47-
---
48-
```
49-
% I don't know what this example is supposed to show
50-
51-
52-
53-
38+
:::::
Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
1-
* The whole page is generally applicable to {{stack}} 9.0 and to {{serverless-short}}, but one specific section isn’t applicable to {{serverless-short}} (and there is no alternative for it):
2-
3-
````md
4-
---
5-
applies_to:
6-
stack: ga
7-
serverless: ga
8-
---
9-
10-
# Spaces
11-
12-
[...]
13-
14-
## Configure a space-level landing page [space-landing-page]
15-
```{applies_to}
16-
serverless: unavailable
17-
```
18-
````
19-
% I think we wanted to not specify stack here
20-
21-
* The whole page is generally applicable to all deployment types, but one specific paragraph only applies to {{ech}} and {{serverless-short}}, and another paragraph only applies to {{ece}}:
22-
23-
````md
24-
## Cloud organization level security [cloud-organization-level]
25-
```{applies_to}
26-
deployment:
27-
ess: ga
28-
serverless: ga
29-
```
30-
31-
[...]
32-
33-
## Orchestrator level security [orchestrator-level]
34-
```{applies_to}
35-
deployment:
36-
ece: ga
37-
```
38-
39-
[...]
40-
````
1+
:::::{dropdown} Applicable to Stack and Serverless, minus a section
2+
3+
````markdown
4+
---
5+
applies_to:
6+
stack: ga
7+
serverless: ga
8+
---
9+
10+
# Spaces
11+
12+
[...]
13+
14+
#### Configure a space-level landing page [space-landing-page]
15+
```{applies_to}
16+
serverless: unavailable
17+
```
18+
````
19+
:::::
20+
21+
:::::{dropdown} Applicable to all deployment types, but some paragraphs are specific to other deployment types
22+
23+
````markdown
24+
#### Cloud organization level security [cloud-organization-level]
25+
```{applies_to}
26+
deployment:
27+
ess: ga
28+
serverless: ga
29+
```
30+
31+
[...]
32+
33+
#### Orchestrator level security [orchestrator-level]
34+
```{applies_to}
35+
deployment:
36+
ece: ga
37+
```
38+
39+
[...]
40+
````
41+
:::::

0 commit comments

Comments
 (0)