Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arcticlampyrid/hexo-filter-katex
Server side Math Expression Renderer for Hexo, powered by KaTeX.
https://github.com/arcticlampyrid/hexo-filter-katex
Last synced: about 19 hours ago
JSON representation
Server side Math Expression Renderer for Hexo, powered by KaTeX.
- Host: GitHub
- URL: https://github.com/arcticlampyrid/hexo-filter-katex
- Owner: ArcticLampyrid
- License: mit
- Created: 2022-04-21T03:22:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-15T15:28:27.000Z (over 2 years ago)
- Last Synced: 2024-08-09T15:52:50.313Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## hexo-filter-katex
[![npm-image]][npm-url]
[![license-image]](LICENSE)
Server side Math Expression Renderer for Hexo, powered by [KaTeX](https://katex.org/).## Examples
```markdown
## Inline
$ \frac{b^2+c^2-a^2} $
## Block
$$
\cos A = \frac{b^2+c^2-a^2}{2bc} = \frac{(b+c)^2-a^2-2bc}{2bc}
$$
```## Config
The plugin works perfectly out of the box.
Though, you can config it to adapt to your preferences.
```yaml
katex:
render_options:
# See https://katex.org/docs/options.html for more details
# Note that `displayMode` is implicitly enabled for Math Block but disabled for Inline Math.# output: htmlAndMathml
# strict: false
# trust: true
stylesheet_fragment: '' # A HTML fragment injected right before for stylesheet
```## Compatibility
Even when you are using a math-unaware Markdown Renderer (eg. marked), additional escaping is not necessary.
The plugin ensures that all math expressions are not interpreted as Markdown syntax.Note that the tag `_internal_math_placeholder` will be used internally, and you need to ensure that it is not used elsewhere.
[npm-image]: https://img.shields.io/npm/v/hexo-filter-katex?style=flat-square
[license-image]: https://img.shields.io/npm/l/hexo-filter-katex?style=flat-square
[npm-url]: https://www.npmjs.com/package/hexo-filter-katex