Skip to content

Commit 7fae099

Browse files
committed
update readme
1 parent c3d1bf0 commit 7fae099

5 files changed

Lines changed: 38 additions & 52 deletions

File tree

.github/workflows/gh-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
cache: true
2525

2626
- name: Build Pages
27-
run: deno task generate
27+
run: deno task build
2828

2929
- name: Add LiveCodes
3030
run: |

README.md

Lines changed: 35 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,54 @@
1-
# VersaTiles Playground
1+
# VersaTiles Playground
22

3-
A playground to show how to use [VersaTiles](https://versatiles.org) in a web frontend.
3+
A web-based playground demonstrating how to use [VersaTiles](https://versatiles.org) in a frontend environment.
44

5-
Every example is built with the free **[LiveCodes](https://github.com/live-codes/livecodes)** editor and automatically deployed to GitHub Pages:
5+
This project uses the free [LiveCodes](https://github.com/live-codes/livecodes) editor and is automatically deployed via GitHub Pages:
6+
👉 https://versatiles.org/playground/
67

7-
> **Live demo:** https://versatiles.org/playground/
8+
89

9-
---
10-
11-
## Repository Structure
10+
## 📁 Repository Structure
1211

1312
```text
14-
/
15-
├── .github/workflows/ # CI pipeline that builds & deploys the playground
16-
├── examples/ # JSON exports of individual LiveCodes examples
17-
└── index.html # Landing page listing all examples
13+
├─ .github/workflows/ # CI pipeline for building & deploying the playground
14+
├─ docs/ # Output directory for the generated website
15+
├─ playground/ # Source examples for the playground
16+
│ ├─ toc.ts # Table of contents listing all available examples
17+
│ └─ $name/ # Individual example directory (replace $name with actual example name)
18+
│ ├─ code.html # LiveCodes HTML snippet
19+
│ └─ text.md # Markdown explanation for the example
20+
└─ src/ # Source code for the generator and dev server
21+
├─ generate.ts # Script to build all example pages
22+
├─ dev.ts # Development server
23+
├─ lib/ # Shared utility code
24+
└─ templates/ # Embedded JS templates (ETA format)
25+
├─ index.eta # Template for the index page
26+
└─ page.eta # Template for individual example pages
1827
```
1928

20-
---
21-
22-
## 🚀 Add a New Example
23-
24-
> Below, replace `<NAME>` with a short kebab‑case identifier for your example.
25-
26-
1. **Open LiveCodes** at https://versatiles.org/playground/livecodes and create your example.
27-
Need help? Check the [LiveCodes docs](https://livecodes.io/docs/features/).
28-
2. **Export the project** via `Menu → Project → Export → Export Project (JSON)` and save it as `examples/<NAME>.json` in this repo.
29-
3. **Link it** in `index.html` by adding a line like:
29+
3030

31-
```html
32-
<ul>
33-
34-
<li><a href="examples/<NAME>">Short description of your example</a></li>
35-
</ul>
36-
```
31+
## 🚀 Usage
3732

38-
4. **Commit & push** (or open a PR). The GitHub Actions workflow will build and deploy the updated playground.
39-
Once the workflow succeeds, your example will be listed at:
40-
`https://versatiles.org/playground/`.
33+
### Build the Playground
4134

42-
---
35+
To generate all web pages from the examples:
4336

44-
## 🔄 Update an Existing Example
45-
46-
1. Open an example in LiveCodes.
47-
2. Make your changes.
48-
3. Re‑export the project (JSON) and overwrite `examples/<NAME>.json`.
49-
4. Commit & push. The site will redeploy automatically.
50-
51-
---
37+
```bash
38+
deno task build
39+
```
5240

53-
## ⚙️ How it works
41+
### Run in Development Mode
5442

55-
- **LiveCodes** is a 100 % client‑side playground. It can open a project JSON provided via the `?config=` query parameter.
56-
- Our **GitHub Actions** workflow builda a new page on every push to `main` and adds:
43+
To start a local development server:
5744

58-
1. LiveCodes.
59-
2. all `examples/*.json`
60-
3. `index.html`.
45+
```bash
46+
deno task dev
47+
```
6148

62-
- Because everything happens in the browser, **no backend** is required.
6349

64-
---
50+
6551

66-
## 📄 License
52+
## 📄 License
6753

68-
[MIT](LICENSE)
54+
This project is licensed under the [MIT License](./LICENSE).

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"license": "MIT",
99
"tasks": {
1010
"check": "deno check && deno lint && deno fmt",
11-
"generate": "deno run --allow-all src/generate.ts",
11+
"build": "deno run --allow-all src/build.ts",
1212
"dev": "deno run --watch='src,playground' --watch-exclude='**/.DS_Store' --allow-all src/dev.ts"
1313
},
1414
"imports": {
File renamed without changes.

src/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { serveDir } from '@std/http/file-server';
22

3-
import './generate.ts';
3+
import './build.ts';
44

55
const fsRoot = (new URL('../docs', import.meta.url)).pathname;
66

0 commit comments

Comments
 (0)