From e339ad98082ae9ea521f3eba5a5c29ea778b21c4 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Tue, 8 Oct 2024 20:13:33 +0200 Subject: [PATCH] Working version --- packages/voila/package.json | 2 +- packages/voila/src/index.ts | 2 +- packages/voila/src/manager.ts | 4 +- packages/voila/style/index.css | 131 ++++++++++++++++++ .../voila/templates/base/static/main.js | 2 +- yarn.lock | 99 ++++++++++--- 6 files changed, 218 insertions(+), 22 deletions(-) diff --git a/packages/voila/package.json b/packages/voila/package.json index 93b9ff9fc..2aa05821f 100644 --- a/packages/voila/package.json +++ b/packages/voila/package.json @@ -20,7 +20,7 @@ "@jupyterlab/docregistry": "^3 || ^4 || ^5", "@jupyterlab/javascript-extension": "^3 || ^4", "@jupyterlab/markedparser-extension": "^4", - "@jupyterlab/mathjax2-extension": "^4", + "@jupyterlab/mathjax-extension": "^4", "@jupyterlab/notebook": "^3 || ^4", "@jupyterlab/outputarea": "^3 || ^4", "@jupyterlab/rendermime": "^3 || ^4", diff --git a/packages/voila/src/index.ts b/packages/voila/src/index.ts index 08e8e74e3..a3a336c18 100644 --- a/packages/voila/src/index.ts +++ b/packages/voila/src/index.ts @@ -20,7 +20,7 @@ export { export { PageConfig } from '@jupyterlab/coreutils'; -export { MathJaxTypesetter } from '@jupyterlab/mathjax2-extension'; +export { MathJaxTypesetter } from '@jupyterlab/mathjax-extension'; export { createMarkdownParser } from '@jupyterlab/markedparser-extension'; diff --git a/packages/voila/src/manager.ts b/packages/voila/src/manager.ts index 0dd4f964d..66d3b196d 100644 --- a/packages/voila/src/manager.ts +++ b/packages/voila/src/manager.ts @@ -31,7 +31,7 @@ import * as LuminoVirtualdom from '@lumino/virtualdom'; import * as LuminoAlgorithm from '@lumino/algorithm'; import * as LuminoCommands from '@lumino/commands'; import * as LuminoDomutils from '@lumino/domutils'; -import * as Mathjax2 from '@jupyterlab/mathjax2-extension'; +import * as Mathjax from '@jupyterlab/mathjax-extension'; import { MessageLoop } from '@lumino/messaging'; @@ -54,7 +54,7 @@ if (typeof window !== 'undefined' && typeof window.define !== 'undefined') { window.define('@jupyterlab/docregistry', DocRegistry); window.define('@jupyterlab/outputarea', OutputArea); window.define('@jupyterlab/outputarea', OutputArea); - window.define('@jupyterlab/mathjax2-extension', Mathjax2); + window.define('@jupyterlab/mathjax-extension', Mathjax); window.define('@phosphor/widgets', LuminoWidget); window.define('@phosphor/signaling', LuminoSignaling); diff --git a/packages/voila/style/index.css b/packages/voila/style/index.css index e69de29bb..0882d6ba1 100644 --- a/packages/voila/style/index.css +++ b/packages/voila/style/index.css @@ -0,0 +1,131 @@ +@font-face /* 0 */ { + font-family: MJXZERO; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Zero.woff') + format('woff'); + } + + @font-face /* 1 */ { + font-family: MJXTEX; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff') + format('woff'); + } + + @font-face /* 2 */ { + font-family: MJXTEX-B; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff') + format('woff'); + } + + @font-face /* 3 */ { + font-family: MJXTEX-MI; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff') + format('woff'); + } + + @font-face /* 4 */ { + font-family: MJXTEX-I; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff') + format('woff'); + } + + @font-face /* 5 */ { + font-family: MJXTEX-BI; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff') + format('woff'); + } + + @font-face /* 6 */ { + font-family: MJXTEX-S1; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff') + format('woff'); + } + + @font-face /* 7 */ { + font-family: MJXTEX-S2; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff') + format('woff'); + } + + @font-face /* 8 */ { + font-family: MJXTEX-S3; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff') + format('woff'); + } + + @font-face /* 9 */ { + font-family: MJXTEX-S4; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff') + format('woff'); + } + + @font-face /* 10 */ { + font-family: MJXTEX-A; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff') + format('woff'); + } + + @font-face /* 11 */ { + font-family: MJXTEX-C; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff') + format('woff'); + } + + @font-face /* 12 */ { + font-family: MJXTEX-C-B; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff') + format('woff'); + } + + @font-face /* 13 */ { + font-family: MJXTEX-FR; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff') + format('woff'); + } + + @font-face /* 14 */ { + font-family: MJXTEX-FR-B; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff') + format('woff'); + } + + @font-face /* 15 */ { + font-family: MJXTEX-SS; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff') + format('woff'); + } + + @font-face /* 16 */ { + font-family: MJXTEX-SS-B; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff') + format('woff'); + } + + @font-face /* 17 */ { + font-family: MJXTEX-SS-I; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff') + format('woff'); + } + + @font-face /* 18 */ { + font-family: MJXTEX-SC; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff') + format('woff'); + } + + @font-face /* 19 */ { + font-family: MJXTEX-T; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff') + format('woff'); + } + + @font-face /* 20 */ { + font-family: MJXTEX-V; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff') + format('woff'); + } + + @font-face /* 21 */ { + font-family: MJXTEX-VB; + src: url('~mathjax-full/es5/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff') + format('woff'); + } diff --git a/share/jupyter/voila/templates/base/static/main.js b/share/jupyter/voila/templates/base/static/main.js index aa97ed773..f93caf515 100644 --- a/share/jupyter/voila/templates/base/static/main.js +++ b/share/jupyter/voila/templates/base/static/main.js @@ -51,7 +51,7 @@ require([window.voila_js_url || 'static/voila'], function(voila) { voila.PageConfig.setOption( urlParam, url === 'null' - ? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js' + ? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/latest.min.js' : url ); voila.PageConfig.setOption( diff --git a/yarn.lock b/yarn.lock index 1f3a223fd..5293ab767 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2132,7 +2132,7 @@ __metadata: languageName: node linkType: hard -"@jupyterlab/application@npm:^3 || ^4, @jupyterlab/application@npm:^3.0.0 || ^4.0.0, @jupyterlab/application@npm:^4.0.0, @jupyterlab/application@npm:^4.2.5": +"@jupyterlab/application@npm:^3 || ^4, @jupyterlab/application@npm:^3.0.0 || ^4.0.0, @jupyterlab/application@npm:^4.2.5": version: 4.2.5 resolution: "@jupyterlab/application@npm:4.2.5" dependencies: @@ -2371,7 +2371,7 @@ __metadata: languageName: node linkType: hard -"@jupyterlab/coreutils@npm:^5 || ^6, @jupyterlab/coreutils@npm:^6.0.0, @jupyterlab/coreutils@npm:^6.2.5": +"@jupyterlab/coreutils@npm:^5 || ^6, @jupyterlab/coreutils@npm:^6.2.5": version: 6.2.5 resolution: "@jupyterlab/coreutils@npm:6.2.5" dependencies: @@ -2608,17 +2608,15 @@ __metadata: languageName: node linkType: hard -"@jupyterlab/mathjax2-extension@npm:^4": - version: 4.0.0 - resolution: "@jupyterlab/mathjax2-extension@npm:4.0.0" +"@jupyterlab/mathjax-extension@npm:^4": + version: 4.2.5 + resolution: "@jupyterlab/mathjax-extension@npm:4.2.5" dependencies: - "@jupyterlab/application": ^4.0.0 - "@jupyterlab/coreutils": ^6.0.0 - "@jupyterlab/rendermime": ^4.0.0 - "@jupyterlab/rendermime-interfaces": ^3.8.0 - "@jupyterlab/translation": ^4.0.0 - "@lumino/coreutils": ^2.1.0 - checksum: 1bf0c5c9ce128c5785bfe3014c40023aeac62dc7a18dd5c7780b0214f8b35452581050a5003994b97007c13431b6dd7d8540ef2b4a23714c7bacfa460487bacf + "@jupyterlab/application": ^4.2.5 + "@jupyterlab/rendermime": ^4.2.5 + "@lumino/coreutils": ^2.1.2 + mathjax-full: ^3.2.2 + checksum: a7ef154816ed676191a80c003a86dcd3a612ec6bacbff78372adab8944dcde1ef94194999fe1e67753b192e3f1cfea80e549651140e8ac2003d662d35d40ddbb languageName: node linkType: hard @@ -2740,7 +2738,7 @@ __metadata: languageName: node linkType: hard -"@jupyterlab/rendermime-interfaces@npm:^3.0.0 || ^4.0.0, @jupyterlab/rendermime-interfaces@npm:^3.10.5, @jupyterlab/rendermime-interfaces@npm:^3.8.0": +"@jupyterlab/rendermime-interfaces@npm:^3.0.0 || ^4.0.0, @jupyterlab/rendermime-interfaces@npm:^3.10.5": version: 3.10.5 resolution: "@jupyterlab/rendermime-interfaces@npm:3.10.5" dependencies: @@ -2750,7 +2748,7 @@ __metadata: languageName: node linkType: hard -"@jupyterlab/rendermime@npm:^3 || ^4, @jupyterlab/rendermime@npm:^3.0.0 || ^4.0.0, @jupyterlab/rendermime@npm:^4.0.0, @jupyterlab/rendermime@npm:^4.2.5": +"@jupyterlab/rendermime@npm:^3 || ^4, @jupyterlab/rendermime@npm:^3.0.0 || ^4.0.0, @jupyterlab/rendermime@npm:^4.2.5": version: 4.2.5 resolution: "@jupyterlab/rendermime@npm:4.2.5" dependencies: @@ -2907,7 +2905,7 @@ __metadata: languageName: node linkType: hard -"@jupyterlab/translation@npm:^3.0.0 || ^4.0.0, @jupyterlab/translation@npm:^4.0.0, @jupyterlab/translation@npm:^4.2.5": +"@jupyterlab/translation@npm:^3.0.0 || ^4.0.0, @jupyterlab/translation@npm:^4.2.5": version: 4.2.5 resolution: "@jupyterlab/translation@npm:4.2.5" dependencies: @@ -3970,7 +3968,7 @@ __metadata: languageName: node linkType: hard -"@lumino/coreutils@npm:^1.11.0 || ^2.0.0, @lumino/coreutils@npm:^1.11.0 || ^2.1.2, @lumino/coreutils@npm:^1.11.1 || ^2, @lumino/coreutils@npm:^1.11.1 || ^2.1, @lumino/coreutils@npm:^1.5.3 || ^2, @lumino/coreutils@npm:^2.1.0, @lumino/coreutils@npm:^2.1.2, @lumino/coreutils@npm:^2.2.0": +"@lumino/coreutils@npm:^1.11.0 || ^2.0.0, @lumino/coreutils@npm:^1.11.0 || ^2.1.2, @lumino/coreutils@npm:^1.11.1 || ^2, @lumino/coreutils@npm:^1.11.1 || ^2.1, @lumino/coreutils@npm:^1.5.3 || ^2, @lumino/coreutils@npm:^2.1.2, @lumino/coreutils@npm:^2.2.0": version: 2.2.0 resolution: "@lumino/coreutils@npm:2.2.0" dependencies: @@ -5071,7 +5069,7 @@ __metadata: "@jupyterlab/docregistry": ^3 || ^4 || ^5 "@jupyterlab/javascript-extension": ^3 || ^4 "@jupyterlab/markedparser-extension": ^4 - "@jupyterlab/mathjax2-extension": ^4 + "@jupyterlab/mathjax-extension": ^4 "@jupyterlab/notebook": ^3 || ^4 "@jupyterlab/outputarea": ^3 || ^4 "@jupyterlab/rendermime": ^3 || ^4 @@ -6606,6 +6604,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:9.2.0": + version: 9.2.0 + resolution: "commander@npm:9.2.0" + checksum: 7c82e4cd969712aa6d7c055b8351807a7230f9f31ef7ec7881e11a1147511de85adf5d6ccfd200240a118eecf693b220caf6865b8efbcea558a70d35aa9ed711 + languageName: node + linkType: hard + "commander@npm:^10.0.1": version: 10.0.1 resolution: "commander@npm:10.0.1" @@ -8364,6 +8369,13 @@ __metadata: languageName: node linkType: hard +"esm@npm:^3.2.25": + version: 3.2.25 + resolution: "esm@npm:3.2.25" + checksum: 978aabe2de83541c105605a6d60a26ed8e627ef6bb0a7605fe15a95bbdea6b8348bd045255cb22219c054dd09a81a94823df00843d9e97f42419c92015ce3a64 + languageName: node + linkType: hard + "espree@npm:^7.3.0, espree@npm:^7.3.1": version: 7.3.1 resolution: "espree@npm:7.3.1" @@ -11910,6 +11922,18 @@ __metadata: languageName: node linkType: hard +"mathjax-full@npm:^3.2.2": + version: 3.2.2 + resolution: "mathjax-full@npm:3.2.2" + dependencies: + esm: ^3.2.25 + mhchemparser: ^4.1.0 + mj-context-menu: ^0.6.1 + speech-rule-engine: ^4.0.6 + checksum: 6fbccb9338e1fbf686202d924666d79ac9eb658157c1c8102ba018672188978c4cacfb1b6f65adf7d2d51dc79535ff3e32ba86b15e66d3011dda2ab99562d90d + languageName: node + linkType: hard + "mdast-util-from-markdown@npm:^1.3.0": version: 1.3.1 resolution: "mdast-util-from-markdown@npm:1.3.1" @@ -12017,6 +12041,13 @@ __metadata: languageName: node linkType: hard +"mhchemparser@npm:^4.1.0": + version: 4.2.1 + resolution: "mhchemparser@npm:4.2.1" + checksum: 6dd7e3926befc74d26cf7b44b9e5ff7295e142bffc48a60bd225d5a30d525354afb70d23fc4fdb8f46178099ab98a66a57a6131dcb0f410264cfd2b9ad4af4b7 + languageName: node + linkType: hard + "micromark-core-commonmark@npm:^1.0.1": version: 1.1.0 resolution: "micromark-core-commonmark@npm:1.1.0" @@ -12527,6 +12558,13 @@ __metadata: languageName: node linkType: hard +"mj-context-menu@npm:^0.6.1": + version: 0.6.1 + resolution: "mj-context-menu@npm:0.6.1" + checksum: 7a036026538662cac9619b760fade98681618c3ddf417cb36eddb7c28a937baf257c56fd0b6318738419e738ba01a00bcb3790b324885fd6edbae03fb0a2c986 + languageName: node + linkType: hard + "mkdirp-infer-owner@npm:^2.0.0": version: 2.0.0 resolution: "mkdirp-infer-owner@npm:2.0.0" @@ -15234,6 +15272,19 @@ __metadata: languageName: node linkType: hard +"speech-rule-engine@npm:^4.0.6": + version: 4.0.7 + resolution: "speech-rule-engine@npm:4.0.7" + dependencies: + commander: 9.2.0 + wicked-good-xpath: 1.3.0 + xmldom-sre: 0.1.31 + bin: + sre: bin/sre + checksum: e5b8a5878be61d0344d5e9e0327e6bdf25a23de8fb66bd1898719d52b5f12f42b7e11a3387b8f293420c5eaab57b3ed9099be0adcc2132177301e81134612f38 + languageName: node + linkType: hard + "split-on-first@npm:^1.0.0": version: 1.1.0 resolution: "split-on-first@npm:1.1.0" @@ -16964,6 +17015,13 @@ __metadata: languageName: node linkType: hard +"wicked-good-xpath@npm:1.3.0": + version: 1.3.0 + resolution: "wicked-good-xpath@npm:1.3.0" + checksum: 1aa84bd57426aa07f95d7eca0b0410e841b8e7a35248c9404fa235eaf6a0932c811a96cbdc763c3df18ab76c7644fd8e807d8f185146154d3fc6baf554dcc7e3 + languageName: node + linkType: hard + "wide-align@npm:^1.1.0": version: 1.1.5 resolution: "wide-align@npm:1.1.5" @@ -17170,6 +17228,13 @@ __metadata: languageName: node linkType: hard +"xmldom-sre@npm:0.1.31": + version: 0.1.31 + resolution: "xmldom-sre@npm:0.1.31" + checksum: dbd101600a64c1640b06fb2b5c626ce6d909fd40c966fcae84a2b64c708fe466630766173b5760e0275db2a2c542e048b14a2a6568feece2c315f0cd22a2f642 + languageName: node + linkType: hard + "xtend@npm:~4.0.1": version: 4.0.2 resolution: "xtend@npm:4.0.2"