Skip to content

Commit 490dea0

Browse files
committed
unify examples
1 parent b56af45 commit 490dea0

File tree

6 files changed

+145
-225
lines changed

6 files changed

+145
-225
lines changed

docs/contribute/cumulative-docs.md

Lines changed: 10 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -28,127 +28,29 @@ This tagging system is mandatory for all of the public-facing documentation. We
2828
## Tagging products and deployment models
2929

3030
### Page-level frontmatter (mandatory)
31-
First and foremost, each documentation page **must** specify which contexts it applies to in its [frontmatter](https://elastic.github.io/docs-builder/syntax/frontmatter).
31+
32+
All documentation pages **must** include an `applies_to` tag in the YAML frontmatter. Use YAML frontmatter to indicate each deployment target's availability and lifecycle status.
3233

3334
* The `applies_to` attribute is used to display contextual badges on each page.
3435
* The `products` attribute is used by the search to let users filter their results when searching the docs.
3536

3637
For the full list of supported keys and values, refer to [frontmatter](https://elastic.github.io/docs-builder/syntax/frontmatter).
3738

38-
There are 3 typical scenarios to start from:
39-
40-
* The documentation set or page is primarily about using or interacting with Elastic Stack components or the serverless UI:
41-
42-
```yml
43-
---
44-
applies_to:
45-
stack: ga
46-
serverless: ga
47-
products:
48-
- id: kibana
49-
- id: elasticsearch
50-
- id: elastic-stack
51-
---
52-
```
53-
54-
* The documentation set or page is primarily about orchestrating, deploying or configuring an installation (only include relevant keys):
55-
56-
```yml
57-
---
58-
applies_to:
59-
serverless: ga
60-
deployment:
61-
ess: ga
62-
ece: ga
63-
eck: ga
64-
products:
65-
-id: cloud-serverless
66-
-id: cloud-hosted
67-
-id: cloud-enterprise
68-
-id: cloud-kubernetes
69-
---
70-
71-
```
72-
73-
* The documentation set or page is primarily about a product following its own versioning schema:
74-
75-
```yml
76-
---
77-
applies_to:
78-
product: ga
79-
products:
80-
-id: edot-collector
81-
---
82-
```
83-
% changing soon
84-
85-
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.
8639

87-
```yml
88-
---
89-
applies_to:
90-
stack: ga
91-
serverless: ga
92-
deployment:
93-
ess: ga
94-
ece: ga
95-
eck: ga
96-
products:
97-
-id: kibana
98-
-id: elasticsearch
99-
-id: elastic-stack
100-
-id: cloud-serverless
101-
-id: cloud-hosted
102-
-id: cloud-enterprise
103-
-id: cloud-kubernetes
104-
---
105-
```
106-
% I don't know what this example is supposed to show
40+
:::{include} /syntax/_snippets/page-level-applies-examples.md
41+
:::
10742

10843
### Section or inline contexts (situational)
10944

11045
When the context differs from what was specified at the page level in a specific section or part of the page, it is appropriate to re-establish it. For example:
11146

112-
* 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 in {{serverless-short}}):
113-
114-
````md
115-
## Configure a space-level landing page [space-landing-page]
116-
```{applies_to}
117-
stack: ga
118-
serverless: unavailable
119-
```
120-
````
121-
122-
* 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}}:
123-
124-
````md
125-
## Cloud organization level security [cloud-organization-level]
126-
```{applies_to}
127-
deployment:
128-
ess: ga
129-
serverless: ga
130-
```
131-
132-
[...]
133-
134-
## Orchestrator level security [orchestrator-level]
135-
```{applies_to}
136-
deployment:
137-
ece: ga
138-
```
139-
140-
[...]
141-
````
47+
:::{include} /syntax/_snippets/section-level-applies-examples.md
48+
:::
14249

14350
* Likewise, when the difference is specific to just one paragraph or list item, the same rules apply. Just the syntax slightly differs so that it stays inline:
14451

145-
```md
146-
**Spaces** let you organize your content and users according to your needs.
147-
148-
- Each space has its own saved objects.
149-
- Users can only access the spaces that they have been granted access to. This access is based on user roles, and a given role can have different permissions per space.
150-
- {applies_to}`stack: ga` {applies_to}`serverless: unavailable` Each space has its own navigation, called solution view.
151-
```
52+
:::{include} _snippets/line-level-applies-example.md
53+
:::
15254

15355
### When should I indicate that something is NOT applicable to a specific context?
15456

@@ -173,12 +75,12 @@ This is true for most situations. However, it can still be useful to call it out
17375

17476
* When a specific section, paragraph or list item has specific applicability that differs from the context set at the page or section level, and the action is not possible at all for that context (meaning that there is no alternative). For example:
17577

176-
````yml
78+
````md
17779
---
17880
applies_to:
17981
stack: ga
18082
serverless: ga
181-
83+
--
18284

18385
# Spaces
18486

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
````markdown
2+
**Spaces** let you organize your content and users according to your needs.
3+
4+
- Each space has its own saved objects.
5+
- {applies_to}`stack: ga` {applies_to}`serverless: unavailable` Each space has its own navigation, called solution view.
6+
````
7+
% I think we wanted to not specify stack here

docs/syntax/_snippets/multiple-lifecycle-states.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
FIX ME!!!
2-
3-
4-
`applies_to` keys accept comma-separated values. For example:
1+
`applies_to` keys accept comma-separated values to specify lifecycle states for multiple product versions. For example:
52

63
* A feature is added in 9.1 as tech preview and becomes GA in 9.4:
74

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
There are 3 typical scenarios to start from:
2+
3+
* The documentation set or page is primarily about using or interacting with Elastic Stack components or the Serverless UI:
4+
5+
```yml
6+
---
7+
applies_to:
8+
stack: ga
9+
serverless: ga
10+
products:
11+
- id: kibana
12+
- id: elasticsearch
13+
- id: elastic-stack
14+
---
15+
```
16+
17+
* The documentation set or page is primarily about orchestrating, deploying or configuring an installation (only include relevant keys):
18+
19+
```yml
20+
---
21+
applies_to:
22+
serverless: ga
23+
deployment:
24+
ess: ga
25+
ece: ga
26+
eck: ga
27+
products:
28+
-id: cloud-serverless
29+
-id: cloud-hosted
30+
-id: cloud-enterprise
31+
-id: cloud-kubernetes
32+
---
33+
34+
```
35+
36+
* The documentation set or page is primarily about a product following its own versioning schema:
37+
38+
```yml
39+
---
40+
applies_to:
41+
product: ga
42+
products:
43+
-id: edot-collector
44+
---
45+
```
46+
% changing soon
47+
48+
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.
49+
50+
```yml
51+
---
52+
applies_to:
53+
stack: ga
54+
serverless: ga
55+
deployment:
56+
ess: ga
57+
ece: ga
58+
eck: ga
59+
products:
60+
-id: kibana
61+
-id: elasticsearch
62+
-id: elastic-stack
63+
-id: cloud-serverless
64+
-id: cloud-hosted
65+
-id: cloud-enterprise
66+
-id: cloud-kubernetes
67+
---
68+
```
69+
% I don't know what this example is supposed to show
70+
71+
72+
73+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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+
````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+
stack: ga
17+
serverless: unavailable
18+
```
19+
````
20+
% I think we wanted to not specify stack here
21+
22+
* 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}}:
23+
24+
````md
25+
## Cloud organization level security [cloud-organization-level]
26+
```{applies_to}
27+
deployment:
28+
ess: ga
29+
serverless: ga
30+
```
31+
32+
[...]
33+
34+
## Orchestrator level security [orchestrator-level]
35+
```{applies_to}
36+
deployment:
37+
ece: ga
38+
```
39+
40+
[...]
41+
````

0 commit comments

Comments
 (0)