vitepress-markdown-it-repl
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

itcatplayit/vitepress-markdown-it-repl

npm license

repl display for markdown-it plugin in vitepress project.

Install

npm i vitepress-markdown-it-repl

Usage

in your vitepress project's .vitepress/config.ts file:

import { defineConfig } from 'vitepress'
import { default as replPlugin } from 'vitepress-markdown-it-repl';

export default defineConfig({
  // ...
  markdown: {
    lineNumbers: true, // or false
    // set globalEnabledLineNumbers's value same as lineNumbers above.
    config: md => md.use(replPlugin, { globalEnabledLineNumbers: true })
  },
  // ...
})

then, in your markdown file, you can use as this:

it will display repl symbol:

default Options

option default value
globalEnabledLineNumbers false
symbol '$'
leftDelimiter '$('
rightDelimiter ')'

unusual code block

when you set a global symbol like '$', but some unusual code block, you want a symbol like '#', how?

```bash $(1#)
echo a b
```

Package Sidebar

Install

npm i vitepress-markdown-it-repl

Weekly Downloads

4

Version

0.1.1

License

MIT

Unpacked Size

9.06 kB

Total Files

6

Last publish

Collaborators

  • itcatplayit