Skip to content

Commit 050d056

Browse files
theletterfcolleenmcginnisflorent-leborgne
authored
Restructure doc and add inline examples (#1793)
* Restructure doc and add inline examples * Update docs/syntax/applies.md Co-authored-by: Colleen McGinnis <[email protected]> * Update docs/syntax/_snippets/inline-level-applies-examples.md Co-authored-by: Colleen McGinnis <[email protected]> * Peer edits * Move examples * Move section * Clarify note * Update docs/syntax/_snippets/inline-level-applies-examples.md Co-authored-by: florent-leborgne <[email protected]> * Update docs/syntax/applies.md Co-authored-by: Colleen McGinnis <[email protected]> * Update docs/_snippets/applies_to-key.md Co-authored-by: Colleen McGinnis <[email protected]> * Update docs/syntax/_snippets/section-level-applies-examples.md Co-authored-by: Colleen McGinnis <[email protected]> * Update docs/syntax/_snippets/section-level-applies-examples.md Co-authored-by: Colleen McGinnis <[email protected]> * Update docs/syntax/quick-ref.md Co-authored-by: Colleen McGinnis <[email protected]> --------- Co-authored-by: Colleen McGinnis <[email protected]> Co-authored-by: florent-leborgne <[email protected]>
1 parent 9dddf81 commit 050d056

File tree

9 files changed

+270
-195
lines changed

9 files changed

+270
-195
lines changed

docs/_snippets/applies_to-key.md

Lines changed: 4 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,7 +10,7 @@
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-
* `product`: Applies to a specific product that uses a unique versioning scheme (e.g. not `stack`, `ece`, `eck`).
13+
* `product`: Applies to a specific product that uses a unique versioning scheme (for example, not `stack`, `ece`, `eck`).
1414
* `apm_agent_dotnet`: Applies to the [Elastic APM .NET agent](https://www.elastic.co/docs/reference/apm/agents/dotnet).
1515
* `apm_agent_go`: Applies to the [Elastic APM Go agent](https://www.elastic.co/docs/reference/apm/agents/go).
1616
* `apm_agent_java`: Applies to the [Elastic APM Java agent](https://www.elastic.co/docs/reference/apm/agents/java).
@@ -30,7 +30,7 @@
3030
* `edot_node`: Applies to the [Elastic Distribution of OpenTelemetry Node.js](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/nodejs/) (EDOT Node.js).
3131
* `edot_php`: Applies to the [Elastic Distribution of OpenTelemetry PHP](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/php/) (EDOT PHP).
3232
* `edot_python`: Applies to the [Elastic Distribution of OpenTelemetry Python](https://www.elastic.co/docs/reference/opentelemetry/edot-sdks/python/) (EDOT Python).
33-
33+
3434
:::{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.
35+
The `product` 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.
3636
:::

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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ 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}
44-
Do **not** use [section-level](/syntax/applies.md#section-annotations) or [inline annotations](/syntax/applies.md#inline-annotations) with the page title.
44+
Do **not** use [section-level](/syntax/applies.md#section-level) or [inline annotations](/syntax/applies.md#inline-level) with the page title.
4545
::::
4646

4747
### Headings [headings]
4848

49-
Use [section annotations](/syntax/applies.md#section-annotations) on the next line after a heading when the entire content between that heading and the next [heading](/syntax/headings.md) of the same or higher level is version or product-specific.
49+
Use [section annotations](/syntax/applies.md#section-level) on the next line after a heading when the entire content between that heading and the next [heading](/syntax/headings.md) of the same or higher level is version or product-specific.
5050

5151
For example, on the [Observability AI Assistant](https://www.elastic.co/docs/solutions/observability/observability-ai-assistant#choose-the-knowledge-base-language-model) page, all the content in this section is only applicable to Elastic Stack versions 9.1.0 and later.
5252

@@ -58,7 +58,7 @@ For example, on the [Observability AI Assistant](https://www.elastic.co/docs/sol
5858
% FOR THE REVIEWER: IS THIS TRUE?
5959
% What do you think of allowing inline applies_to in headings as long as there is only one badge?
6060
:::{warning}
61-
Do **not** use [inline annotations](/syntax/applies.md#inline-annotations) with headings.
61+
Do **not** use [inline annotations](/syntax/applies.md#inline-level) with headings.
6262

6363
::::{image} ./images/heading-incorrect.png
6464
:screenshot:
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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+
This example shows how to use directly a key from the second level of the `applies_to` data structure, like `edot_python:`.
30+
31+
:::::{tab-set}
32+
33+
::::{tab-item} Output
34+
35+
- {applies_to}`edot_python: preview 1.7.0`
36+
- {applies_to}`apm_agent_java: beta 1.0.0`
37+
38+
::::
39+
40+
::::{tab-item} Markdown
41+
```markdown
42+
- {applies_to}`edot_python: preview 1.7.0`
43+
- {applies_to}`apm_agent_java: beta 1.0.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` {applies_to}`stack: ga 9.1.0`
58+
- {applies_to}`edot_python: preview 1.7.0, ga 1.8.0` {applies_to}`apm_agent_java: beta 1.0.0, ga 1.2.0`
59+
- {applies_to}`stack: ga 9.0` {applies_to}`eck: ga 3.0`
60+
61+
::::
62+
63+
::::{tab-item} Markdown
64+
```markdown
65+
- {applies_to}`serverless: ga` {applies_to}`stack: ga 9.1.0`
66+
- {applies_to}`edot_python: preview 1.7.0, ga 1.8.0` {applies_to}`apm_agent_java: beta 1.0.0, ga 1.2.0`
67+
- {applies_to}`stack: ga 9.0` {applies_to}`eck: ga 3.0`
68+
```
69+
::::
70+
71+
:::::
72+
::::::
73+

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+
serverless: ga
27+
deployment:
28+
ess: 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)