Skip to content

Commit 795e841

Browse files
e-commerce sample
1 parent a842e43 commit 795e841

23 files changed

+1371
-18
lines changed

built-in-ai/README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1-
# Built-in AI Playground
1+
# Built-in AI playgrounds
22

3-
➡️ **[Open the playground](https://microsoftedge.github.io/Demos/built-in-ai/)** ⬅️
3+
➡️ **[Open the playgrounds](https://microsoftedge.github.io/Demos/built-in-ai/)** ⬅️
44

5-
The files in this directory are playgrounds for the built-in AI APIs in Microsoft Edge.
5+
The files in this directory are playgrounds and samples for the built-in AI APIs in Microsoft Edge.
66

77
To learn more, see [Prompt a built-in language model with the Prompt API](https://learn.microsoft.com/microsoft-edge/web-platform/prompt-api) and [Summarize, write, and rewrite text with the Writing Assistance APIs](https://learn.microsoft.com/microsoft-edge/web-platform/writing-assistance-apis).
88

99
## Contributing
1010

11-
To make changes to the playground source code, clone this repository and follow these steps:
11+
To make changes to the playgrounds and samples source code, clone this repository and follow these steps:
1212

13-
* To make changes to the source HTML content for one of the playgrounds:
13+
* To make changes to the source HTML content for one of the playgrounds or samples:
1414

1515
This project uses Eleventy to generate the static HTML files. This is useful to avoid having to write the same HTML boilerplate for each playground.
1616

17-
1. Find the playground you want to edit in the `templates` directory.
17+
1. Find the playground or sample you want to edit in the `templates` directory.
18+
19+
Playgrounds start with the `playground-` prefix, and samples start with the `sample-` prefix.
20+
1821
1. Make your changes to the HTML file.
19-
1. Run `npm run build` to regenerate the static HTML files in the `playgrounds` directory.
2022

21-
* To make changes to the JavaScript or CSS code for the playgrounds:
23+
1. Run `npm run build` to regenerate the static HTML files in the `playgrounds` and `samples` directories.
24+
25+
* To make changes to the JavaScript or CSS code for the playgrounds or samples:
2226

2327
Make your changes directly to the JavaScript or CSS files in the `static` directory.
2428

25-
To run the playground locally, run `npm run build` to generate the static site, and then run a local server from the Demos repository's parent directory, and then navigate to `http://localhost:8080/Demos/built-in-ai/` in your browser.
29+
To run the playgrounds locally:
30+
31+
1. Run `npm run build` to generate the static site.
32+
1. Run `cd ../../` to go to the Demos repository's parent directory.
33+
1. Start a local HTTP server from that parent directory. For example: `npx http-server -p 8080`.
34+
1. Navigate to `http://localhost:8080/Demos/built-in-ai/` in your browser.

built-in-ai/eleventy.config.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

built-in-ai/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"@11ty/eleventy": "^3.0.0"
77
},
88
"scripts": {
9-
"build": "npx @11ty/eleventy"
9+
"build": "npm run build:playgrounds && npm run build:samples",
10+
"build:playgrounds": " npx @11ty/eleventy --input=templates/playground-* --output=playgrounds",
11+
"build:samples": " npx @11ty/eleventy --input=templates/sample-* --output=samples"
1012
}
1113
}

built-in-ai/playgrounds/prompt-api/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
4545
</li>
4646
</ul>
4747
</li>
48+
<li>
49+
<span class="item parent">
50+
Samples
51+
</span>
52+
<ul class="menu">
53+
<li>
54+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
55+
</li>
56+
</ul>
57+
</li>
4858
</ul>
4959
</nav>
5060

@@ -72,6 +82,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
7282
</li>
7383
</ul>
7484
</li>
85+
<li>
86+
<span class="item parent">
87+
Samples
88+
</span>
89+
<ul class="menu">
90+
<li>
91+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
92+
</li>
93+
</ul>
94+
</li>
7595
</ul>
7696
</nav>
7797

built-in-ai/playgrounds/rewriter-api/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
4545
</li>
4646
</ul>
4747
</li>
48+
<li>
49+
<span class="item parent">
50+
Samples
51+
</span>
52+
<ul class="menu">
53+
<li>
54+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
55+
</li>
56+
</ul>
57+
</li>
4858
</ul>
4959
</nav>
5060

@@ -72,6 +82,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
7282
</li>
7383
</ul>
7484
</li>
85+
<li>
86+
<span class="item parent">
87+
Samples
88+
</span>
89+
<ul class="menu">
90+
<li>
91+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
92+
</li>
93+
</ul>
94+
</li>
7595
</ul>
7696
</nav>
7797

built-in-ai/playgrounds/summarizer-api/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
4545
</li>
4646
</ul>
4747
</li>
48+
<li>
49+
<span class="item parent">
50+
Samples
51+
</span>
52+
<ul class="menu">
53+
<li>
54+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
55+
</li>
56+
</ul>
57+
</li>
4858
</ul>
4959
</nav>
5060

@@ -72,6 +82,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
7282
</li>
7383
</ul>
7484
</li>
85+
<li>
86+
<span class="item parent">
87+
Samples
88+
</span>
89+
<ul class="menu">
90+
<li>
91+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
92+
</li>
93+
</ul>
94+
</li>
7595
</ul>
7696
</nav>
7797

built-in-ai/playgrounds/writer-api/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
4545
</li>
4646
</ul>
4747
</li>
48+
<li>
49+
<span class="item parent">
50+
Samples
51+
</span>
52+
<ul class="menu">
53+
<li>
54+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
55+
</li>
56+
</ul>
57+
</li>
4858
</ul>
4959
</nav>
5060

@@ -72,6 +82,16 @@ <h2 class="app-title">Built-in AI Playground</h2>
7282
</li>
7383
</ul>
7484
</li>
85+
<li>
86+
<span class="item parent">
87+
Samples
88+
</span>
89+
<ul class="menu">
90+
<li>
91+
<a href="/Demos/built-in-ai/samples/e-commerce" class="item">E-commerce</a>
92+
</li>
93+
</ul>
94+
</li>
7595
</ul>
7696
</nav>
7797

0 commit comments

Comments
 (0)