0.5.5 • Published 1 year ago

@widcardw/markdown-it-asciimath v0.5.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

markdown-it-asciimath

NPM version

Render asciimath formulas within markdown. Based on asciimath-parser and katex.

Install

npm i -D katex @widcardw/markdown-it-asciimath

Usage

Don't forget to add style to your CSS entry.

@import 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.15.3/katex.min.css';
/* or you can use the css within the KaTeX package */

Then you can attach it to markdown-it.

import AmIt from '@widcardw/markdown-it-asciimath'
import MarkdownIt from 'markdown-it'

const md = new MarkdownIt()
md.use(AmIt, {
  /**
   * (Optional, @default ['asciimath', 'am'] )
   *
   * To recognize codeblocks written with syntax of asciimath
   * You can add other alias like `math` and so on
   */
  block: ['asciimath', 'am', 'math'],
  /**
   * (Optional @default { open: '``', close: '``' } )
   *
   * To recognize formulas like ``x/y``
   */
  inline: {
    open: '``',
    close: '``'
  },
  /**
   * (Optional @default false )
   *
   * Whether to enable original Katex (wrapped with `$` for inline and `$$` for block).
   * When enabled, you do not have to install another plugin `markdown-it-new-katex`.
   */
  enableOriginalKatex: true
})

License

MIT License © 2022 widcardw

0.5.5-beta.0

1 year ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.5

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago