0.1.1 • Published 11 months ago
vitepress-markdown-it-repl v0.1.1
itcatplayit/vitepress-markdown-it-repl
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
```