show and run codeblock in vuepress
vuepress 1.x
npm i vuepress-plugin-run-codeblock
in [..your vuepress project..]/docs/.vuepress/config.js
set:
...
plugins: [
[require('vuepress-plugin-run-codeblock')],
],
...
- base
::: run
```js
console.log('js')
```
:::
you can click the button to run the code
- show file name
::: run file/lib/index.js
```js
console.log('js')
```
:::
- use in another container
:::: details Click me to view the code
::: run
```js
console.log('js')
```
:::
::::
see: markdown-it-container/issues
the api was supported by https://wandbox.org/