@yozora/html-math
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.2 • Public • Published

@yozora/html-math


This component is for rendering the Yozora Markdown AST node IMath produced by @yozora/tokenizer-math into HTML string.

This component has been built into [@yozora/html-markdown][], you can use it directly.

Install

  • npm

    npm install --save @yozora/html-math
  • yarn

    yarn add @yozora/html-math

Usage

  • Basic:

    import type { IMath } from '@yozora/ast'
    import renderMath from '@yozora/html-math'
    
    const math: IMath = { "type": "math", "value": "$$x^2 + y^2 = z^2$$" }
    renderMath(math)
    // => <div class="yozora-math">$$x^2 + y^2 = z^2$$</div>

Related

Package Sidebar

Install

npm i @yozora/html-math

Weekly Downloads

2

Version

2.0.0-alpha.2

License

MIT

Unpacked Size

6.33 kB

Total Files

6

Last publish

Collaborators

  • lemonclown