Skip to content

Commit e848c2a

Browse files
committed
fix: Migrate to code-groups
1 parent 73a1033 commit e848c2a

File tree

4 files changed

+20
-28
lines changed

4 files changed

+20
-28
lines changed

packages/documentation/docs/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ This allows you to rely on UI5 CLI for UI5-specific build functionality and proj
117117

118118
All available APIs are documented in the [UI5 CLI API Reference](https://ui5.github.io/cli/v5/api/index.html).
119119

120-
#### ESM
121-
122-
```js
120+
::: code-group
121+
```js [ESM]
123122
import {graphFromPackageDependencies} from "@ui5/project/graph";
124123

125124
async function buildApp(projectPath, destinationPath) {
@@ -135,9 +134,7 @@ async function buildApp(projectPath, destinationPath) {
135134
}
136135
```
137136

138-
#### CommonJS
139-
140-
```js
137+
```js [CommonJS]
141138
async function buildApp(projectPath, destinationPath) {
142139
const {graphFromPackageDependencies} =
143140
await import("@ui5/project/graph");
@@ -152,3 +149,4 @@ async function buildApp(projectPath, destinationPath) {
152149
});
153150
}
154151
```
152+
:::

packages/documentation/docs/pages/GettingStarted.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,13 @@ If your project is not set up for use with the UI5 CLI yet, follow these steps:
5050
```
5151

5252
1. Define the framework you want to use
53-
::: info
54-
**OpenUI5**
53+
:::code-group
5554

56-
```sh
55+
```sh [OpenUI5]
5756
ui5 use openui5@latest
5857
```
5958

60-
**SAPUI5**
61-
62-
```sh
59+
```sh [SAPUI5]
6360
ui5 use sapui5@latest
6461
```
6562
:::

packages/documentation/docs/pages/extensibility/CustomServerMiddleware.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ middleware:
8989

9090
A custom middleware implementation needs to return a function with the following signature:
9191

92-
#### ESM
92+
:::code-group
9393

94-
```js
94+
```js [ESM]
9595
/**
9696
* Custom UI5 Server middleware API
9797
*
@@ -127,9 +127,7 @@ export default function({log, middlewareUtil, options, resources}) {
127127
};
128128
```
129129

130-
#### CommonJS
131-
132-
```js
130+
```js [CommonJS]
133131
/**
134132
* Custom UI5 Server middleware API
135133
*
@@ -164,12 +162,13 @@ module.exports = function({log, middlewareUtil, options, resources}) {
164162
}
165163
};
166164
```
165+
:::
167166

168167
### Example: lib/middleware/markdownHandler.(m)js
169168

170-
#### ESM
169+
:::code-group
171170

172-
```js
171+
```js [ESM]
173172
import MarkdownIt from "markdown-it";
174173
175174
export default async function({log, middlewareUtil, options, resources}) {
@@ -201,9 +200,7 @@ export default async function({log, middlewareUtil, options, resources}) {
201200
```
202201
Live demo of the above example: [openui5-sample-app with custom middleware](https://github.com/SAP/openui5-sample-app/tree/demo-server-middleware-extensibility-v3-esm)
203202

204-
#### CommonJS
205-
206-
```js
203+
```js [CommonJS]
207204
module.exports = async function({log, middlewareUtil, options, resources}) {
208205
const MarkdownIt = require("markdown-it");
209206
const md = new MarkdownIt();
@@ -234,6 +231,8 @@ module.exports = async function({log, middlewareUtil, options, resources}) {
234231
```
235232
Live demo of the above example: [openui5-sample-app with custom middleware](https://github.com/SAP/openui5-sample-app/tree/demo-server-middleware-extensibility-v3)
236233

234+
:::
235+
237236
## Helper Class `MiddlewareUtil`
238237

239238
Custom middleware defining [Specification Version](../Configuration.md#specification-versions) 2.0 or higher have access to an interface of a [MiddlewareUtil](https://ui5.github.io/cli/v5/api/@ui5_server_middleware_MiddlewareUtil.html) instance.

packages/documentation/docs/pages/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ This allows you to rely on UI5 CLI for UI5-specific build functionality and proj
117117

118118
All available APIs are documented in the [UI5 CLI API Reference](https://ui5.github.io/cli/v5/api/index.html).
119119

120-
#### ESM
121-
122-
```js
120+
::: code-group
121+
```js [ESM]
123122
import {graphFromPackageDependencies} from "@ui5/project/graph";
124123

125124
async function buildApp(projectPath, destinationPath) {
@@ -135,9 +134,7 @@ async function buildApp(projectPath, destinationPath) {
135134
}
136135
```
137136

138-
#### CommonJS
139-
140-
```js
137+
```js [CommonJS]
141138
async function buildApp(projectPath, destinationPath) {
142139
const {graphFromPackageDependencies} =
143140
await import("@ui5/project/graph");
@@ -152,3 +149,4 @@ async function buildApp(projectPath, destinationPath) {
152149
});
153150
}
154151
```
152+
:::

0 commit comments

Comments
 (0)