0.2.3 • Published 4 years ago

@ly2837/markdown-it-latex v0.2.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

markdown-it-latex

Plugin for markdown-it, supports KaTex and AsciiMath.

Installation

yarn add markdown-it-latex

Usage

for node.js

import markdownIt from 'markdown-it'
import markdownItLatex from 'markdown-it-latex'
const mdi = markdownIt()
mdi.use(markdownItLatex)
mdi.render('`$E = mc^2$`')
mdi.render('`@(1/2[1-(1/2)^n])/(1-(1/2))=s_n@`')
mdi.render(`\`\`\`math
\oint_C x^3\, dx + 4y^2\, dy
\`\`\``)
mdi.render(`\`\`\`AsciiMath
oint_Cx^3 dx+4y^2 dy
\`\`\``)

for browser

You also need to import the css:

import 'markdown-it-latex/dist/index.css'

Or you can add the css to the web page directly.

Development

Build

yarn build:watch

Test

yarn test

Distribution

yarn release && npm publish

Todo

The difference from original

  • translate => to function

    because my nuxt app report TypeError: plugin.apply is not a function

  • update katex to 0.11.1

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago