Skip to content

Commit c4ccbfd

Browse files
authored
Merge branch 'main' into carousel-support
2 parents ac6ab28 + 6684cf2 commit c4ccbfd

File tree

63 files changed

+1589
-400
lines changed

Some content is hidden

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

63 files changed

+1589
-400
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ csharp_style_namespace_declarations = file_scoped
213213
dotnet_analyzer_diagnostic.severity = warning
214214
dotnet_analyzer_diagnostic.category-Style.severity = warning
215215

216+
# can be made static
217+
dotnet_diagnostic.CA1822.severity = suggestion
218+
216219
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1848
217220
dotnet_diagnostic.CA1848.severity = suggestion
218221
# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2201

docs/_docset.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,15 @@ toc:
9393
- file: frontmatter.md
9494
- file: icons.md
9595
- file: images.md
96+
- file: kbd.md
9697
- file: lists.md
9798
- file: line_breaks.md
9899
- file: links.md
99100
- file: passthrough.md
100101
- file: sidebars.md
101102
- file: stepper.md
102103
- file: substitutions.md
104+
- file: version-variables.md
103105
- file: sundries.md
104106
- file: tables.md
105107
- file: tabs.md

docs/syntax/kbd.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Keyboard shortcuts
2+
3+
You can represent keyboard keys and shortcuts in your documentation using the `{kbd}` role. This is useful for showing keyboard commands and shortcuts in a visually consistent way. See the full list of [available keys](#available-keys).
4+
5+
## Basic usage
6+
7+
To display a keyboard key, use the syntax `` {kbd}`key-name` ``. For example, writing `` {kbd}`enter` `` will render as a styled keyboard key.
8+
9+
::::{tab-set}
10+
11+
:::{tab-item} Output
12+
Press {kbd}`enter` to submit.
13+
:::
14+
15+
:::{tab-item} Markdown
16+
```markdown
17+
Press {kbd}`enter` to submit.
18+
```
19+
:::
20+
21+
::::
22+
23+
## Combining keys
24+
25+
For keyboard shortcuts involving multiple keys, you can combine them within a single `{kbd}` role by separating the key names with a `+`. Keys are always visually separated, even when using the combined syntax.
26+
27+
::::{tab-set}
28+
29+
:::{tab-item} Output
30+
Use {kbd}`cmd+shift+enter` to execute the command.
31+
:::
32+
33+
:::{tab-item} Markdown
34+
```markdown
35+
Use {kbd}`cmd+shift+enter` to execute the command.
36+
```
37+
:::
38+
39+
::::
40+
41+
## Alternative keys
42+
43+
To display alternative keys for a shortcut, use `|` to separate the alternate keys within the same `{kbd}` role. This is useful for showing platform-specific shortcuts, such as `ctrl` on Windows and `cmd` on macOS.
44+
45+
::::{tab-set}
46+
47+
:::{tab-item} Output
48+
Use {kbd}`ctrl|cmd + c` to copy text.
49+
:::
50+
51+
:::{tab-item} Markdown
52+
```markdown
53+
Use {kbd}`ctrl|cmd + c` to copy text.
54+
```
55+
:::
56+
57+
::::
58+
59+
## Reserved characters
60+
61+
The `+` and `|` characters have special meaning for combining keys and specifying alternatives. To render them as literal keys, you must use their keyword equivalents.
62+
63+
- To display the {kbd}`plus` key, use `` `{kbd}`plus` ``.
64+
- To display the {kbd}`pipe` key, use `` `{kbd}`pipe` ``.
65+
66+
## Common shortcuts by platform
67+
68+
The platform-specific examples below demonstrate how to combine special keys and regular characters.
69+
70+
::::{tab-set}
71+
72+
:::{tab-item} Output
73+
74+
| Mac | Windows/Linux | Description |
75+
|------------------|-------------------|-----------------------------|
76+
| {kbd}`cmd+c` | {kbd}`ctrl+c` | Copy |
77+
| {kbd}`cmd+v` | {kbd}`ctrl+v` | Paste |
78+
| {kbd}`cmd+z` | {kbd}`ctrl+z` | Undo |
79+
| {kbd}`cmd+enter` | {kbd}`ctrl+enter` | Run a query |
80+
| {kbd}`cmd+/` | {kbd}`ctrl+/` | Comment or uncomment a line |
81+
82+
:::
83+
84+
:::{tab-item} Markdown
85+
```markdown
86+
| Mac | Windows/Linux | Description |
87+
|------------------|-------------------|-----------------------------|
88+
| {kbd}`cmd+c` | {kbd}`ctrl+c` | Copy |
89+
| {kbd}`cmd+v` | {kbd}`ctrl+v` | Paste |
90+
| {kbd}`cmd+z` | {kbd}`ctrl+z` | Undo |
91+
| {kbd}`cmd+enter` | {kbd}`ctrl+enter` | Run a query |
92+
| {kbd}`cmd+/` | {kbd}`ctrl+/` | Comment or uncomment a line |
93+
```
94+
:::
95+
96+
::::
97+
98+
## Available keys
99+
100+
The `{kbd}` role recognizes a set of special keywords for modifier, navigation, and function keys. Any other text will be rendered as a literal key.
101+
102+
Here is the full list of available keywords:
103+
104+
| Syntax | Rendered Output |
105+
|-------------------------|------------------|
106+
| `` {kbd}`shift` `` | {kbd}`shift` |
107+
| `` {kbd}`ctrl` `` | {kbd}`ctrl` |
108+
| `` {kbd}`alt` `` | {kbd}`alt` |
109+
| `` {kbd}`option` `` | {kbd}`option` |
110+
| `` {kbd}`cmd` `` | {kbd}`cmd` |
111+
| `` {kbd}`win` `` | {kbd}`win` |
112+
| `` {kbd}`up` `` | {kbd}`up` |
113+
| `` {kbd}`down` `` | {kbd}`down` |
114+
| `` {kbd}`left` `` | {kbd}`left` |
115+
| `` {kbd}`right` `` | {kbd}`right` |
116+
| `` {kbd}`space` `` | {kbd}`space` |
117+
| `` {kbd}`tab` `` | {kbd}`tab` |
118+
| `` {kbd}`enter` `` | {kbd}`enter` |
119+
| `` {kbd}`esc` `` | {kbd}`esc` |
120+
| `` {kbd}`backspace` `` | {kbd}`backspace` |
121+
| `` {kbd}`del` `` | {kbd}`delete` |
122+
| `` {kbd}`ins` `` | {kbd}`insert` |
123+
| `` {kbd}`pageup` `` | {kbd}`pageup` |
124+
| `` {kbd}`pagedown` `` | {kbd}`pagedown` |
125+
| `` {kbd}`home` `` | {kbd}`home` |
126+
| `` {kbd}`end` `` | {kbd}`end` |
127+
| `` {kbd}`f1` `` | {kbd}`f1` |
128+
| `` {kbd}`f2` `` | {kbd}`f2` |
129+
| `` {kbd}`f3` `` | {kbd}`f3` |
130+
| `` {kbd}`f4` `` | {kbd}`f4` |
131+
| `` {kbd}`f5` `` | {kbd}`f5` |
132+
| `` {kbd}`f6` `` | {kbd}`f6` |
133+
| `` {kbd}`f7` `` | {kbd}`f7` |
134+
| `` {kbd}`f8` `` | {kbd}`f8` |
135+
| `` {kbd}`f9` `` | {kbd}`f9` |
136+
| `` {kbd}`f10` `` | {kbd}`f10` |
137+
| `` {kbd}`f11` `` | {kbd}`f11` |
138+
| `` {kbd}`f12` `` | {kbd}`f12` |
139+
| `` {kbd}`plus` `` | {kbd}`plus` |
140+
| `` {kbd}`fn` `` | {kbd}`fn` |
141+
| `` {kbd}`pipe` `` | {kbd}`pipe` |

docs/syntax/substitutions.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ sub:
33
frontmatter_key: "Front Matter Value"
44
a-key-with-dashes: "A key with dashes"
55
version: 7.17.0
6+
hello-world: "Hello world!"
67
---
78

89
# Substitutions
@@ -26,7 +27,7 @@ Doing so will result in a build error.
2627

2728
To use the variables in your files, surround them in curly brackets (`{{variable}}`).
2829

29-
## Example
30+
### Example
3031

3132
Here are some variable substitutions:
3233

@@ -36,6 +37,97 @@ Here are some variable substitutions:
3637
| {{a-key-with-dashes}} | Front Matter |
3738
| {{a-global-variable}} | `docset.yml` |
3839

40+
## Mutations
41+
42+
Substitutions can be mutated using a chain of operators seperated by a pipe (`|`).
43+
44+
````markdown
45+
`{{hello-world | trim | lc | tc}}`
46+
````
47+
48+
Will trim, lowercase and finally titlecase the contents of the 'hello-world' variable.
49+
50+
### Operators
51+
52+
53+
| Operator | Purpose |
54+
|----------|----------------------------------------------------|
55+
| `lc` | LowerCase, |
56+
| `uc` | UpperCase, |
57+
| `tc` | TitleCase, capitalizes all words, |
58+
| `c` | Capitalize the first letter, |
59+
| `kc` | Convert to KebabCase, |
60+
| `sc` | Convert to SnakeCase, |
61+
| `cc` | Convert to CamelCase, |
62+
| `pc` | Convert to PascalCase, |
63+
| `trim` | Trim common non word characters from start and end |
64+
65+
For variables declaring a semantic version or `Major.Minor` the following operations are also exposed
66+
67+
| Operator | Purpose |
68+
|----------|------------------------------------------|
69+
| `M` | Display only the major component |
70+
| `M.x` | Display major component followed by '.x' |
71+
| `M.M` | Display only the major and the minor |
72+
| `M+1` | The next major version |
73+
| `M.M+1` | The next minor version |
74+
75+
### Example
76+
77+
Given the following frontmatter:
78+
79+
```yaml
80+
---
81+
sub:
82+
hello-world: "Hello world!"
83+
---
84+
```
85+
86+
::::{tab-set}
87+
88+
:::{tab-item} Output
89+
90+
* Lowercase: {{hello-world | lc}}
91+
* Uppercase: {{hello-world | uc}}
92+
* TitleCase: {{hello-world | tc}}
93+
* kebab-case: {{hello-world | kc}}
94+
* camelCase: {{hello-world | tc | cc}}
95+
* PascalCase: {{hello-world | pc}}
96+
* SnakeCase: {{hello-world | sc}}
97+
* CapitalCase (chained): {{hello-world | lc | c}}
98+
* Trim: {{hello-world | trim}}
99+
* M.x: {{version.stack | M.x }}
100+
* M.M: {{version.stack | M.M }}
101+
* M: {{version.stack | M }}
102+
* M+1: {{version.stack | M+1 }}
103+
* M+1 | M.M: {{version.stack | M+1 | M.M }}
104+
* M.M+1: {{version.stack | M.M+1 }}
105+
106+
:::
107+
108+
:::{tab-item} Markdown
109+
110+
````markdown
111+
* Lowercase: {{hello-world | lc}}
112+
* Uppercase: {{hello-world | uc}}
113+
* TitleCase: {{hello-world | tc}}
114+
* kebab-case: {{hello-world | kc}}
115+
* camelCase: {{hello-world | tc | cc}}
116+
* PascalCase: {{hello-world | pc}}
117+
* SnakeCase: {{hello-world | sc}}
118+
* CapitalCase (chained): {{hello-world | lc | c}}
119+
* Trim: {{hello-world | trim}}
120+
* M.x: {{version.stack | M.x }}
121+
* M.M: {{version.stack | M.M }}
122+
* M: {{version.stack | M }}
123+
* M+1: {{version.stack | M+1 }}
124+
* M+1 | M.M: {{version.stack | M+1 | M.M }}
125+
* M.M+1: {{version.stack | M.M+1 }}
126+
````
127+
:::
128+
129+
::::
130+
39131
## Code blocks
40132

41133
Substitutions are supported in code blocks but are disabled by default. Enable substitutions by adding `subs=true` to the code block.

docs/syntax/version-variables.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Version Variables
2+
3+
Version are exposed during build using the `{{versions.VERSIONING_SCHEME}}` variable.
4+
5+
For example `stack` versioning variables are exposed as `{{versions.stack}}`.
6+
7+
## Specialized Suffixes.
8+
9+
Besides the current version, the following suffixes are available:
10+
11+
| Version substitution | result | purpose |
12+
|--------------------------------------|-----------------------------------|-----------------------------------------|
13+
| `{{version.stack}}` | {{version.stack}} | Current version |
14+
| `{{version.stack.base}}` | {{version.stack.base}} | The first version on the new doc system |
15+
16+
## Formatting
17+
18+
Using specialized [mutation operators](substitutions.md#mutations) versions
19+
can be printed in any kind of ways.
20+
21+
22+
| Version substitution | result |
23+
|------------------------|-----------|
24+
| `{{version.stack| M.M}}` | {{version.stack|M.M}} |
25+
| `{{version.stack.base | M }}` | {{version.stack.base | M }} |
26+
| `{{version.stack | M+1 | M }}` | {{version.stack | M+1 | M }} |
27+
| `{{version.stack.base | M.M+1 }}` | {{version.stack.base | M.M+1 }} |
28+
29+
## Available versioning schemes.
30+
31+
This is dictated by the [versions.yml](https://github.com/elastic/docs-builder/blob/main/src/Elastic.Documentation.Configuration/versions.yml) configuration file
32+
33+
* `stack`
34+
* `ece`
35+
* `ech`
36+
* `eck`
37+
* `ess`
38+
* `self`
39+
* `ecctl`
40+
* `curator`
41+
* `security`
42+
* `apm_agent_android`
43+
* `apm_agent_ios`
44+
* `apm_agent_dotnet`
45+
* `apm_agent_go`
46+
* `apm_agent_java`
47+
* `apm_agent_node`
48+
* `apm_agent_php`
49+
* `apm_agent_python`
50+
* `apm_agent_ruby`
51+
* `apm_agent_rum`
52+
* `edot_ios`
53+
* `edot_android`
54+
* `edot_dotnet`
55+
* `edot_java`
56+
* `edot_node`
57+
* `edot_php`
58+
* `edot_python`
59+
* `edot_cf_aws`
60+
* `edot_collector`
61+
62+
The following are available but should not be used. These map to serverless projects and have a fixed high version number.
63+
64+
* `all`
65+
* `ech`
66+
* `ess` (This is deprectated but was added for backwards-compatibility.)
67+
68+
* `serverless`
69+
* `elasticsearch`
70+
* `observability`

src/Elastic.ApiExplorer/Landing/LandingNavigationItem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public LandingNavigationItem(string url)
5252
}
5353

5454
/// <inheritdoc />
55-
public bool IsUsingNavigationDropdown => NavigationItems.OfType<ClassificationNavigationItem>().Any();
55+
public bool IsUsingNavigationDropdown => false;
5656
}
5757

5858
public interface IApiGroupingNavigationItem<out TGroupingModel, out TNavigationItem> : INodeNavigationItem<TGroupingModel, TNavigationItem>
@@ -106,7 +106,7 @@ public class ClassificationNavigationItem(ApiClassification classification, Land
106106
public override string Id { get; } = ShortId.Create(classification.Name);
107107

108108
/// <inheritdoc />
109-
public bool IsUsingNavigationDropdown => true;
109+
public bool IsUsingNavigationDropdown => false;
110110
}
111111

112112
public class TagNavigationItem(ApiTag tag, IRootNavigationItem<IApiGroupingModel, INavigationItem> rootNavigation, INodeNavigationItem<INavigationModel, INavigationItem> parent)

0 commit comments

Comments
 (0)