@myst-theme/site 0.0.17 → 0.0.19
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/package.json +14 -13
- package/src/components/renderers.ts +4 -0
- package/src/loaders/utils.ts +7 -5
- package/src/pages/Root.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/site",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"main": "./src/index.ts",
|
|
5
5
|
"types": "./src/index.ts",
|
|
6
6
|
"files": [
|
|
@@ -14,29 +14,30 @@
|
|
|
14
14
|
"lint:format": "prettier --check \"src/**/*.{ts,tsx,md}\""
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@curvenote/
|
|
18
|
-
"@curvenote/connect": "0.0.6",
|
|
17
|
+
"@curvenote/connect": "^0.0.7",
|
|
19
18
|
"@curvenote/icons": "^0.0.3",
|
|
20
|
-
"@curvenote/nbtx": "^0.1.11",
|
|
21
19
|
"@curvenote/runtime": "^0.2.9",
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"@myst-theme/frontmatter": "^0.1.
|
|
20
|
+
"@headlessui/react": "^1.7.7",
|
|
21
|
+
"@heroicons/react": "^2.0.13",
|
|
22
|
+
"@myst-theme/diagrams": "^0.1.1",
|
|
23
|
+
"@myst-theme/frontmatter": "^0.1.20",
|
|
24
|
+
"@myst-theme/jupyter": "^0.0.2",
|
|
25
|
+
"@myst-theme/providers": "^0.1.20",
|
|
26
26
|
"classnames": "^2.3.2",
|
|
27
27
|
"lodash.throttle": "^4.1.1",
|
|
28
|
-
"myst-common": "^0.0.
|
|
28
|
+
"myst-common": "^0.0.12",
|
|
29
29
|
"myst-config": "^0.0.6",
|
|
30
|
-
"myst-demo": "^0.1.
|
|
31
|
-
"myst-to-react": "^0.1.
|
|
30
|
+
"myst-demo": "^0.1.20",
|
|
31
|
+
"myst-to-react": "^0.1.20",
|
|
32
32
|
"mystjs": "^0.0.15",
|
|
33
|
+
"nbtx": "^0.2.3",
|
|
33
34
|
"node-cache": "^5.1.2",
|
|
34
35
|
"node-fetch": "^2.6.7",
|
|
35
36
|
"unist-util-select": "^4.0.1"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"@remix-run/node": "^1.
|
|
39
|
-
"@remix-run/react": "^1.
|
|
39
|
+
"@remix-run/node": "^1.10.0",
|
|
40
|
+
"@remix-run/react": "^1.10.0",
|
|
40
41
|
"@types/react": "^16.8 || ^17.0 || ^18.0",
|
|
41
42
|
"@types/react-dom": "^16.8 || ^17.0 || ^18.0",
|
|
42
43
|
"react": "^16.8 || ^17.0 || ^18.0",
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { DEFAULT_RENDERERS } from 'myst-to-react';
|
|
2
2
|
import { MystDemoRenderer } from 'myst-demo';
|
|
3
|
+
import { MermaidNodeRenderer } from '@myst-theme/diagrams';
|
|
4
|
+
import OUTPUT_RENDERERS from '@myst-theme/jupyter';
|
|
3
5
|
|
|
4
6
|
export const renderers = {
|
|
5
7
|
...DEFAULT_RENDERERS,
|
|
6
8
|
myst: MystDemoRenderer,
|
|
9
|
+
mermaid: MermaidNodeRenderer,
|
|
10
|
+
...OUTPUT_RENDERERS,
|
|
7
11
|
};
|
package/src/loaders/utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MinifiedOutput } from '
|
|
2
|
-
import {
|
|
1
|
+
import type { MinifiedOutput } from 'nbtx';
|
|
2
|
+
import { walkOutputs } from 'nbtx';
|
|
3
3
|
import type { SiteManifest } from 'myst-config';
|
|
4
4
|
import { selectAll } from 'unist-util-select';
|
|
5
5
|
import type { Image as ImageSpec, Link as LinkSpec } from 'myst-spec';
|
|
@@ -136,9 +136,11 @@ export function updatePageStaticLinksInplace(data: PageLoader, updateUrl: Update
|
|
|
136
136
|
const outputs = selectAll('output', data.mdast) as Output[];
|
|
137
137
|
outputs.forEach((node) => {
|
|
138
138
|
if (!node.data) return;
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
walkOutputs(node.data, (obj) => {
|
|
140
|
+
// The path will be defined from output of myst-cli
|
|
141
|
+
// Here we are re-asigning it to the current domain
|
|
142
|
+
if (!obj.path) return;
|
|
143
|
+
obj.path = updateUrl(obj.path);
|
|
142
144
|
});
|
|
143
145
|
});
|
|
144
146
|
return data;
|
package/src/pages/Root.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
ScrollRestoration,
|
|
11
11
|
useCatch,
|
|
12
12
|
useLoaderData,
|
|
13
|
+
Link as RemixLink,
|
|
13
14
|
} from '@remix-run/react';
|
|
14
15
|
import { ContentReload, renderers } from '../components';
|
|
15
16
|
import { Analytics } from '../seo';
|
|
@@ -42,7 +43,7 @@ export function Document({
|
|
|
42
43
|
/>
|
|
43
44
|
</head>
|
|
44
45
|
<body className="m-0 transition-colors duration-500 bg-white dark:bg-stone-900">
|
|
45
|
-
<ThemeProvider theme={theme} renderers={renderers}>
|
|
46
|
+
<ThemeProvider theme={theme} renderers={renderers} Link={RemixLink as any}>
|
|
46
47
|
<SiteProvider config={config}>{children}</SiteProvider>
|
|
47
48
|
</ThemeProvider>
|
|
48
49
|
<ScrollRestoration />
|