@neuromatch/course-kit 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 +92 -0
- package/dist/build-info.json +1 -1
- package/dist/nma.mjs +2 -2
- package/dist/nma.yml +2 -2
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @neuromatch/course-kit
|
|
2
|
+
|
|
3
|
+
The [MyST](https://mystmd.org) plugin for Neuromatch courses: one bundled
|
|
4
|
+
file plus the browser assets it uses. It is one half of the
|
|
5
|
+
[Neuromatch course kit](https://github.com/neuromatch/course-kit); the other
|
|
6
|
+
half is the [`nma-kit`](https://pypi.org/project/neuromatch-course-kit/)
|
|
7
|
+
command line, which checks content and generates notebooks. Both ship under
|
|
8
|
+
the same version.
|
|
9
|
+
|
|
10
|
+
You normally don't install this package. A course's `myst.yml` loads it from
|
|
11
|
+
jsDelivr:
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
version: 1
|
|
15
|
+
extend: https://cdn.jsdelivr.net/npm/@neuromatch/course-kit@0.1/dist/nma.yml
|
|
16
|
+
project:
|
|
17
|
+
github: https://github.com/<org>/<course>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`dist/nma.yml` adds the plugin and turns on `project.jupyter.lite`. In CI,
|
|
21
|
+
`nma-kit prepare-site` rewrites `@0.1` to the exact version of the CLI, so the
|
|
22
|
+
plugin, its assets and the CLI always match. See the
|
|
23
|
+
[kit README](https://github.com/neuromatch/course-kit#using-the-kit-in-a-course)
|
|
24
|
+
for the full course setup.
|
|
25
|
+
|
|
26
|
+
## What it adds to MyST
|
|
27
|
+
|
|
28
|
+
| Directive / feature | What it does on the site |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `{nma-video}`, `{nma-slides}` | Embedded YouTube, Bilibili or OSF videos and slide decks |
|
|
31
|
+
| `{nma-solution}`, `{nma-explanation}` | A "Click for solution" link; the solution text itself is never on the page |
|
|
32
|
+
| `{nma-feedback}` | A feedback widget that posts to datatops from the browser |
|
|
33
|
+
| `layout: scrolly`, `{step}`, `{stage}` | Scrollytelling pages with live Python (Pyodide) |
|
|
34
|
+
| Editable cells | Code cells become editable and runnable in the browser on pages with a `kernelspec`; `runtime: colab` pages get a Colab banner instead |
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
:::{nma-video} Video 1: Linear dynamical systems
|
|
40
|
+
:youtube: vPYQPI4nKT8
|
|
41
|
+
:bilibili: BV1up4y1S7wj
|
|
42
|
+
:::
|
|
43
|
+
|
|
44
|
+
:::{nma-feedback} Linear_Dynamical_Systems_Video
|
|
45
|
+
:::
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Directives must be at the top level of a page. Their options are checked by
|
|
49
|
+
`nma-kit check`.
|
|
50
|
+
|
|
51
|
+
Settings live in the `nma:` block of `myst.yml` (all optional):
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
nma:
|
|
55
|
+
paths:
|
|
56
|
+
tutorials: tutorials
|
|
57
|
+
notebooks:
|
|
58
|
+
branch: notebooks-branch
|
|
59
|
+
feedback: { url: https://..., project: ..., user_key: ... }
|
|
60
|
+
scrolly:
|
|
61
|
+
pyodide_url: https://cdn.jsdelivr.net/pyodide/v314.0.7/full/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
One rule belongs in the course's own CSS, because a plugin can't add
|
|
65
|
+
site-wide CSS: `.myst-jp-nb-toolbar { display: none !important; }`.
|
|
66
|
+
|
|
67
|
+
## What's in the package
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
dist/nma.mjs the plugin (all features, one file)
|
|
71
|
+
dist/nma.yml the config courses `extend:`
|
|
72
|
+
dist/assets/<name>/ browser widgets and CSS, one folder per feature
|
|
73
|
+
dist/build-info.json {mode, version}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Asset URLs inside the bundle point at this exact version on jsDelivr. MyST
|
|
77
|
+
downloads them at build time and serves them from the course's own site, so
|
|
78
|
+
readers' browsers don't contact the CDN for them. The one exception is
|
|
79
|
+
the Python runtime: editable cells and scrolly pages load Pyodide from
|
|
80
|
+
`cdn.jsdelivr.net`, and micropip installs packages from PyPI.
|
|
81
|
+
|
|
82
|
+
## Versions
|
|
83
|
+
|
|
84
|
+
The kit is on 0.x. A breaking change bumps the minor version, so `@0.1` only
|
|
85
|
+
receives compatible fixes. Don't use `@latest` in `myst.yml`: jsDelivr caches
|
|
86
|
+
alias URLs for up to 7 days and `@latest` crosses major versions.
|
|
87
|
+
|
|
88
|
+
## Development
|
|
89
|
+
|
|
90
|
+
Source, tests and release process: <https://github.com/neuromatch/course-kit>.
|
|
91
|
+
|
|
92
|
+
BSD-3-Clause.
|
package/dist/build-info.json
CHANGED
package/dist/nma.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @neuromatch/course-kit 0.1.
|
|
1
|
+
// @neuromatch/course-kit 0.1.2 MyST plugin (release build). GENERATED, do not edit.
|
|
2
2
|
import { createRequire as __nmaCreateRequire } from 'node:module';
|
|
3
3
|
const require = __nmaCreateRequire(import.meta.url);
|
|
4
4
|
var __create = Object.create;
|
|
@@ -7645,7 +7645,7 @@ import { readFileSync as readFileSync2 } from "node:fs";
|
|
|
7645
7645
|
// src/shared/assets.mjs
|
|
7646
7646
|
import { dirname, join as join2, relative as relative2, sep as sep2 } from "node:path";
|
|
7647
7647
|
import { fileURLToPath } from "node:url";
|
|
7648
|
-
var BASE = true ? "https://cdn.jsdelivr.net/npm/@neuromatch/course-kit@0.1.
|
|
7648
|
+
var BASE = true ? "https://cdn.jsdelivr.net/npm/@neuromatch/course-kit@0.1.2/dist/assets/" : null;
|
|
7649
7649
|
var BUNDLED = true;
|
|
7650
7650
|
function assetsDir() {
|
|
7651
7651
|
const here = dirname(fileURLToPath(import.meta.url));
|
package/dist/nma.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Course kit 0.1.
|
|
1
|
+
# Course kit 0.1.2. Courses add this file with
|
|
2
2
|
# extend: https://cdn.jsdelivr.net/npm/@neuromatch/course-kit@0.1/dist/nma.yml
|
|
3
3
|
# and `nma-kit prepare-site` pins that URL to the CLI's exact version on CI.
|
|
4
4
|
version: 1
|
|
@@ -6,4 +6,4 @@ project:
|
|
|
6
6
|
jupyter:
|
|
7
7
|
lite: true
|
|
8
8
|
plugins:
|
|
9
|
-
- https://cdn.jsdelivr.net/npm/@neuromatch/course-kit@0.1.
|
|
9
|
+
- https://cdn.jsdelivr.net/npm/@neuromatch/course-kit@0.1.2/dist/nma.mjs
|