npm.io
0.1.1 • Published 3 years ago

vitepress-markdown-it-repl

Licence
MIT
Version
0.1.1
Deps
2
Size
9 kB
Vulns
5
Weekly
0

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

Keywords