@curvenote/renderers 0.6.11 → 0.8.0
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/dist/transforms/outputs.js +6 -6
- package/package.json +13 -8
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { normalizeLabel } from 'myst-common';
|
|
2
2
|
import { selectAll } from 'unist-util-select';
|
|
3
3
|
export function transformDecorateNotebookOutputsWithSlugs(page) {
|
|
4
|
-
selectAll('container[kind=figure]:has(
|
|
4
|
+
selectAll('container[kind=figure]:has(outputs), embed:has(outputs), container[kind=table]:has(outputs)', page.mdast).forEach((node) => {
|
|
5
5
|
var _a, _b;
|
|
6
6
|
const { source } = node;
|
|
7
|
-
const
|
|
7
|
+
const outputs = selectAll('outputs', node);
|
|
8
8
|
if (source) {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const sideEffectOutputs = outputs[0];
|
|
10
|
+
sideEffectOutputs.notebookSlug = (_a = source.slug) !== null && _a !== void 0 ? _a : 'unknown';
|
|
11
|
+
sideEffectOutputs.html_id = (_b = normalizeLabel(source.label)) === null || _b === void 0 ? void 0 : _b.html_id;
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
14
|
console.warn(`no "source" on node`, node);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
selectAll('block[kind=notebook-code] >
|
|
17
|
+
selectAll('block[kind=notebook-code] > outputs', page.mdast).forEach((node) => {
|
|
18
18
|
node.notebookSlug = page.slug;
|
|
19
19
|
});
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@curvenote/renderers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
"node": ">=16"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/curvenote/journal-theme.git",
|
|
17
|
+
"directory": "packages/renderers"
|
|
18
|
+
},
|
|
14
19
|
"sideEffects": false,
|
|
15
20
|
"scripts": {
|
|
16
21
|
"clean": "rimraf dist",
|
|
@@ -21,17 +26,17 @@
|
|
|
21
26
|
"build": "npm-run-all -l clean -p build:esm"
|
|
22
27
|
},
|
|
23
28
|
"dependencies": {
|
|
24
|
-
"@curvenote/ext-blog": "^0.
|
|
25
|
-
"@curvenote/ext-footer": "^0.
|
|
26
|
-
"@curvenote/ext-landing": "^0.
|
|
27
|
-
"@curvenote/ext-person": "^0.
|
|
28
|
-
"@curvenote/theme": "^0.
|
|
29
|
+
"@curvenote/ext-blog": "^0.8.0",
|
|
30
|
+
"@curvenote/ext-footer": "^0.8.0",
|
|
31
|
+
"@curvenote/ext-landing": "^0.8.0",
|
|
32
|
+
"@curvenote/ext-person": "^0.8.0",
|
|
33
|
+
"@curvenote/theme": "^0.8.0",
|
|
29
34
|
"@heroicons/react": "^2.1.5",
|
|
30
|
-
"@myst-theme/providers": "^0.
|
|
35
|
+
"@myst-theme/providers": "^1.0.1",
|
|
31
36
|
"@scienceicons/myst": "^1.0.4",
|
|
32
37
|
"classnames": "^2.5.1",
|
|
33
38
|
"lucide-react": "^0.456.0",
|
|
34
|
-
"myst-to-react": "^0.
|
|
39
|
+
"myst-to-react": "^1.0.1",
|
|
35
40
|
"p-limit": "^3.1.0",
|
|
36
41
|
"swr": "^2.1.5",
|
|
37
42
|
"unist-util-select": "^4.0.3"
|