Skip to content

Commit 4a4a6b5

Browse files
committed
Update mkdocstrings. Replace polyfill.io as CDN for mathjax.
1 parent 6a275b0 commit 4a4a6b5

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

docs/javascripts/mathjax.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
window.MathJax = {
2-
tex: {
3-
inlineMath: [["\\(", "\\)"]],
4-
displayMath: [["\\[", "\\]"]],
5-
processEscapes: true,
6-
processEnvironments: true
7-
},
8-
options: {
9-
ignoreHtmlClass: ".*|",
10-
processHtmlClass: "arithmatex"
11-
}
2+
tex: {
3+
inlineMath: [["\\(", "\\)"]],
4+
displayMath: [["\\[", "\\]"]],
5+
processEscapes: true,
6+
processEnvironments: true
7+
},
8+
options: {
9+
ignoreHtmlClass: ".*|",
10+
processHtmlClass: "arithmatex"
11+
}
1212
};
1313

1414
document$.subscribe(() => {
15+
MathJax.startup.output.clearCache()
16+
MathJax.typesetClear()
17+
MathJax.texReset()
1518
MathJax.typesetPromise()
16-
})
19+
})

mkdocs.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ plugins:
5252
# show_root_full_path: no
5353

5454
markdown_extensions:
55+
# https://squidfunk.github.io/mkdocs-material/reference/math/?h=math#mathjax
5556
- pymdownx.arithmatex:
5657
generic: true
5758
- pymdownx.superfences
@@ -64,7 +65,5 @@ extra_css:
6465
- stylesheets/style.css
6566

6667
extra_javascript:
67-
# math support, https://squidfunk.github.io/mkdocs-material/reference/mathjax/
68-
# - javascripts/mathjax.js # when enabled, formulas come with a vertical scrollbar
69-
- https://polyfill.io/v3/polyfill.min.js?features=es6
70-
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
68+
- javascripts/mathjax.js
69+
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def get_version():
4848
"docs": [
4949
"mkdocs",
5050
"mkdocs-material",
51-
"mkdocstrings>=0.18",
52-
"mkdocstrings-python-legacy",
51+
"mkdocstrings[python]",
5352
],
5453
},
5554
)

0 commit comments

Comments
 (0)