Skip to content

Commit 32dd74b

Browse files
authored
Merge pull request #49 from AdobeDocs/baskar-code
update : code playground & column
2 parents 6cabb6a + 599d788 commit 32dd74b

6 files changed

Lines changed: 112 additions & 10 deletions

File tree

src/pages/blocks/code/code-with-try-playground.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,54 @@ Create interactive code examples with a "Try" button that allows users to execut
1111

1212
Use the following data attributes after the language identifier:
1313

14-
````
15-
```javascript-data-playground-session-id="sessionName"-data-playground-mode="playground"-data-playground-session="new"-data-playground-execution-mode="script"-data-playground-url="https://example.com"
14+
```
15+
---
16+
javascript-data-playground-session-id="sessionName"-data-playground-mode="playground"-data-playground-session="new"-data-playground-execution-mode="script"-data-playground-url="https://example.com"
1617
// your code here
18+
---
1719
```
18-
````
1920

2021
## Parameters
2122

2223
- **data-playground-session-id**: Unique identifier for the playground session (e.g., `"createAndFillRectangle"`)
2324
- **data-playground-mode**: Mode of the playground (typically `"playground"`)
2425
- **data-playground-session**: Session state, usually `"new"` to create a fresh session
2526
- **data-playground-execution-mode**: Execution mode, typically `"script"` for script execution
26-
- **data-playground-url**: URL of the playground environment where code will be executed
27+
- **data-playground-url**: Prod URL of the playground environment where code will be executed
28+
- **data-playground-url-stage**: Stage URL of the playground environment where code will be executed
29+
30+
<InlineAlert slots="header, text1, text2, text3, text4"/>
31+
32+
**Note**
33+
34+
You can use two types of playground URLs. If you want to use a common playground for all code playground blocks, you can configure it globally by defining it in the `adp-site-metadata.json`.
35+
36+
First, create a `code-playground.json` file as shown below:
37+
38+
```json
39+
{
40+
"total": 2,
41+
"offset": 0,
42+
"limit": 2,
43+
"data": [
44+
{
45+
"key": "code-playground-staging-url",
46+
"value": "https://stage.projectx.corp.adobe.com/"
47+
},
48+
{
49+
"key": "code-playground-production-url",
50+
"value": "https://projectx.corp.adobe.com/"
51+
}
52+
],
53+
":type": "sheet"
54+
}
55+
```
56+
57+
If you need different playground URLs, you can use the attributes **data-playground-url and data-playground-url-stage**.
2758

28-
## Example
59+
## Example for attribute
2960

30-
```js-data-playground-session-id="createAndFillRectangle"-data-playground-mode="playground"-data-playground-session="new"-data-playground-execution-mode="script"-data-playground-url="https://stage.projectx.corp.adobe.com/new"
61+
```js-data-playground-session-id="createAndFillRectangle"-data-playground-mode="playground"-data-playground-session="new"-data-playground-execution-mode="script"-data-playground-url="https://example.com/new"
3162
const insertionParent = editor.context.insertionParent; // get node to insert content into
3263
3364
const rectangle = editor.createRectangle();
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Columns with Reversed Image / Video Layout
3+
description: Learn how to use the Columns block with the `isReversed` attribute to switch the order of image and text.
4+
---
5+
6+
# Columns with Image / Video (Reversed)
7+
8+
## Syntax
9+
10+
```markdown
11+
<Columns slots="image, heading, text, buttons" repeat="3" isReversed="true" />
12+
13+
![Feature 1](../../assets/column.jpg)
14+
15+
### Feature One
16+
17+
Description of the first feature.
18+
19+
[Learn more](https://example.com)
20+
21+
![Feature 2](../../assets/column2.jpg)
22+
23+
### Feature Two
24+
25+
Description of the second feature.
26+
27+
[Learn more](https://example.com)
28+
29+
![Feature 3](../../assets/column3.jpg)
30+
31+
### Feature Three
32+
33+
Description of the third feature.
34+
35+
[Learn more](https://example.com)
36+
```
37+
38+
## Example
39+
40+
<Columns slots="image, heading, text, buttons" repeat="3" isReversed="true" />
41+
42+
![Feature 1](../../assets/column.jpg)
43+
44+
### Feature One
45+
46+
Description of the first feature.
47+
48+
[Learn more](https://example.com)
49+
50+
![Feature 2](../../assets/column2.jpg)
51+
52+
### Feature Two
53+
54+
Description of the second feature.
55+
56+
[Learn more](https://example.com)
57+
58+
![Feature 3](../../assets/column3.jpg)
59+
60+
### Feature Three
61+
62+
Description of the third feature.
63+
64+
[Learn more](https://example.com)

src/pages/blocks/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ Multiple code block with headings.
8787

8888
Multi-column layouts.
8989
- [With Image](columns/columns-with-image.md)
90-
- [With Video](columns/columns-with-video.md)
90+
- [With Video](columns/columns-with-video.md)
91+
- [With Reverse](columns/columns-with-reverse.md)
9192

9293
### [Details](details/index.md)
9394

src/pages/blocks/site-metadata/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ If the file does not exist, components fall back to looking up each configuratio
1313

1414
```json
1515
{
16-
"total": 3,
16+
"total": 4,
1717
"offset": 0,
18-
"limit": 3,
18+
"limit": 4,
1919
"data": [
2020
{
2121
"key": "contributors",
@@ -28,6 +28,10 @@ If the file does not exist, components fall back to looking up each configuratio
2828
{
2929
"key": "site-wide-banner",
3030
"value": "src/pages/site-wide-banner.json"
31+
},
32+
{
33+
"key": "code-playground",
34+
"value": "src/pages/code-playground.json"
3135
}
3236
],
3337
":type": "sheet"
@@ -41,6 +45,7 @@ If the file does not exist, components fall back to looking up each configuratio
4145
| `contributors` | Path to the contributors JSON file |
4246
| `get-credentials` | Path to the credential configuration JSON file |
4347
| `site-wide-banner` | Path to the site-wide banner JSON file |
48+
| `code-playground` | Path to the code playground JSON file |
4449

4550
## How It Is Generated
4651

src/pages/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
- [Columns](/blocks/columns/index.md)
5757
- [Columns with Image](/blocks/columns/columns-with-image.md)
5858
- [Columns with Video](/blocks/columns/columns-with-video.md)
59+
- [Columns with Reverse](/blocks/columns/columns-with-reverse.md)
5960
- [Details](/blocks/details/index.md)
6061
- [Discover Block](/blocks/discoverblock/index.md)
6162
- [Edition](/blocks/edition/index.md)

src/pages/contributors.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)