You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/syntax/code.md
+48-4Lines changed: 48 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -267,10 +267,6 @@ project:
267
267
268
268
### Console code blocks
269
269
270
-
:::{note}
271
-
This feature is still being developed.
272
-
:::
273
-
274
270
We document a lot of API endpoints at Elastic. For these endpoints, we support `console` as a language. The term console relates to the dev console in kibana which users can link to directly from these code snippets.
275
271
276
272
In a console code block, the first line is highlighted as a dev console string and the remainder as json:
@@ -309,6 +305,54 @@ GET /mydocuments/_search
309
305
310
306
::::
311
307
308
+
Console code blocks now support multiple API calls within a single code block. When you have multiple console commands, they are displayed as separate sections within the same block with proper visual separation:
309
+
310
+
::::{tab-set}
311
+
312
+
:::{tab-item} Output
313
+
314
+
```console
315
+
GET /mydocuments/_search
316
+
{
317
+
"from": 1,
318
+
"query": {
319
+
"match_all" {}
320
+
}
321
+
}
322
+
323
+
POST /mydocuments/_doc
324
+
{
325
+
"title": "New Document",
326
+
"content": "This is a sample document"
327
+
}
328
+
```
329
+
330
+
:::
331
+
332
+
:::{tab-item} Markdown
333
+
334
+
````markdown
335
+
```console
336
+
GET /mydocuments/_search
337
+
{
338
+
"from": 1,
339
+
"query": {
340
+
"match_all" {}
341
+
}
342
+
}
343
+
344
+
POST /mydocuments/_doc
345
+
{
346
+
"title": "New Document",
347
+
"content": "This is a sample document"
348
+
}
349
+
```
350
+
````
351
+
352
+
:::
353
+
354
+
::::
355
+
312
356
### Code block substitutions
313
357
314
358
You can use substitutions to insert reusable values into your code block examples.
0 commit comments