vitepress-markdown-it-repl

repl display for markdown-it plugin in vitepress project.


Keywords
markdown-it, markdown-it-plugin, vue, vitepress, repl
License
MIT
Install
npm install vitepress-markdown-it-repl@0.1.1

Documentation

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
```