最新消息:20210917 已从crifan.com换到crifan.org

【已解决】gitbook中安装multipart插件

gitbook crifan 4135浏览 0评论

折腾:

【部分解决】Gitbook中添加多章节且希望一级章节也显示编号

期间,参考:

编辑书籍 | GitBook 简明教程

multipart | GitBook 简明教程

-》

gitbook-plugin-multipart

去安装试试:

➜  htttp_summary git:(master) npm install gitbook-plugin-multipart -g

npm WARN deprecated CSSselect@0.4.1: the module is now available as ‘css-select’

npm WARN deprecated CSSwhat@0.4.7: the module is now available as ‘css-what’

+ gitbook-plugin-multipart@0.3.0

added 19 packages in 2.757s

然后:

book.json中配置:

  “plugins”: [

    “-search”,

    “multipart”

  ],

结果:

➜  htttp_summary git:(master) gitbook serve

Live reload server started on port: 35729

Press CTRL+C to quit …

info: 7 plugins are installed

Error: Couldn’t locate plugins “multipart”, Run ‘gitbook install’ to install plugins from registry.

➜  htttp_summary git:(master) ✗ gitbook install multipart

info: nothing to install!

也去看了看help:

➜  htttp_summary git:(master) gitbook help

    build [book] [output]       build a book

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

        –format                Format to build to (Default is website; Values are website, json, ebook)

        –[no-]timing           Print timing debug information (Default is false)

    serve [book] [output]       serve the book as a website for testing

        –port                  Port for server to listen on (Default is 4000)

        –lrport                Port for livereload server to listen on (Default is 35729)

        –[no-]watch            Enable file watcher and live reloading (Default is true)

        –[no-]live             Enable live reloading (Default is true)

        –[no-]open             Enable opening book in browser (Default is false)

        –browser               Specify browser for opening book (Default is )

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

        –format                Format to build to (Default is website; Values are website, json, ebook)

    install [book]              install all plugins dependencies

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

    parse [book]                parse and print debug information about a book

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

    init [book]                 setup and create files for chapters

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

    pdf [book] [output]         build a book into an ebook file

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

    epub [book] [output]        build a book into an ebook file

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

    mobi [book] [output]        build a book into an ebook file

        –log                   Minimum log level to display (Default is info; Values are debug, info, warn, error, disabled)

继续参考:

插件 | GitBook文档(中文版)

去在book.json中配置好的情况,直接:

gitbook install

试试

➜  htttp_summary git:(master) gitbook install

info: installing 1 plugins using npm@3.9.2

info:

info: installing plugin “multipart”

info: install plugin “multipart” (*) from NPM with version 0.3.0

/Users/crifan/GitBook/Library/Import/htttp_summary

└─┬ gitbook-plugin-multipart@0.3.0

  └─┬ cheerio@0.17.0

    ├─┬ CSSselect@0.4.1

    │ ├── CSSwhat@0.4.7

    │ └── domutils@1.4.3

    ├─┬ dom-serializer@0.0.1

    │ └── domelementtype@1.1.3

    ├── entities@1.1.1

    ├─┬ htmlparser2@3.7.3

    │ ├── domelementtype@1.3.0

    │ ├── domhandler@2.2.1

    │ ├── domutils@1.5.1

    │ ├── entities@1.0.0

    │ └─┬ readable-stream@1.1.14

    │   ├── core-util-is@1.0.2

    │   ├── inherits@2.0.3

    │   ├── isarray@0.0.1

    │   └── string_decoder@0.10.31

    └── lodash@2.4.2

info: >> plugin “multipart” installed with success

果然可以了。

然后再去看看multipart的效果

问题依旧。

【总结】

此处安装gitbook的multipart插件的方法是:

1.先去book.json中配置加上

<code>  "plugins": [
    "multipart"
</code>

  ]

2.再去gitbook install即可安装

安装完成会显示:

info: >> plugin “multipart” installed with success

转载请注明:在路上 » 【已解决】gitbook中安装multipart插件

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
92 queries in 0.184 seconds, using 23.34MB memory