Skip to content

Commit 5ff5412

Browse files
authored
Merge pull request #143 from gtardif/docs_jeckyll_metadata
preparing docs for inclusion in docs.docker.com
2 parents e47fa62 + 6f48f9c commit 5ff5412

24 files changed

+487
-397
lines changed

docs/design/design-overview.md

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
# UI Guidelines
1+
---
2+
title: Docker extension design
3+
description: Docker extension design
4+
keywords: Docker, extensions, design
5+
---
26

3-
Our Design System is currently being developed. In the meantime, here are some basic [UI guidelines](https://www.figma.com/file/U7pLWfEf6IQKUHLhdateBI/Docker-Design-Guidelines?node-id=1%3A28771) you can follow.
7+
# UI Guidelines
8+
9+
Our Design System is currently being developed. In the meantime, here are some basic [UI guidelines](https://www.figma.com/file/U7pLWfEf6IQKUHLhdateBI/Docker-Design-Guidelines?node-id=1%3A28771) you can follow.
410

511
# Using Docker Material UI Theme
612

7-
Docker Desktop's UI is written in React and [Material-UI](https://mui.com/). We strongly recommend you adopt this combination in your extension as well.
13+
Docker Desktop's UI is written in React and [Material-UI](https://mui.com/). We strongly recommend you adopt this combination in your extension as well.
814

915
Use our [Docker Material UI Theme](https://www.npmjs.com/package/@docker/docker-mui-theme) to easily replicate Docker Desktop's look & feel. We'll continue to release libraries and utilities targeting this combination.
1016

1117
To use [Docker's Material UI theme](https://www.npmjs.com/package/@docker/docker-mui-theme) with your extension, wrap your React app with our theme provider:
1218

1319
```typescript
14-
import { DockerMuiThemeProvider } from '@docker/docker-mui-theme';
15-
import CssBaseline from '@mui/material/CssBaseline';
20+
import { DockerMuiThemeProvider } from "@docker/docker-mui-theme";
21+
import CssBaseline from "@mui/material/CssBaseline";
1622

1723
function App() {
1824
return (
@@ -25,35 +31,33 @@ function App() {
2531
```
2632

2733
# Design Principles
34+
2835
At Docker, we aim to build tools that integrate into a user's existing workflows rather than requiring them to adopt new ones. To that end, we recommend the design principles listed below.
2936

3037
## Clear Call-to-Actions
31-
When you use call-to-actions (CTAs), use familiar terms that do not have an ambiguous meaning. Avoid using too many CTAs on one page, wherever possible. If you need to use multiple CTAs, ensure the hierarchy is conveyed through the use of primary and secondary actions.
38+
39+
When you use call-to-actions (CTAs), use familiar terms that do not have an ambiguous meaning. Avoid using too many CTAs on one page, wherever possible. If you need to use multiple CTAs, ensure the hierarchy is conveyed through the use of primary and secondary actions.
3240

3341
Below is an example of the use of a primary (Save) and a secondary (Cancel) button.
3442

3543
![UI Extension](images/cta-example.png)
3644

37-
3845
## Use the UI
46+
3947
The advantage of Docker Desktop compared to the CLI is the opportunity to provide rich information to users. Make use of this interface as much as possible. Avoid embedding terminal windows if they are not necessary.
4048

4149
## Build native features
4250

43-
Try to avoid scenarios where the user is redirected to a web page to configure settings or view information, for example. Build features natively wherever possible to ensure a seamless experience for users.
51+
Try to avoid scenarios where the user is redirected to a web page to configure settings or view information, for example. Build features natively wherever possible to ensure a seamless experience for users.
4452

4553
## Break down complicated flows into steps
4654

47-
If a flow is too complicated or the concept is abstract, break down the flow into multiple steps with one simple call-to-action in each step. This helps when onboarding novice users to your extension. Furthermore, try to provide contextual help instead of redirecting the user to elaborate documentation.
55+
If a flow is too complicated or the concept is abstract, break down the flow into multiple steps with one simple call-to-action in each step. This helps when onboarding novice users to your extension. Furthermore, try to provide contextual help instead of redirecting the user to elaborate documentation.
4856

4957
## Visibility of Status
5058

51-
Ensure the current status of the extension is always made visible and clear to users. This helps users feel in control and know what steps they have to take in order to reach their intended outcome. An example of a status could be “[Extension- name] is connecting to the remote cluster.”
59+
Ensure the current status of the extension is always made visible and clear to users. This helps users feel in control and know what steps they have to take in order to reach their intended outcome. An example of a status could be “[Extension- name] is connecting to the remote cluster.”
5260

53-
## User-friendly messages
61+
## User-friendly messages
5462

5563
When you show messages to the user, for example when an error occurs, avoid the use of detailed technical messages that rely on understanding low-level details. Use simple and concise messages with possible next steps so that a user knows how to remedy the situation.
56-
57-
58-
59-

docs/dev/api/backend.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: Docker extension development API
3+
description: Docker extension API
4+
keywords: Docker, extensions, sdk, API
5+
---
6+
17
# Communication with the extension backend
28

39
The `ddClient.extension.vm` object can be used to communicate with the backend defined in the [vm section](../.. /extensions/METADATA.md#vm-section) of the extension metadata.
@@ -16,11 +22,9 @@ ddClient.extension.vm.service
1622
1723
See [Service API Reference](reference/interfaces/HttpService.md#Methods) for other methods such as POST, UPDATE, and DELETE.
1824
19-
### Deprecated extension backend communication
20-
21-
!!! warning "Methods deprecated"
22-
23-
The methods below that use `window.ddClient.backend` are deprecated and will be removed in a future version. Use the methods specified above.
25+
> Deprecated extension backend communication
26+
>
27+
> The methods below that use `window.ddClient.backend` are deprecated and will be removed in a future version. Use the methods specified above.
2428
2529
The `window.ddClient.backend` object can be used to communicate with the backend
2630
defined in the [vm section](../../extensions/METADATA.md#vm-section) of the
@@ -68,7 +72,7 @@ await ddClient.extension.vm.cli.exec("ls", ["-l"]);
6872
6973
Stream the output of the command executed in the backend container. For example, spawn the command `ls -l` inside the backend container:
7074
71-
```typescript linenums="1"
75+
```typescript
7276
await ddClient.extension.vm.cli.exec("ls", ["-l"], {
7377
stream: {
7478
onOutput(data) {
@@ -90,11 +94,9 @@ await ddClient.extension.vm.cli.exec("ls", ["-l"], {
9094
9195
For more details, refer to the [Extension VM API Reference](reference/interfaces/ExtensionVM.md)
9296
93-
### Deprecated extension backend command execution
94-
95-
!!! warning "Method deprecated"
96-
97-
This method is deprecated and will be removed in a future version. Use the specified method above.
97+
> Deprecated extension backend command execution
98+
>
99+
> This method is deprecated and will be removed in a future version. Use the specified method above.
98100
99101
If your extension ships with additional binaries that should be run inside the
100102
backend container, you can use the `execInVMExtension` function:
@@ -119,7 +121,7 @@ await ddClient.extension.host.cli.exec("kubectl", ["-h"]);
119121
120122
As long as the `kubectl` binary is shipped as part of your extension, you can spawn the `kubectl -h` command in the host and get the output stream:
121123
122-
```typescript linenums="1"
124+
```typescript
123125
await ddClient.extension.host.cli.exec("kubectl", ["-h"], {
124126
stream: {
125127
onOutput(data: { stdout: string } | { stderr: string }): void {
@@ -143,11 +145,9 @@ You can stream the output of the command executed in the backend container or in
143145
144146
For more details, refer to the [Extension Host API Reference](reference/interfaces/ExtensionHost.md)
145147
146-
### Deprecated invocation of extension binary
147-
148-
!!! warning "Method deprecated"
149-
150-
This method is deprecated and will be removed in a future version. Use the method specified above.
148+
> Deprecated invocation of extension binary
149+
>
150+
> This method is deprecated and will be removed in a future version. Use the method specified above.
151151
152152
To execute a command in the host:
153153

docs/dev/api/dashboard-routes-navigation.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: Docker extension development API
3+
description: Docker extension API
4+
keywords: Docker, extensions, sdk, API
5+
---
6+
17
# Dashboard Routes Navigation
28

39
`ddClient.desktopUI.navigation` enables navigation to specific screens of Docker Desktop such as the containers tab, the images tab, or a specific container's logs.
@@ -22,11 +28,9 @@ A promise that fails if the container doesn't exist.
2228

2329
For more details about all navigation methods, see the [Navigation API reference](reference/interfaces/NavigationIntents.md).
2430

25-
### Deprecated navigation methods
26-
27-
!!! warning "Method deprecated"
28-
29-
These methdos are deprecated and will be removed in a future version. Use the methods specified above.
31+
> Deprecated navigation methods
32+
>
33+
> These methdos are deprecated and will be removed in a future version. Use the methods specified above.
3034
3135
```typescript
3236
window.ddClient.navigateToContainers();

docs/dev/api/dashboard.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: Docker extension development API
3+
description: Docker extension API
4+
keywords: Docker, extensions, sdk, API
5+
---
6+
17
## User notifications
28

39
Toasts provide a brief notification to the user. They appear temporarily and
@@ -35,11 +41,9 @@ ddClient.desktopUI.toast.error("message");
3541

3642
For more details about method parameters and the return types available, see [Toast API reference](reference/interfaces/Toast.md).
3743

38-
### Deprecated user notifications
39-
40-
!!! warning "Method deprecated"
41-
42-
These methods are deprecated and will be removed in a future version. Use the methods specified above.
44+
> Deprecated user notifications
45+
>
46+
> These methods are deprecated and will be removed in a future version. Use the methods specified above.
4347
4448
```typescript
4549
window.ddClient.toastSuccess("message");
@@ -74,17 +78,13 @@ This function opens an external URL with the system default browser.
7478
ddClient.host.openExternal("https://docker.com");
7579
```
7680

77-
!!! note
78-
79-
The URL must have the protocol `http` or `https`.
81+
> The URL must have the protocol `http` or `https`.
8082
8183
For more details about method parameters and the return types available, see [Desktop host API reference](reference/interfaces/Host.md).
8284

83-
### Deprecated user notifications
84-
85-
!!! warning "Method deprecated"
86-
87-
This method is deprecated and will be removed in a future version. Use the methods specified above.
85+
> Deprecated user notifications
86+
>
87+
> This method is deprecated and will be removed in a future version. Use the methods specified above.
8888
8989
```typescript
9090
window.ddClient.openExternal("https://docker.com");

docs/dev/api/docker.md

+18-16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: Docker extension development API
3+
description: Docker extension API
4+
keywords: Docker, extensions, sdk, API
5+
---
6+
17
## Docker objects
28

39
**listContainers**(`options?`): `Promise`<`unknown`\>
@@ -18,11 +24,9 @@ const images = await ddClient.docker.listImages();
1824

1925
See the [Docker API reference](reference/interfaces/Docker.md) for details about these methods.
2026

21-
### Deprecated access to Docker objects
22-
23-
!!! warning "Method deprecated"
24-
25-
The methods below are deprecated and will be removed in a future version. Use the methods specified above.
27+
> Deprecated access to Docker objects
28+
>
29+
> The methods below are deprecated and will be removed in a future version. Use the methods specified above.
2630
2731
```typescript
2832
const containers = await window.ddClient.listContainers();
@@ -39,7 +43,7 @@ Extensions can also directly execute the `docker` command line.
3943
```typescript
4044
const result = await ddClient.docker.cli.exec("info", [
4145
"--format",
42-
'"{{ json . }}"',
46+
{% raw %}'"{{ json . }}"',{% endraw %}
4347
]);
4448
```
4549

@@ -64,7 +68,7 @@ For convenience, the command result object also has methods to easily parse it:
6468
The command above streams the output as a result of the execution of a docker command.
6569
This is useful if you need to get the output as a stream or the output of the command is too long.
6670

67-
```typescript linenums="1"
71+
```typescript
6872
await ddClient.docker.cli.exec("logs", ["-f", "..."], {
6973
stream: {
7074
onOutput(data) {
@@ -88,7 +92,7 @@ await ddClient.docker.cli.exec("logs", ["-f", "..."], {
8892
The child process created by the extension is killed (`SIGTERM`) automatically when you close the dashboard in Docker Desktop or when you exit the extension UI.
8993
If needed, you can also use the result of the `exec(streamOptions)` call in order to kill (`SIGTERM`) the process.
9094

91-
```typescript linenums="1"
95+
```typescript
9296
const logListener = await ddClient.docker.cli.exec("logs", ["-f", "..."], {
9397
stream: {
9498
// ...
@@ -101,10 +105,10 @@ logListener.close();
101105

102106
This `exec(streamOptions)` API can also be used to listen to docker events:
103107

104-
```typescript linenums="1"
108+
```typescript
105109
await ddClient.docker.cli.exec(
106110
"events",
107-
["--format", "{{ json . }}", "--filter", "container=my-container"],
111+
{% raw %}["--format", "{{ json . }}", "--filter", "container=my-container"],{% endraw %}
108112
{
109113
stream: {
110114
onOutput(data) {
@@ -126,17 +130,15 @@ await ddClient.docker.cli.exec(
126130

127131
See the [Exec API reference](reference/interfaces/Exec.md) for details about these methods.
128132

129-
### Deprecated execution of Docker commands
130-
131-
!!! warning "Method deprecated"
132-
133-
This method is deprecated and will be removed in a future version. Use the one specified just below.
133+
> Deprecated execution of Docker commands
134+
>
135+
> This method is deprecated and will be removed in a future version. Use the one specified just below.
134136
135137
```typescript
136138
const output = await window.ddClient.execDockerCmd(
137139
"info",
138140
"--format",
139-
'"{{ json . }}"'
141+
{% raw %}'"{{ json . }}"'{% endraw %}
140142
);
141143

142144
window.ddClient.spawnDockerCmd("logs", ["-f", "..."], (data, error) => {

docs/dev/api/overview.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
title: Docker extension development overview
3+
description: Docker extension development overview
4+
keywords: Docker, extensions, sdk, development
5+
---
6+
17
# Extension UI API
28

39
The extensions UI runs in a sandboxed environment and doesn't have access to any

0 commit comments

Comments
 (0)