📦 theme-live-codeblock
这个主题提供了一个 @theme/CodeBlock
组件,该组件基于 react-live 构建。您可以在 交互式代码编辑器 章节查阅相关文档。
- npm
- Yarn
- pnpm
npm install --save @docusaurus/theme-live-codeblock
yarn add @docusaurus/theme-live-codeblock
pnpm add @docusaurus/theme-live-codeblock
配置
docusaurus.config.js
export default {
plugins: ['@docusaurus/theme-live-codeblock'],
themeConfig: {
liveCodeBlock: {
/**
* The position of the live playground, above or under the editor
* Possible values: "top" | "bottom"
*/
playgroundPosition: 'bottom',
},
},
};