pyrepl-web 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -12
- package/dist/pyrepl.js +341 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
# pyrepl-web
|
|
2
2
|
|
|
3
|
-
An embeddable Python REPL powered by Pyodide.
|
|
3
|
+
An embeddable Python REPL, powered by Pyodide.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
- Full Python 3.13 running in the browser via WebAssembly
|
|
8
|
-
- Syntax highlighting with Pygments
|
|
9
|
-
- Tab completion
|
|
10
|
-
- Command history (up/down arrows)
|
|
11
|
-
- Smart indentation
|
|
12
|
-
- Preload any PyPI packages
|
|
13
|
-
- Multiple color themes (Catppuccin Mocha/Latte)
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
5
|
+
## Getting started
|
|
16
6
|
|
|
17
7
|
Add a `.pyrepl` div and include the script from a CDN:
|
|
18
8
|
|
|
@@ -45,6 +35,16 @@ Configure via `data-*` attributes:
|
|
|
45
35
|
</div>
|
|
46
36
|
```
|
|
47
37
|
|
|
38
|
+
Supports...
|
|
39
|
+
|
|
40
|
+
- Full Python 3.13 running in the browser via WebAssembly
|
|
41
|
+
- Syntax highlighting with Pygments
|
|
42
|
+
- Tab completion
|
|
43
|
+
- Command history (up/down arrows)
|
|
44
|
+
- Smart indentation
|
|
45
|
+
- Preload any PyPI packages
|
|
46
|
+
- Multiple color themes (Catppuccin Mocha/Latte)
|
|
47
|
+
|
|
48
48
|
### Attributes
|
|
49
49
|
|
|
50
50
|
| Attribute | Description | Default |
|
|
@@ -52,6 +52,23 @@ Configure via `data-*` attributes:
|
|
|
52
52
|
| `data-theme` | Color theme (`catppuccin-mocha` or `catppuccin-latte`) | `catppuccin-mocha` |
|
|
53
53
|
| `data-packages` | Comma-separated list of PyPI packages to preload | none |
|
|
54
54
|
|
|
55
|
+
### Hugo Shortcode
|
|
56
|
+
|
|
57
|
+
Create `layouts/shortcodes/pyrepl.html`:
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<script src="https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js"></script>
|
|
61
|
+
<div class="pyrepl" {{ with .Get "theme" }}data-theme="{{ . }}"{{ end }} {{ with .Get "packages" }}data-packages="{{ . }}"{{ end }}></div>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then use it in any markdown file:
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
{{</* pyrepl */>}}
|
|
68
|
+
{{</* pyrepl theme="catppuccin-latte" */>}}
|
|
69
|
+
{{</* pyrepl packages="numpy, pandas" */>}}
|
|
70
|
+
```
|
|
71
|
+
|
|
55
72
|
## Development
|
|
56
73
|
|
|
57
74
|
```bash
|