brilliant.org如何呈现其数学公式?
How brilliant.org renders its mathematical formulas?
在 Brilliant.org 中,当我们查看页面的源代码时,我们发现它们已经在服务器上呈现了它们的数学公式。例如:
页数:https://brilliant.org/practice/distributive-property-misconceptions/
来源:查看来源:https://brilliant.org/practice/distributive-property-misconceptions/
但据我所知,当我们使用 MathJax 渲染公式时,我们应该以原始格式传递它们,然后它会在客户端渲染。如果我们给 MathJax 渲染的公式,它会抛出很多错误来重新渲染它们。
那么,brilliant.org 如何在服务器端呈现公式?
Brilliant.org 使用 Katex 库来呈现数学公式。 Katex 提供 server-side 和 client-side 渲染。据我所知,Brilliant 在服务器端渲染比在 client-side.
上渲染效率更高
有几个现成的所见即所得编辑器集成了 Katex 库。其中之一是 https://quilljs.com/。当您输入公式时,它会呈现到 HTML 编辑器中。
在 Brilliant.org 中,当我们查看页面的源代码时,我们发现它们已经在服务器上呈现了它们的数学公式。例如:
页数:https://brilliant.org/practice/distributive-property-misconceptions/
来源:查看来源:https://brilliant.org/practice/distributive-property-misconceptions/
但据我所知,当我们使用 MathJax 渲染公式时,我们应该以原始格式传递它们,然后它会在客户端渲染。如果我们给 MathJax 渲染的公式,它会抛出很多错误来重新渲染它们。
那么,brilliant.org 如何在服务器端呈现公式?
Brilliant.org 使用 Katex 库来呈现数学公式。 Katex 提供 server-side 和 client-side 渲染。据我所知,Brilliant 在服务器端渲染比在 client-side.
上渲染效率更高有几个现成的所见即所得编辑器集成了 Katex 库。其中之一是 https://quilljs.com/。当您输入公式时,它会呈现到 HTML 编辑器中。