Skip to content

Commit 29de3e7

Browse files
authored
🎨 Update for showing exercises (#147)
1 parent ed89359 commit 29de3e7

File tree

3 files changed

+58
-47
lines changed

3 files changed

+58
-47
lines changed

‎package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,18 @@
6262
"@jupyterlab/notebook": "^3.4.7",
6363
"@jupyterlab/rendermime": "^3.4.7",
6464
"@jupyterlab/translation": "^3.4.7",
65-
"@myst-theme/diagrams": "^0.2.6",
66-
"@myst-theme/frontmatter": "^0.2.6",
67-
"@myst-theme/providers": "^0.2.6",
65+
"@myst-theme/diagrams": "^0.2.8",
66+
"@myst-theme/frontmatter": "^0.2.8",
67+
"@myst-theme/providers": "^0.2.8",
6868
"katex": "^0.15.2",
6969
"myst-ext-card": "^0.0.7",
70+
"myst-ext-exercise": "^0.0.2",
7071
"myst-ext-grid": "^0.0.7",
7172
"myst-ext-proof": "^0.0.2",
7273
"myst-ext-tabs": "^0.0.7",
7374
"myst-frontmatter": "^0.0.13",
74-
"myst-parser": "^0.0.30",
75-
"myst-to-react": "^0.2.6",
75+
"myst-parser": "^0.0.31",
76+
"myst-to-react": "^0.2.8",
7677
"myst-transforms": "^0.0.31"
7778
},
7879
"resolutions": {
@@ -83,7 +84,7 @@
8384
"@babel/preset-env": "^7.0.0",
8485
"@jupyterlab/builder": "^3.4.7",
8586
"@jupyterlab/testutils": "^3.4.7",
86-
"@myst-theme/styles": "^0.2.6",
87+
"@myst-theme/styles": "^0.2.8",
8788
"@tailwindcss/typography": "^0.5.8",
8889
"@types/jest": "^26.0.0",
8990
"@types/react": "^17.0.1",

‎src/myst.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { cardDirective } from 'myst-ext-card';
2525
import { gridDirective } from 'myst-ext-grid';
2626
import { tabDirectives } from 'myst-ext-tabs';
2727
import { proofDirective } from 'myst-ext-proof';
28+
import { exerciseDirectives } from 'myst-ext-exercise';
2829
import { StaticNotebook } from '@jupyterlab/notebook';
2930
import { getCellList } from './utils';
3031
import { imageUrlSourceTransform } from './images';
@@ -38,7 +39,8 @@ export function markdownParse(text: string, inNotebook = true): Root {
3839
cardDirective,
3940
gridDirective,
4041
proofDirective,
41-
...tabDirectives
42+
...tabDirectives,
43+
...exerciseDirectives
4244
],
4345
roles: [evalRole]
4446
});

‎yarn.lock

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,18 +2042,18 @@
20422042
"@lumino/signaling" "^1.11.1"
20432043
"@lumino/virtualdom" "^1.14.3"
20442044

2045-
"@myst-theme/diagrams@^0.2.6":
2046-
version "0.2.7"
2047-
resolved "https://registry.yarnpkg.com/@myst-theme/diagrams/-/diagrams-0.2.7.tgz#46580b6b38031dd0c61b8874f93866f48a08c1a2"
2048-
integrity sha512-4hAuNX3hMtB5FrqClAcU8K9j9biqm3LK4Lhb5ANSqYHf3v6YHmVI9V0nnzSmO0iCQ2C7Bwskbe6Izur2vktc8g==
2045+
"@myst-theme/diagrams@^0.2.8":
2046+
version "0.2.8"
2047+
resolved "https://registry.yarnpkg.com/@myst-theme/diagrams/-/diagrams-0.2.8.tgz#81db097145b9120b0f69862adf90d2d5e0a4a96e"
2048+
integrity sha512-C9H7d+jN8xt+llTVjZ1VuuFz/oGHrI1AJ+akLwu4+II4rNWeVdE5ZhEsbWGnCWH6QeUQrRza0fqsS0SMxbZ1Ug==
20492049
dependencies:
2050-
"@myst-theme/providers" "^0.2.7"
2050+
"@myst-theme/providers" "^0.2.8"
20512051
mermaid "^9.3.0"
20522052

2053-
"@myst-theme/frontmatter@^0.2.6":
2054-
version "0.2.7"
2055-
resolved "https://registry.yarnpkg.com/@myst-theme/frontmatter/-/frontmatter-0.2.7.tgz#dc6b2c41921a41e4ea07641c46d323bef7a0ef68"
2056-
integrity sha512-IfmhLHBtu3CrN/u0O+oum5GBsPAfTPKCbBVKjvWIQ3nnUh6Yz9XB72IqmXwwrekUxlPNFy7dY/vSUCd+m7RVkA==
2053+
"@myst-theme/frontmatter@^0.2.8":
2054+
version "0.2.8"
2055+
resolved "https://registry.yarnpkg.com/@myst-theme/frontmatter/-/frontmatter-0.2.8.tgz#4da4f92ebc896f82d10d58a0c19c36fb04773136"
2056+
integrity sha512-RdQpgv8kDdxUgJ9vGWPFirXFqSArozQXhh98vsVbDyvvFs7qaupiL8WTu84xxFqxUwn4X2eyY9I9owIn7hEahA==
20572057
dependencies:
20582058
"@headlessui/react" "^1.7.13"
20592059
"@heroicons/react" "^2.0.13"
@@ -2062,19 +2062,19 @@
20622062
myst-common "*"
20632063
myst-frontmatter "*"
20642064

2065-
"@myst-theme/providers@^0.2.6", "@myst-theme/providers@^0.2.7":
2066-
version "0.2.7"
2067-
resolved "https://registry.yarnpkg.com/@myst-theme/providers/-/providers-0.2.7.tgz#05766ae305718a311d499d41b26a1125209340ae"
2068-
integrity sha512-Ykq6XR8p+SnA6p0JLnzGPtZm19YrPVEGoFE0GqAnGYJ4fY7RPdEMXo6009nxQVRDsN3tIrLMP50CtBfeDIc8Jg==
2065+
"@myst-theme/providers@^0.2.8":
2066+
version "0.2.8"
2067+
resolved "https://registry.yarnpkg.com/@myst-theme/providers/-/providers-0.2.8.tgz#f85a9c0a5cf3f7988a04365cea871eb5ef9381ed"
2068+
integrity sha512-njduygGYnmxWAQyyXepkI+JWjK0gDr6OFKiA7StxcqjnER45hWdTmN80HpYwxZRqr6j4qJTV6VDURzEcWD12ew==
20692069
dependencies:
20702070
myst-common "^0.0.16"
20712071
myst-config "^0.0.14"
20722072
myst-frontmatter "^0.0.13"
20732073

2074-
"@myst-theme/styles@^0.2.6":
2075-
version "0.2.7"
2076-
resolved "https://registry.yarnpkg.com/@myst-theme/styles/-/styles-0.2.7.tgz#994dcbc92ba139b10d4e9363d3c6941cfaf5bc89"
2077-
integrity sha512-emSIQUvGAlco0I7qWJ1VF3rblsaB60MoAvAsTHRAwmtqQ/88wfGTiNmGWfuZOTpG+XGg6TBo0/64mcdRttNegg==
2074+
"@myst-theme/styles@^0.2.8":
2075+
version "0.2.8"
2076+
resolved "https://registry.yarnpkg.com/@myst-theme/styles/-/styles-0.2.8.tgz#da459dd5d8591bf9fe193db13a667224e52a87fe"
2077+
integrity sha512-wYsTDqQ7OuPbU9EBV5fDZodLlAJ6oec7T5pZL6edmM1s1OqmzG0hduW7i+1AwdB00kkmCHDlq8KT4mWZB6lGHQ==
20782078

20792079
"@nodelib/[email protected]":
20802080
version "2.1.5"
@@ -7171,10 +7171,10 @@ myst-config@^0.0.14:
71717171
myst-frontmatter "^0.0.13"
71727172
simple-validators "^0.0.3"
71737173

7174-
myst-directives@^0.0.30:
7175-
version "0.0.30"
7176-
resolved "https://registry.yarnpkg.com/myst-directives/-/myst-directives-0.0.30.tgz#00a7cbbe5bc32c81d80a898d3d147f63519758b3"
7177-
integrity sha512-qAoDqwdK4QMFbNjCM1ct4OO2JqXDOTWhZiTY9CqsG8xDHSrxuXYwRHbr7jPN3ig4wL3pPWavHuDMYQQMptsvmw==
7174+
myst-directives@^0.0.31:
7175+
version "0.0.31"
7176+
resolved "https://registry.yarnpkg.com/myst-directives/-/myst-directives-0.0.31.tgz#55d8cc85689e8361a712b2d2bd1121997778251b"
7177+
integrity sha512-cA8G3va2vNkrM+fMhSRW0GvMVNnEwn3h2RJpUjG/Hhnho7lwoSMIMLaQTg0FF5Ja51Aev6KWFIxE8XCJvIA8Lw==
71787178
dependencies:
71797179
js-yaml "^4.1.0"
71807180
myst-common "^0.0.17"
@@ -7188,6 +7188,13 @@ myst-ext-card@^0.0.7:
71887188
dependencies:
71897189
myst-common "^0.0.17"
71907190

7191+
myst-ext-exercise@^0.0.2:
7192+
version "0.0.2"
7193+
resolved "https://registry.yarnpkg.com/myst-ext-exercise/-/myst-ext-exercise-0.0.2.tgz#c1d98f1815318daa6ae27fabe838bbf356667b47"
7194+
integrity sha512-xReop6BpM6WGlGIv45jGZsqXBVZDoigIVER+0/5FeTiYtrBLYMgVwKHSFZsna4XqynbC3pHWUMssU/luJrqPzw==
7195+
dependencies:
7196+
myst-common "^0.0.17"
7197+
71917198
myst-ext-grid@^0.0.7:
71927199
version "0.0.7"
71937200
resolved "https://registry.yarnpkg.com/myst-ext-grid/-/myst-ext-grid-0.0.7.tgz#5672667384ae5f2f69e5ee4ab91e86d63f9b2ae2"
@@ -7220,10 +7227,10 @@ myst-frontmatter@*, myst-frontmatter@^0.0.13:
72207227
simple-validators "^0.0.3"
72217228
spdx-correct "^3.1.1"
72227229

7223-
myst-parser@^0.0.30:
7224-
version "0.0.30"
7225-
resolved "https://registry.yarnpkg.com/myst-parser/-/myst-parser-0.0.30.tgz#81978c847170d6c7eb3600eac2b6262c62122d2c"
7226-
integrity sha512-4/K45BJ6wWNOsPI0HlMmqEmqqqvSxMRgj+GrRl8euOA9m0kzoOvDNWBebS+wU0qgdk9v3nhfN12uBued2rQa5g==
7230+
myst-parser@^0.0.31:
7231+
version "0.0.31"
7232+
resolved "https://registry.yarnpkg.com/myst-parser/-/myst-parser-0.0.31.tgz#656b1014b67d4898fa465442ca48693a524ab156"
7233+
integrity sha512-qIchqmnw7nE9ad2fKPlUnYree01ssVM1ftiqeQvWqCv42vMeUKho+YjUksznylSIK+9fGqUKbrEjkIfCnxZa4Q==
72277234
dependencies:
72287235
he "^1.2.0"
72297236
markdown-it "^12.3.2"
@@ -7235,8 +7242,8 @@ myst-parser@^0.0.30:
72357242
markdown-it-myst "0.1.3"
72367243
markdown-it-myst-extras "0.2.0"
72377244
markdown-it-task-lists "^2.1.1"
7238-
myst-directives "^0.0.30"
7239-
myst-roles "^0.0.30"
7245+
myst-directives "^0.0.31"
7246+
myst-roles "^0.0.31"
72407247
myst-spec "^0.0.4"
72417248
unified "^10.1.1"
72427249
unist-builder "^3.0.0"
@@ -7245,10 +7252,10 @@ myst-parser@^0.0.30:
72457252
unist-util-visit "^4.1.0"
72467253
vfile "^5.3.7"
72477254

7248-
myst-roles@^0.0.30:
7249-
version "0.0.30"
7250-
resolved "https://registry.yarnpkg.com/myst-roles/-/myst-roles-0.0.30.tgz#a67082a80c810aa81fd4cd99b0e0bd5e8683f500"
7251-
integrity sha512-pfUbBZHNcnrvr+JNfRn2u+7ZLdI6i21yqbH2wMSeGiXFNogaHClQsBSd+bkVuvdMiaNXNk25UP8k8JoKySbhww==
7255+
myst-roles@^0.0.31:
7256+
version "0.0.31"
7257+
resolved "https://registry.yarnpkg.com/myst-roles/-/myst-roles-0.0.31.tgz#bd9cfad12f1b5a12b3f7da5a97c1aafabdaa0017"
7258+
integrity sha512-8l2vgPF+/L83QRNwyfOW2N2H3Gd8rxU2L6TvINP64rHah4XowD/0iyQCDYUk6U9x7KpsV4JK3Y0h8xPF95P2ww==
72527259
dependencies:
72537260
myst-common "^0.0.17"
72547261
myst-spec-ext "^0.0.12"
@@ -7265,13 +7272,13 @@ myst-spec@^0.0.4:
72657272
resolved "https://registry.yarnpkg.com/myst-spec/-/myst-spec-0.0.4.tgz#fb998ec09e330810b454f4643c0116a25a057b80"
72667273
integrity sha512-1j7184Wmg5lhgSXt6AXtG82E0PFJ7ULFPplfshQDzb4nIOLKruYFD0CYWheRPMM/eVqNbNZUzc/LLrhyubsK0Q==
72677274

7268-
myst-to-react@^0.2.6:
7269-
version "0.2.7"
7270-
resolved "https://registry.yarnpkg.com/myst-to-react/-/myst-to-react-0.2.7.tgz#6e882abb56c1e68aff9852c7169d5b263ba25554"
7271-
integrity sha512-QW92g3wZydVn7VuAYC8H2+W6W/NOOot7n3tlyKdX2mnmiWMHb1ecX8did1RX4yIM9l/xZhHxarId4PNbX3xcsw==
7275+
myst-to-react@^0.2.8:
7276+
version "0.2.8"
7277+
resolved "https://registry.yarnpkg.com/myst-to-react/-/myst-to-react-0.2.8.tgz#8f77bf76dc8723152a00d20b7a20676b4f0a2f9c"
7278+
integrity sha512-1JJ2K0FG6p+RzyJNtGjqU2Km5IVjTG4j1G33lyLpcc2hAhS+bmtDA1ghcbLSDItvOLOJIDH3gWoO7fKj5b0hag==
72727279
dependencies:
72737280
"@heroicons/react" "^2.0.13"
7274-
"@myst-theme/providers" "^0.2.7"
7281+
"@myst-theme/providers" "^0.2.8"
72757282
"@radix-ui/react-hover-card" "^1.0.5"
72767283
buffer "^6.0.3"
72777284
classnames "^2.3.2"
@@ -7283,10 +7290,10 @@ myst-to-react@^0.2.6:
72837290
swr "^1.3.0"
72847291
unist-util-select "^4.0.3"
72857292

7286-
myst-transforms@^0.0.30:
7287-
version "0.0.30"
7288-
resolved "https://registry.yarnpkg.com/myst-transforms/-/myst-transforms-0.0.30.tgz#872622130b60eb6e89d022aeae38e51d3dc55c0d"
7289-
integrity sha512-1L1L8iwWjiI0CyTXoQxgLJdEU4y6MoqvDAQ0drHYSGESHyGg7+QINi+4tgxX8uu28FpVfcL2xGgJC+QVJejXvQ==
7293+
myst-transforms@^0.0.31:
7294+
version "0.0.31"
7295+
resolved "https://registry.yarnpkg.com/myst-transforms/-/myst-transforms-0.0.31.tgz#9c0c63fc5976ed00c7da87fd11e86f1a3c144a6e"
7296+
integrity sha512-ZrgSGdMN34rNZeaUHdijssxGZjkXmXS1RJS9hSQ6fzixm74mHU4yPdEZ2WSk+8Rpc6Clk0ND5frc9691fG81Qw==
72907297
dependencies:
72917298
doi-utils "^1.0.9"
72927299
intersphinx "^0.0.8"
@@ -7301,6 +7308,7 @@ myst-transforms@^0.0.30:
73017308
unified "^10.0.0"
73027309
unist-util-find-after "^4.0.0"
73037310
unist-util-modify-children "^3.1.0"
7311+
unist-util-remove "^3.1.0"
73047312
unist-util-select "^4.0.3"
73057313
vfile "^5.0.0"
73067314
vfile-message "^3.1.2"

0 commit comments

Comments
 (0)