8000 Change the metadata format (#457) · techwithanirudh/pyscript@4b4ff08 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4b4ff08

Browse files
woxtufpliger
andauthored
Change the metadata format (pyscript#457)
* Chnage the metadata format * Add syntax highlighting * have simple_clock example run from local build to test change Co-authored-by: Fabio Pliger <fabio.pliger@gmail.com>
1 parent 698478e commit 4b4ff08

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

docs/tutorials/getting-started.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,26 +217,26 @@ Use the `<py-config>` tag to set and configure general metadata about your PyScr
217217

218218
The `<py-config>` tag can be used as follows:
219219

220-
```
220+
```html
221221
<py-config>
222-
- autoclose_loader: false
223-
- runtimes:
224-
-
225-
src: "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js"
222+
autoclose_loader: false
223+
runtimes:
224+
- src: "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js"
226225
name: pyodide-0.20
227226
lang: python
228227
</py-config>
229228
```
230229

231230
The following optional values are supported by `<py-config>`:
232231

233-
* autoclose_loader (boolean): If false, PyScript will not close the loading splash screen when the startup operations finish.
234-
* name (string): Name of the user application. This field can be any string and is to be used by the application author for their own customization purposes.
235-
* version (string): Version of the user application. This field can be any string and is to be used by the application author for their own customization purposes. It is not related to the PyScript version.
236-
* runtimes (List of Runtimes): List of runtime configurations. Each Runtime expects the following fields:
237-
* src (string, Required): URL to the runtime source.
238-
* name (string): Name of the runtime. This field can be any string and is to be used by the application author for their own customization purposes.
239-
* lang (string): Programming language supported by the runtime. This field can be used by the application author to provide clarification. It currently has no implications on how PyScript behaves.
232+
* `autoclose_loader` (boolean): If false, PyScript will not close the loading splash screen when the startup operations finish.
233+
* `name` (string): Name of the user application. This field can be any string and is to be used by the application author for their own customization purposes.
234+
* `version` (string): Version of the user application. This field can be any string and is to be used by the application author for their own customization purposes. It is not related to the PyScript version.
235+
* `runtimes` (List of Runtimes): List of runtime configurations. Each Runtime expects the following fields:
236+
* `src` (string, Required): URL to the runtime source.
237+
* `name` (string): Name of the runtime. This field can be any string and is to be used by the application author for their own customization purposes.
238+
* `lang` (string): Programming language supported by the runtime. This field can be used by the application author to provide clarification. It currently has no implications on how PyScript behaves.
239+
240240

241241
## Visual component tags
242242

examples/simple_clock.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@
77
<title>Simple Clock Demo</title>
88

99
<link rel="icon" type="image/png" href="favicon.png" />
10-
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
10+
<link rel="stylesheet" href="./build/pyscript.css" />
1111

12-
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
12+
<script defer src="./build/pyscript.js"></script>
1313
<py-env>
1414
- paths:
1515
- ./utils.py
1616
</py-env>
1717
<py-config>
18-
- autoclose_loader: false
19-
- runtimes:
20-
-
21-
src: "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js"
18+
autoclose_loader: false
19+
runtimes:
20+
- src: "https://cdn.jsdelivr.net/pyodide/v0.20.0/full/pyodide.js"
2221
name: pyodide-0.20
2322
lang: python
2423
</py-config>

pyscriptjs/src/components/pyconfig.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ export class PyConfig extends BaseEvalElement {
159159
autoclose_loader: true,
160160
};
161161
} else {
162-
this.values = Object.assign({}, ...loadedValues);
162+
// eslint-disable-next-line
163+
// @ts-ignore
164+
this.values = loadedValues;
163165
}
164166
if (this.values.runtimes === undefined) {
165167
this.values.runtimes = [DEFAULT_RUNTIME];

0 commit comments

Comments
 (0)
0