gitbook 插件安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hiwoshixiaoyu/article/details/89305063

book.json

{
  "title": "gitbook tutorial",
  "description": "Webpack 是当下最热门的前端资源模块化管理和打包工具,本书大部分内容翻译自 Webpack 官网。",
  "structure": {
    "readme": "README.md"
  },
  "links": {
    "gitbook": false,
    "sharing": {
      "google": false,
      "facebook": false,
      "twitter": false,
      "all": false
    }
  },

  "plugins": ["disqus","advanced-emoji"],
  "pluginsConfig": {
    "disqus": {
        "shortName": "gitbookuse"
    }
  }
}

安装命令

gitbook install ./

安装其它插件


  "plugins" : [
        "simple-page-toc"
    ],
    "pluginsConfig": {
        "simple-page-toc": {
            "maxDepth": 3,
            "skipFirstH1": true
        }
    }

常用插件

见官网
https://docs.gitbook.com/v2-changes/important-differences

配置一个比较全的demo

{
    "author": "xiaoyu",
    "description": "...",
    "extension": null,
    "generator": "site",
    "title": "CSM GitBook",
    "variables": {},
    "links": {
        "sharing": {
            "all": null,
            "facebook": null,
            "google": null,
            "twitter": null,
            "weibo": null
        },
        "sidebar": {
          "Go to CSM": "https:baidu.com/"
        }
    },
    "output": null,
    "pdf": {
        "fontSize": 12,
        "footerTemplate": null,
        "headerTemplate": null,
        "margin": {
            "bottom": 36,
            "left": 62,
            "right": 62,
            "top": 36
        },
        "pageNumbers": false,
        "paperSize": "a4"
    },
    "plugins": [
        "-livereload",
        "theme-comscore",
        "-lunr", "-search","search-plus@^0.0.11",
        "simple-page-toc@^0.1.1",
        "prism@^2.1.0",
        "prism-themes@^0.0.2",
        "advanced-emoji@^0.2.1",
        "anchors@^0.7.1",
        "include-codeblock@^3.0.2",
        "ace@^0.3.2",
        "emphasize@^1.1.0",
        "katex@^1.1.3",
        "splitter@^0.0.8",
        "[email protected]",
        "tbfed-pagefooter@^0.0.1",
        "expandable-chapters-small@^0.1.7",
        "donate@^1.0.2",
        "favicon@^0.0.2",
        "todo@^0.1.3",
        "terminal@^0.3.2",
        "alerts@^0.2.0",
        "include-csv@^0.1.0",
        "markdown-video",
        "anchor-navigation-ex",
        "embed-pdf",
        "chart@^0.2.0"
    ],
    "pluginsConfig": {
        "theme-default": {
            "showLevel": true
        },
        "prism": {
            "css": [
                "prism-themes/themes/prism-base16-ateliersulphurpool.light.css"
            ]
        },
        "include-codeblock": {
            "template": "ace",
            "unindent": true,
            "edit": true
        },
        "tbfed-pagefooter": {
            "copyright": "Copyright © 项目组 2018",
            "modify_label": "该文件修订时间:",
            "modify_format": "YYYY-MM-DD HH:mm:ss"
        },
        "donate": {
            "wechat": "./pics/pay.jpg",
            "title": "",
            "button": "赏",
            "wechatText": "微信打赏"
        },
        "simple-page-toc": {
            "maxDepth": 3,
            "skipFirstH1": true
        },
        "sectionx": {
            "tag": "b"
        },
        "favicon": {
            "shortcut": "favicon.ico",
            "bookmark": "favicon.ico"
        },
        "terminal": {
            "copyButtons": true,
            "fade": false,
            "style": "flat"
        }
    }
}

[插件列表 查看]
摘自 GitBook插件整理
https://www.jianshu.com/p/427b8bb066e6

猜你喜欢

转载自blog.csdn.net/hiwoshixiaoyu/article/details/89305063