Skip to content

Commit

Permalink
Mathjax typesetter was separated out
Browse files Browse the repository at this point in the history
  • Loading branch information
vidartf committed Oct 5, 2018
1 parent d6bd80a commit 15034f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
12 changes: 2 additions & 10 deletions nbdime/webapp/nbdimeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def base_args(self):
'closable': self.params.get('closable', False),
'savable': fn is not None,
'baseUrl': self.nbdime_base_url,
'mathjaxUrl': self.mathjax_url,
'mathjaxConfig': self.mathjax_config,
}
if fn:
# For reference, e.g. if user wants to download file
Expand Down Expand Up @@ -135,8 +137,6 @@ def get(self):
args['remote'] = self.get_argument('remote', '')
self.write(self.render_template('compare.html',
config_data=args,
mathjax_url=self.mathjax_url,
mathjax_config=self.mathjax_config,
))


Expand All @@ -148,8 +148,6 @@ def get(self):

self.write(self.render_template('diff.html',
config_data=args,
mathjax_url=self.mathjax_url,
mathjax_config=self.mathjax_config,
))


Expand All @@ -172,8 +170,6 @@ def get(self):
args['remote'] = self.get_argument('remote', '')
self.write(self.render_template('difftool.html',
config_data=args,
mathjax_url=self.mathjax_url,
mathjax_config=self.mathjax_config,
))


Expand All @@ -185,8 +181,6 @@ def get(self):
args['remote'] = self.get_argument('remote', '')
self.write(self.render_template('merge.html',
config_data=args,
mathjax_url=self.mathjax_url,
mathjax_config=self.mathjax_config,
))


Expand All @@ -203,8 +197,6 @@ def get(self):
args['remote'] = self.get_argument('remote', '')
self.write(self.render_template('mergetool.html',
config_data=args,
mathjax_url=self.mathjax_url,
mathjax_config=self.mathjax_config,
))


Expand Down
2 changes: 1 addition & 1 deletion packages/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"@jupyterlab/application": "^0.18.4",
"@jupyterlab/mathjax2-extension": "^0.6.4",
"@jupyterlab/mathjax2": "^0.7.1",
"@jupyterlab/apputils": "^0.18.4",
"@jupyterlab/cells": "^0.18.4",
"@jupyterlab/codemirror": "^0.18.4",
Expand Down
11 changes: 9 additions & 2 deletions packages/webapp/src/app/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ import {
defaultSanitizer
} from '@jupyterlab/apputils';

import {
PageConfig
} from '@jupyterlab/coreutils';

import {
MathJaxTypesetter
} from '@jupyterlab/mathjax2-extension';
} from '@jupyterlab/mathjax2';

import {
IDiffEntry
Expand Down Expand Up @@ -84,7 +88,10 @@ function showDiff(data: {base: nbformat.INotebookContent, diff: IDiffEntry[]}):
let rendermime = new RenderMimeRegistry({
initialFactories: rendererFactories,
sanitizer: defaultSanitizer,
latexTypesetter: new MathJaxTypesetter(),
latexTypesetter: new MathJaxTypesetter({
url: getConfigOption('mathjaxUrl'),
config: getConfigOption('mathjaxConfig'),
}),
});

let nbdModel = new NotebookDiffModel(data.base, data.diff);
Expand Down

0 comments on commit 15034f6

Please sign in to comment.