Skip to content

Commit c4f8eee

Browse files
reorg
1 parent c3a53ce commit c4f8eee

File tree

8 files changed

+307
-237
lines changed

8 files changed

+307
-237
lines changed

docs/contribute/cumulative-docs/best-practices.md

Lines changed: 95 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Depending on what you're trying to communicate, you can use the following patter
1414
Instead, contributors should be able to add them anywhere they need, and the system should
1515
be in charge of rendering them clearly.
1616

17-
* Always put the newest version first when listing multiple versions.
18-
1917
% Reference: https://github.com/elastic/kibana/pull/229485/files#r2231876006
2018
* Avoid using version numbers in prose adjacent to `applies_to` badge to prevent
2119
confusion when the badge is rended with `Planned` ahead of a release.
@@ -27,47 +25,111 @@ Depending on what you're trying to communicate, you can use the following patter
2725
* Do not assume a default deployment type, stack flavor, product version, or project type.
2826
Treat all flavors and deployment types equally. Don't treat one as the "base" and the other as the "exception".
2927

28+
## Order of items
29+
30+
**Versions.** Always put the newest version first when listing multiple versions. As a result, the lifecycles should be in order of product development progression, too.
31+
3032
% Reference: https://elastic.github.io/docs-builder/versions/#defaults-and-hierarchy
3133
% Needs work...
32-
* List keys in the same order for consistency. This order reflects organizational priorities.
33-
* Serverless
34-
* Stack
35-
* Elastic Cloud Hosted
36-
* Elastic Cloud on Kubernetes
37-
* Elastic Cloud Enterprise
38-
* Self-managed
34+
**Keys.** Always list [keys](/contribute/cumulative-docs/reference.md#key) in the same order for consistency. The order of keys should reflect organizational priorities. For example, use the following order:
35+
* **Serverless/Elastic Stack**: Serverless, Stack
36+
* **Deployment types**: Elastic Cloud Serverless, Elastic Cloud Hosted, Elastic Cloud on Kubernetes, Elastic Cloud Enterprise, Self-managed
37+
* **Monitoring for Java applications**: Elastic Distribution of OpenTelemetry (EDOT) Java, APM Java agent
3938

40-
## Placement of labels
39+
## Placement of badges
4140

4241
% Reference: https://github.com/elastic/docs-builder/issues/1574
43-
* **Headings**: Use section annotations immediately after the heading.
44-
Do _not_ use inline annotations with headings, which will cause rendering issues in "On this page".
42+
### Headings
43+
44+
Use [section annotations](/syntax/applies.md#section-annotations) immediately after a heading when the entire content between that heading and the next [heading](/syntax/headings.md) of the same and higher level.
45+
46+
For example, in the [Semantic text field type](https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/semantic-text#custom-by-pipelines) page, all the content in this section is only applicable to Elastic Stack versions 9.0.0 and later.
47+
48+
::::{image} ./images/heading-correct.png
49+
:screenshot:
50+
:alt: Correct use of applies_to with headings
51+
::::
52+
53+
:::{warning}
54+
Do **not** use [inline annotations](/syntax/applies.md#inline-annotations) with headings, which will cause rendering issues in _On this page_.
55+
56+
::::{image} ./images/heading-incorrect.png
57+
:screenshot:
58+
:alt: Rendering error when using inline applies_to with headings
59+
::::
60+
:::
4561

4662
% Reference: https://github.com/elastic/kibana/pull/229485/files
47-
* **Definition lists**: If the `applies_to` badge is relevant to the entire contents of the list item,
48-
put it at the end of the term (on the same line).
63+
### Definition lists
64+
65+
The recommended placement of `applies_to` badges in definition lists varies based what part(s) of the list item relate to the badge.
66+
67+
**If the badge is relevant to the entire contents of a list item, put it at the end of the term.** This means using an inline annotation at the end of the same line as the term. For example, on the Kibana [Advanced settings](https://www.elastic.co/docs/reference/kibana/advanced-settings#kibana-banners-settings) page, the entire `banners:linkColor` option is only available in Elastic Stack 9.1.0 and later.
68+
69+
:::{image} ./images/definition-list-entire-item.png
70+
:screenshot:
71+
:alt: Correct use of applies_to with definition list item
72+
:::
73+
74+
:::{warning}
75+
Do **not** put the `applies_to` badge at the beginning or end of the definition if it relates to the entire contents of the item.
76+
77+
::::{image} ./images/definition-list-item-incorrect.png
78+
:screenshot:
79+
:alt: Incorrectly using inline applies_to with a definition list item
80+
::::
81+
:::
82+
83+
**If the badge is only relevant to a portion of the definition, follow the appropriate placement guidelines for the elements used in the definition.** This might include labeling just one of multiple paragraphs or one item in an ordered or unordered list. For example, on the ... page, ...
84+
85+
::::{image} ./images/definition-list-portion-correct.png
86+
:screenshot:
87+
:alt: Correctly using inline applies_to in a portion of a definition list item
88+
::::
4989

5090
% Reference: TBD
51-
* **Ordered and unordered lists**: Reorganize content as needed so the `applies_to` badge is relevant
52-
to the entire contents of the list item. The recommended placement of the badge varies:
53-
* If the purpose of the list is to illustrate the difference between several applications (deployment types,
54-
products, lifecycles, versions, etc.) put an `applies_to` badge at the start of each item.
55-
* If the list just happens to have one or more items that are only relevant to specific application
56-
(deployment type, product, lifecycle, version, etc.) put the `applies_to` badge at the end of the list item.
91+
### Ordered and unordered lists
92+
93+
Reorganize content as needed so the `applies_to` badge is relevant to the entire contents of the list item.
94+
The recommended placement of the badge varies based on the purpose of the list.
95+
96+
**If the purpose of the list is to illustrate the difference between situations, put a badge at the start of each item.**
97+
This could mean distinguishing between deployment types, products, lifecycles, or versions.
98+
For example, the [Alerting and action settings in Kibana](https://www.elastic.co/docs/reference/kibana/configuration-reference/alerting-settings) page lists how the default value for the `xpack.actions.preconfigured.<connector-id>.config.defaultModel` setting varies in Serverless/Stack and across versions.
99+
100+
::::{image} ./images/list-correct.png
101+
:screenshot:
102+
:alt:
103+
::::
104+
105+
**If the list just happens to have one or more items that are only relevant to a specific situation, put the badge at the end of the list item.**
106+
(deployment type, product, lifecycle, version, etc.)
107+
108+
<image>
57109

58110
% Reference: Slack conversation
59-
* **Tables**: The recommended placement in tables varies:
60-
* If the `applies_to` badge is relevant to the entire row, add the badge to the end of
61-
the first column. For example, a table that contains one setting per row and a new setting
62-
is added in 9.1.0.
63-
* If the `applies_to` badge is relevant to one cell or part of a cell, add the badge to the
64-
end of the line it applies to. For example, a new property is available in 9.1.0 for a setting
65-
that already existed before 9.1.0.
66-
% Reference: https://github.com/elastic/kibana/pull/229485/files#r2231856744
67-
If needed, break the contents of the cell into multiple lines using `<br>` to isolate the
68-
content you're labeling.
69-
70-
## Scenarios [scenarios]
111+
### Tables
112+
113+
The recommended placement in tables varies based on what part(s) of the table related to the `applies_to` label.
114+
115+
**If the badge is relevant to the entire row, add the badge to the end of the first column.**
116+
For example, a table that contains one setting per row and a new setting is added in 9.1.0.
117+
118+
<image>
119+
120+
**If the badge is relevant to one cell or part of a cell, add the badge to the end of the line it applies to.**
121+
For example, a new property is available in 9.1.0 for a setting that already existed before 9.1.0.
122+
123+
<image>
124+
125+
% Reference: https://github.com/elastic/kibana/pull/229485/files#r2231856744
126+
:::{tip}
127+
If needed, break the contents of the cell into multiple lines using `<br>` to isolate the content you're labeling.
128+
129+
<image>
130+
:::
131+
132+
<!-- ## Scenarios [scenarios]
71133
72134
There are several scenarios you will likely run into at some point when contributing to the docs.
73135
@@ -193,4 +255,4 @@ Follow these principles to use screenshots in our unversioned documentation syst
193255
:::
194256
:::{tab-item} Syntax
195257
:::
196-
::::
258+
:::: -->

0 commit comments

Comments
 (0)