Skip to content

Commit ed22777

Browse files
committed
chore(demo): updates docs around local and vendored switching
1 parent 65492b4 commit ed22777

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

docs/README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ The demo shows how the library transforms common Python error traces (from both
1717
- **KeyError**: Dictionary key not found
1818
- **ZeroDivisionError**: Division by zero
1919

20-
Each example shows:
21-
1. The original Python traceback
22-
2. The code that caused the error
23-
3. The friendly explanation generated by the library
20+
The demo renders a full-width table with:
21+
1. A linkable row id for each example (URL hash)
22+
2. The example title and runtime
23+
3. The original code and traceback
24+
4. The friendly explanation generated by the library
2425

2526
### Usage
2627

@@ -43,9 +44,16 @@ Then in the root directory of the project:
4344

4445
2. Navigate to `http://localhost:8000/docs`
4546

46-
## Local demo
47+
### Local source switching (development only)
4748

48-
The `local-demo.html` file in this directory is a copy of the hosted demo that can be run locally, ie. against the local build of the library. Useful for development and testing.
49+
When running locally, the demo shows a source switch bar at the top:
50+
51+
- default: vendored build (`docs/vendor/...`)
52+
- local mode: local build (`dist/index.browser.js`) via `?local=true`
53+
54+
Local mode can be used to test changes to the library on-the-fly, as long as you have a local build running (eg. via `npm run dev:build`).
55+
56+
On hosted environments (including GitHub Pages), the source switch UI is hidden and the demo always uses the vendored build.
4957

5058
### Usage
5159

@@ -63,5 +71,7 @@ The `local-demo.html` file in this directory is a copy of the hosted demo that c
6371
npx http-server -p 8000
6472
```
6573

66-
3. Navigate to `http://localhost:8000/docs/local-demo.html`
74+
3. Navigate to one of:
75+
- `http://localhost:8000/docs` (vendored build)
76+
- `http://localhost:8000/docs?local=true` (local `dist/` build)
6777

0 commit comments

Comments
 (0)