8000 Add syntax highlighting (#903) · lowgrind/pyscript@4c635fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c635fe

Browse files
authored
Add syntax highlighting (pyscript#903)
1 parent 68e4634 commit 4c635fe

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/reference/elements/py-config.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ Note: `[[runtimes]]` is a TOML table. Make sure this is the last item within a p
4141
```
4242

4343
- Use of the `src` attribute:
44-
```
44+
```html
4545
<py-config src="./custom.toml"></py-config>
4646
```
4747
where `custom.toml` contains
4848

49-
```
49+
```toml
5050
autoclose_loader = true
5151
[[runtimes]]
5252
src = "https://cdn.jsdelivr.net/pyodide/v0.21.2/full/pyodide.js"
@@ -55,12 +55,12 @@ lang = "python"
5555
```
5656

5757
- JSON using the `type` attribute.
58-
```
58+
```html
5959
<py-config type="json" src="./custom.json"></py-config>
6060
```
6161
where `custom.json` contains
6262

63-
```
63+
```json
6464
{
6565
"autoclose_loader": true,
6666
"runtimes": [{
@@ -73,15 +73,15 @@ where `custom.json` contains
7373

7474
One can also use both i.e pass the config from `src` attribute as well as specify it as `inline`. So the following snippet is also valid:
7575

76-
```
76+
```html
7777
<py-config src="./custom.toml">
7878
paths = ["./utils.py"]
7979
</py-config>
8080
```
8181

8282
This can also be done via JSON using the `type` attribute.
8383

84-
```
84+
```html
8585
<py-config type="json" src="./custom.json">
8686
{
8787
"paths": ["./utils.py"]
@@ -104,15 +104,15 @@ Package dependencies in the `<py-config>` can be declared by using the direct li
104104

105105
NOTICE that only pure python packages from PyPI will work and packages with C dependencies will not. These need to be built specifically for WASM (please, consult the Pyodide project for more information about what's supported and on how to build packages with C dependencies)
106106

107-
```
107+
```html
108108
<py-config>
109109
packages = ["./static/wheels/travertino-0.1.3-py3-none-any.whl"]
110110
</py-config>
111111
```
112112

113113
OR in JSON like
114114

115-
```
115+
```html
116116
<py-config type="json">
117117
{
118118
"packages": ["./static/wheels/travertino-0.1.3-py3-none-any.whl"]
@@ -227,15 +227,15 @@ Besides the above schema, a user can also supply any extra keys and values that
227227

228228
For example, a valid config could also be with the snippet below:
229229

230-
```
230+
```html
231231
<py-config type="toml">
232232
magic = "unicorn"
233233
</py-config>
234234
```
235235

236236
OR in JSON like
237237

238-
```
238+
```html
239239
<py-config type="json">
240240
{
241241
"magic": "unicorn"

0 commit comments

Comments
 (0)
0