目录

theme-live-codeblock

优质
小牛编辑
114浏览
2023-12-01

这个主题提供了一个 @theme/CodeBlock 组件,该组件基于 react-live 构建。您可以在 交互式代码编辑器 章节查阅相关文档。

  • npm
  • Yarn
npm install --save @docusaurus/theme-live-codeblock
yarn add @docusaurus/theme-live-codeblock

配置

docusaurus.config.js
module.exports = {
  plugins: ['@docusaurus/theme-live-codeblock'],
  themeConfig: {
    liveCodeBlock: {
      /**
       * The position of the live playground, above or under the editor
       * Possible values: "top" | "bottom"
       */
      playgroundPosition: 'bottom',
    },
  },
};