File tree Expand file tree Collapse file tree 3 files changed +19
-17
lines changed
share/jupyter/voila/templates/base/static Expand file tree Collapse file tree 3 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ export {
18
18
EditorLanguageRegistry
19
19
} from '@jupyterlab/codemirror' ;
20
20
21
+ export { PageConfig } from '@jupyterlab/coreutils' ;
22
+
21
23
export { MathJaxTypesetter } from '@jupyterlab/mathjax2-extension' ;
22
24
23
25
export { createMarkdownParser } from '@jupyterlab/markedparser-extension' ;
Original file line number Diff line number Diff line change @@ -71,22 +71,6 @@ if (typeof window !== 'undefined' && typeof window.define !== 'undefined') {
71
71
window . define ( '@lumino/domutils' , LuminoDomutils ) ;
72
72
}
73
73
74
- const [ urlParam , configParam ] = [ 'fullMathjaxUrl' , 'mathjaxConfig' ] ;
75
- const url = CoreUtils . PageConfig . getOption ( urlParam ) ;
76
- const config = CoreUtils . PageConfig . getOption ( configParam ) ;
77
- if ( url !== 'null' || config !== 'null' ) {
78
- CoreUtils . PageConfig . setOption (
79
- urlParam ,
80
- url === 'null'
81
- ? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js'
82
- : url
83
- ) ;
84
- CoreUtils . PageConfig . setOption (
85
- configParam ,
86
- config === 'null' ? 'TeX-AMS_CHTML-full,Safe' : config
87
- ) ;
88
- }
89
-
90
74
const WIDGET_MIMETYPE = 'application/vnd.jupyter.widget-view+json' ;
91
75
92
76
/**
Original file line number Diff line number Diff line change @@ -44,9 +44,25 @@ require([window.voila_js_url || 'static/voila'], function(voila) {
44
44
45
45
const languages = new voila . EditorLanguageRegistry ( ) ;
46
46
47
+ const [ urlParam , configParam ] = [ 'fullMathjaxUrl' , 'mathjaxConfig' ] ;
48
+ const url = voila . PageConfig . getOption ( urlParam ) ;
49
+ const config = voila . PageConfig . getOption ( configParam ) ;
50
+ if ( url !== 'null' || config !== 'null' ) {
51
+ voila . PageConfig . setOption (
52
+ urlParam ,
53
+ url === 'null'
54
+ ? 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js'
55
+ : url
56
+ ) ;
57
+ voila . PageConfig . setOption (
58
+ configParam ,
59
+ config === 'null' ? 'TeX-AMS_CHTML-full,Safe' : config
60
+ ) ;
61
+ }
62
+
47
63
const rendermime = new voila . RenderMimeRegistry ( {
48
64
initialFactories : voila . extendedRendererFactories ,
49
- latexTypesetter : new voila . MathJaxTypesetter ( ) ,
65
+ latexTypesetter : new voila . MathJaxTypesetter ( { url : voila . PageConfig . getOption ( urlParam ) , config : voila . PageConfig . getOption ( configParam ) } ) ,
50
66
markdownParser : voila . createMarkdownParser ( languages )
51
67
} ) ;
52
68
You can’t perform that action at this time.
0 commit comments