Skip to content

Commit b963591

Browse files
committed
Minor checks, corrections, clean-ups and dead-link fixes.
1 parent 2a431ea commit b963591

File tree

18 files changed

+94
-52
lines changed

18 files changed

+94
-52
lines changed

docs/example-apps/overview.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ for understanding how PyScript works.
1212
## Running the examples
1313

1414
Each example is self-contained with its own `index.html` file. To run
15-
an application locally (we'll use the "Pirate Translator" as an example):
15+
an application locally with Python (we'll use the "Pirate Translator" as
16+
an example):
1617

1718
```sh
1819
# Navigate to the example directory.
@@ -24,6 +25,22 @@ python -m http.server 8000
2425
# Visit http://localhost:8000 in your browser.
2526
```
2627

28+
**Sometimes an example uses web-workers, and these need the server to
29+
respond with special headers.** The
30+
[`mini-coi` command](https://github.com/WebReflection/mini-coi) (which
31+
uses [node.js](https://nodejs.org/en) under the hood) does the right
32+
thing for you:
33+
34+
```sh
35+
# Navigate to the worker-related project.
36+
cd example_apps/prime-worker
37+
38+
# Serve the app with the correct headers.
39+
npx mini-coi .
40+
41+
# Visit http://localhost:8080/ in your browser.
42+
```
43+
2744
All examples use the latest PyScript release referenced in this
2845
version of the docs. Check each example's `index.html` for the reference
2946
to the specific version of PyScript in use.

docs/example-apps/task-board-ffi/info.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ JavaScript API calls.
2222
## Features
2323

2424
This is the exact same application as the
25-
[pyscript.web version](../task-board-web/index.html), but implemented using
25+
[pyscript.web version](../task-board-web/info.md), but implemented using
2626
JavaScript APIs directly. Key differences:
2727

2828
## Files

docs/example-apps/task-board-web/info.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ All DOM manipulation uses `pyscript.web`'s Pythonic interface:
4040

4141
## Compare with FFI version
4242

43-
See the [FFI version](../task-board-ffi/index.html) of this same application to
43+
See the [FFI version](../task-board-ffi/info.md) of this same application to
4444
compare the Pythonic approach with direct JavaScript API calls.

docs/faq.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ This error message indicates a serious problem:
340340
#### When
341341

342342
This error occurs when code on a worker and the main thread are in
343-
[deadlock](https://en.wikipedia.org/wiki/Deadlock). Neither fragment can
344-
proceed without waiting for the other.
343+
[deadlock](https://en.wikipedia.org/wiki/Deadlock_(computer_science)).
344+
Neither fragment can proceed without waiting for the other.
345345

346346
#### Why
347347

@@ -452,8 +452,8 @@ When reporting bugs or asking questions, always mention which PyScript
452452
version you're using. Different versions may behave differently, and
453453
version information helps diagnose problems.
454454

455-
Check the [releases page](https://pyscript.net/releases/) to see
456-
available versions and their release notes.
455+
Check the [releases page](https://github.com/pyscript/pyscript/releases)
456+
to see available versions and their release notes.
457457

458458
### Workers via JavaScript
459459

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
<div><img alt="PyScript Logo" src="assets/images/pyscript.svg"></div>
2+
<img alt="PyScript Logo" src="assets/images/pyscript.svg">
33

44
<h1 style="text-align: center; font-weight: bold;">PyScript is an <u>open source</u> platform for Python in the browser.</h1>
55

@@ -10,13 +10,13 @@
1010
<script type="module" src="https://pyscript.net/releases/2025.11.2/core.js"></script>
1111
```
1212

13-
**Step 2:** Start PyScript with a `<script>` tag:
13+
**Step 2:** Start PyScript with a `<script>` tag in the `<body>` of your HTML document:
1414

1515
```html
1616
<script type="py" config="./conf.json" src="./main.py"></script>
1717
```
1818

19-
**Step 3:** Write Python (use the `pyscript` namespace):
19+
**Step 3:** Write Python and explore the `pyscript` namespace:
2020

2121
```python
2222
from pyscript import when, display

docs/user-guide/architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ minimise network transfer. It works especially well for user interface
154154
code, simple scripting, or applications on mobile devices. The trade-off
155155
is no package installation - you only get the standard library subset
156156
MicroPython provides, or code you directly copy into the PyScript
157-
environment via `files` based configuration.
157+
environment via [`files` based configuration](./configuration.md#files).
158158

159159
### Cross-interpreter compatibility
160160

161161
Both interpreters implement almost the same Foreign Function Interface for
162-
Python-JavaScript interaction. PyScript's unified `pyscript.ffi`
162+
Python-JavaScript interaction. PyScript's unified [`pyscript.ffi`](../api/ffi.md)
163163
namespace works consistently across both interpreters, making it
164164
relatively straightforward to migrate between them.
165165

@@ -170,7 +170,7 @@ in MicroPython. Test thoroughly if you switch interpreters.
170170
## Understanding WebAssembly compilation
171171

172172
Both interpreters use [Emscripten](https://emscripten.org/), a compiler
173-
toolchain built on LLVM, to compile C to WebAssembly. Emscripten
173+
toolchain built on [LLVM](https://llvm.org/), to compile C to WebAssembly. Emscripten
174174
provides more than just compilation - it supplies APIs for operating
175175
system-level features in the browser environment.
176176

docs/user-guide/configuration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ packages = ["arrr", "numberwang" ]
4848
## File or inline
4949

5050
The recommended way to write configuration is via a separate file and then
51-
reference it from the tag used to specify the Python code:
51+
reference it as a URL from the tag used to specify the Python code:
5252

5353
```HTML title="Reference a configuration file."
5454
<script type="py" src="main.py" config="pyscript.json"></script>
5555
```
5656

57+
The name of the file doesn't matter, so long as it's either JSON or TOML.
58+
5759
If you use JSON, you can make it the value of the `config` attribute:
5860

5961
```HTML title="JSON as the value of the config attribute."

docs/user-guide/dom.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ explore each one, starting with the Pythonic `pyscript.web` module.
2222

2323
**New to PyScript?** Start with `pyscript.web`. It's designed to
2424
feel natural if you know Python, and it handles many common tasks
25-
more elegantly than direct JavaScript API calls.
25+
more Pythonically than direct JavaScript API calls.
2626

2727
The FFI becomes useful when you need to integrate specific
2828
JavaScript libraries or when you're already familiar with web
2929
development in JavaScript.
3030

31-
## Quick start: pyscript.web
31+
## Quick start: `pyscript.web`
3232

3333
The `pyscript.web` module provides an idiomatic Python interface to the
3434
DOM. It wraps the FFI in a way that feels natural to Python developers,

docs/user-guide/editor.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,5 +261,8 @@ interface for interactive Python sessions.
261261
differences from traditional PyGame development and techniques for making
262262
games work well in the browser.
263263
264+
**[PyScript in JavaScript](from_javascript.md)** - drive PyScript from the
265+
world JavaScript.
266+
264267
**[Plugins](plugins.md)** - Understand the plugin system, lifecycle hooks,
265268
and how to write plugins that integrate with PyScript.

docs/user-guide/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def handle_inner(event):
198198

199199
## Custom Pythonic events
200200

201-
The `Event` class lets you create custom events within your Python
201+
The `pyscript.Event` class lets you create custom events within your Python
202202
code. This is useful for decoupling parts of your application or
203203
creating your own event-driven architecture.
204204

0 commit comments

Comments
 (0)