胶乳侧伺服型
pelican-katex的Python项目详细描述
鹈鹕服务器端乳胶排版
这个插件将自己直接挂接到docutils的structuredtext解析器中 使用KaTeX呈现数学角色和块,同时 建立你的博客。因此,您不需要发送KaTeX javascript 实现与您的网站,以及提高可访问性 作为你上网的时间
有关演示,请访问此blog post。注意所有 公式就在那里。没有加载,网站甚至没有 提供katex的javascript部分。
安装
首先,您需要安装nodejs
,以便pelican-katex
可以运行
凯特克斯。然后运行pip install pelican-katex
,并将"pelican_katex"
添加到
PlUGINS
在配置文件中设置。最后,删除katex.js
<script>
从您的模板中标记,享受更轻松的网站和即时服务
公式
配置
该插件提供了几个配置选项,您可以在
pelicanconf.py
。
# nodejs binary path or command to run KaTeX with.# KATEX_NODEJS_BINARY = "node"# Path to the katex file to use. This project comes with version `0.10` of# katex but if you want to use a different one you can overwrite the path# here. To use a katex npm installation, set this to `"katex"`.# KATEX_PATH = "/path/to/katex.js"# By default, this plugin will redefine reStructuredText's `math` role and# directive. However, if you prefer to have leave the docutil's defaults# alone, you can use this to define a `katex` role for example.# KATEX_DIRECTIVE = "katex"# Time budget in seconds per call to the rendering engine. 1 second should# be plenty since most renderings take less than 50ms.# KATEX_TIMEOUT = 1.0# Here you can pass a dictionary of default options that you want to run# KaTeX with. All possible options are listed on KaTeX's options page,# https://katex.org/docs/options.html.# KATEX = {# # Abort the build instead of coloring broken math in red# "throwOnError": True# }