1
"""
2
Defines a custom KaTeX bokeh model to render text using KaTeX.
3
"""
4 7
from bokeh.models import Markup
5

6

7 7
class KaTeX(Markup):
8
    """
9
    A bokeh model that renders text using KaTeX.
10
    """
11

12 7
    __css__ = ["https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css"]
13

14 7
    __javascript__ = [
15
        "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js",
16
        "https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min.js"
17
    ]
18

19 7
    __js_skip__ = {
20
        'katex': __javascript__[:1],
21
        'renderMathInElement': __javascript__[1:]
22
    }
23

24 7
    __js_require__ = {
25
        'paths': {
26
            'katex': 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min',
27
            'autoLoad': 'https://cdn.jsdelivr.net/npm/katex@0.10.1/dist/contrib/auto-render.min'},
28
        'exports': {'katex': 'katex', 'autoLoad': 'renderMathInElement'}
29
    }

Read our documentation on viewing source code .

Loading