最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

【记录】gitbook升级到新版本

gitbook crifan 1390浏览 0评论

折腾:

【记录】gitbook换用更好看的hint callout提示

期间,去升级新版试试,看看是否支持好看的hint:

并且:

What is new? – GitBook

“Learn what is new, and what no longer exists, compared to the previous version of GitBook at legacy.gitbook.com

指的是:

之前gitbook的book都放在了:

legacy.gitbook.com

现在升级新版了,换了地址了。

What is GitBook – GitBook

“This is the documentation for the new version of the GitBook platform.”

Custom Domains – GitBook

新地址看起来是:

https://docs.gitbook.com

-》上面好看的hint只是:

https://docs.gitbook.com

上的效果。

不是gitbook的CLI命令行工具所支持的。

另外:

https://docs.gitbook.com/what-is-new/important-differences#cli-toolchain

“We have moved away from the static site generator model, and no longer use the famous gitbook CLI to build documentation output.”

https://github.com/GitbookIO/gitbook

已经不用这个gitbook命令行工具了。。。

而之前无意间看到有人讨论:

Is GitBook still alive? · Issue #1808 · GitbookIO/gitbook

好像最近gitbook都不更新了。。。

难道没人维护了?

“* Editor now natively supports editing rich content (hints, embeds, api methods, …), no longer requires a templating syntax !”

新版的Editor编辑器(web版的?还是桌面端的?)

-》打开:

https://beta.gitbook.com/

也会自动跳转到:

GitBook

https://www.gitbook.com

看来是新版升级好了:

GitbookIO/gitbook: 📝 Modern documentation format and toolchain using Git and Markdown

看了下,最新一次commit是2个月前 -》 说明还是alive的

Plugins · GitBook Toolchain Documentation

Installation and Setup · GitBook Toolchain Documentation

先看看当前版本:

<code>➜  Import gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3
➜  Import which gitbook
/usr/local/bin/gitbook
</code>

去升级一下gitbook

<code>➜  Import npm install gitbook-cli -g
/Users/crifan/.nvm/versions/node/v10.4.0/bin/gitbook -&gt; /Users/crifan/.nvm/versions/node/v10.4.0/lib/node_modules/gitbook-cli/bin/gitbook.js
+ gitbook-cli@2.3.2
added 578 packages from 672 contributors in 13.818s
➜  Import which gitbook
/usr/local/bin/gitbook
➜  Import gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3
</code>

结果好像没有更新。

打算重新去下载gibbook的editor

不过看到了,可以安装新beta版本:

<code>➜  Import gitbook ls-remote
Available GitBook Versions:

     4.0.0-alpha.6, 4.0.0-alpha.5, 4.0.0-alpha.4, 4.0.0-alpha.3, 4.0.0-alpha.2, 4.0.0-alpha.1, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.2.0-pre.1, 3.2.0-pre.0, 3.1.1, 3.1.0, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 3.0.0-pre.15, 3.0.0-pre.14, 3.0.0-pre.13, 3.0.0-pre.12, 3.0.0-pre.11, 3.0.0-pre.10, 3.0.0-pre.9, 3.0.0-pre.8, 3.0.0-pre.7, 3.0.0-pre.6, 3.0.0-pre.5, 3.0.0-pre.4, 3.0.0-pre.3, 3.0.0-pre.2, 3.0.0-pre.1, 2.6.7, 2.6.6, 2.6.5, 2.6.4, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.5.2, 2.5.1, 2.5.0, 2.5.0-beta.7, 2.5.0-beta.6, 2.5.0-beta.5, 2.5.0-beta.4, 2.5.0-beta.3, 2.5.0-beta.2, 2.5.0-beta.1, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.0, 2.1.0, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 2.0.0-beta.5, 2.0.0-beta.4, 2.0.0-beta.3, 2.0.0-beta.2, 2.0.0-beta.1, 2.0.0-alpha.9, 2.0.0-alpha.8, 2.0.0-alpha.7, 2.0.0-alpha.6, 2.0.0-alpha.5, 2.0.0-alpha.4, 2.0.0-alpha.3, 2.0.0-alpha.2, 2.0.0-alpha.1

Tags:

     latest : 3.2.3
     pre : 4.0.0-alpha.6

➜  Import gitbook fetch beta

Error: Invalid version or tag "beta", see available using "gitbook ls-remote"
➜  Import gitbook fetch 4.0.0-alpha.6
Installing GitBook 4.0.0-alpha.6
[fsevents] Success: "/private/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tmp-25444JRjdwNavof3d/node_modules/gitbook/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
[fsevents] Success: "/private/var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tmp-25444JRjdwNavof3d/node_modules/gitbook/node_modules/nunjucks/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
gitbook@4.0.0-alpha.6 ../../../../../var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tmp-25444JRjdwNavof3d/node_modules/gitbook
├── escape-html@1.0.3
├── destroy@1.0.4
├── bash-color@0.0.4
├── escape-string-regexp@1.0.5
├── ignore@3.1.2
├── gitbook-plugin-livereload@4.0.0-alpha.6
├── github-slugid@1.0.1
├── spawn-cmd@0.0.2
├── is@3.2.1
├── cp@0.2.0
├── graceful-fs@4.1.4
├── object-path@0.9.2
├── direction@0.1.5
├── extend@3.0.1
├── open@0.0.5
├── q@1.4.1
├── json-schema-defaults@0.1.1
├── gitbook-plugin-sharing@4.0.0-alpha.6
├── crc@3.4.0
├── jsonschema@1.1.0
├── immutable@3.8.2
├── urijs@1.18.0
├── semver@5.1.0
├── front-matter@2.3.0
├── dom-serializer@0.1.0 (domelementtype@1.1.3, entities@1.1.1)
├── gitbook-plugin-headings@4.0.0-alpha.6 (classnames@2.2.6)
├── gitbook-plugin-hints@4.0.0-alpha.6 (classnames@2.2.6)
├── omit-keys@0.1.0 (isobject@0.2.0, array-difference@0.0.1)
├── error@7.0.2 (string-template@0.2.1, xtend@4.0.1)
├── send@0.13.2 (range-parser@1.0.3, etag@1.7.0, statuses@1.2.1, fresh@0.3.0, ms@0.7.1, debug@2.2.0, depd@1.1.2, mime@1.3.4, http-errors@1.3.1, on-finished@2.3.0)
├── tmp@0.0.28 (os-tmpdir@1.0.2)
├── gitbook-plugin-copy-code@4.0.0-alpha.6 (copy-to-clipboard@3.0.8)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── rmdir@1.2.0 (node.flow@1.2.3)
├── resolve@1.1.7
├── fresh-require@1.0.3 (is-require@0.0.1, shallow-copy@0.0.1, sleuth@0.1.1, astw@1.3.0, through2@0.6.5, escodegen@1.10.0, acorn@0.9.0)
├── cpr@1.1.1 (rimraf@2.4.5)
├── gitbook-plugin-theme-default@4.0.0-alpha.6 (debounce@1.1.0)
├── tiny-lr@0.2.1 (parseurl@1.3.2, livereload-js@2.3.0, qs@5.1.0, debug@2.2.0, body-parser@1.14.2, faye-websocket@0.10.0)
├── js-yaml@3.12.0 (esprima@4.0.0, argparse@1.0.10)
├── read-installed@4.0.3 (debuglog@1.0.1, util-extend@1.0.3, slide@1.1.6, readdir-scoped-modules@1.0.2, read-package-json@2.0.13)
├── gitbook-plugin-lunr@4.0.0-alpha.6 (html-entities@1.2.0, lunr@0.5.12)
├── asciidoctor.js@1.5.6 (opal-runtime@1.0.3)
├── gitbook-plugin-highlight@4.0.0-alpha.6 (highlight.js@9.7.0)
├── moment@2.13.0
├── chokidar@1.5.0 (path-is-absolute@1.0.1, async-each@1.0.1, inherits@2.0.3, glob-parent@2.0.0, is-glob@2.0.1, is-binary-path@1.0.1, readdirp@2.1.0, anymatch@1.3.2, fsevents@1.2.4)
├── nunjucks@2.5.2 (asap@2.0.6, yargs@3.32.0, chokidar@1.7.0)
├── juice@2.0.0 (deep-extend@0.4.2, slick@1.12.2, batch@0.5.3, cssom@0.3.1, commander@2.9.0, cross-spawn-async@2.2.5, web-resource-inliner@2.0.0)
├── i18n-t@1.0.1 (lodash@4.17.10)
├── cheerio@0.20.0 (entities@1.1.1, css-select@1.2.0, htmlparser2@3.8.3, jsdom@7.2.2, lodash@4.17.10)
├── redux@3.7.2 (symbol-observable@1.2.0, loose-envify@1.3.1, lodash-es@4.17.10, lodash@4.17.10)
├── gitbook-plugin-search@4.0.0-alpha.6 (react@15.6.2)
├── request@2.72.0 (aws-sign2@0.6.0, tunnel-agent@0.4.3, oauth-sign@0.8.2, forever-agent@0.6.1, is-typedarray@1.0.0, caseless@0.11.0, stringstream@0.0.6, isstream@0.1.2, aws4@1.7.0, json-stringify-safe@5.0.1, tough-cookie@2.2.2, node-uuid@1.4.8, qs@6.1.2, combined-stream@1.0.6, mime-types@2.1.18, bl@1.1.2, hawk@3.1.3, http-signature@1.1.1, har-validator@2.0.6, form-data@1.0.1)
├── ied@2.3.6 (lodash.memoize@4.1.2, lodash.frompairs@4.0.1, force-symlink@0.0.2, semver@5.5.0, node-uuid@1.4.8, minimist@1.2.0, npm-package-arg@4.2.1, source-map-support@0.4.18, ora@0.2.3, rimraf@2.6.2, easy-table@1.1.1, init-package-json@1.10.3, tar-fs@1.16.2, needle@1.0.0, gunzip-maybe@1.4.1, node-gyp@3.7.0, node-pre-gyp@0.6.39, rxjs@5.0.0-rc.1)
├── gitbook-core@4.0.0-alpha.6 (whatwg-fetch@1.1.1, react-addons-css-transition-group@15.4.1, html-tags@1.2.0, classnames@2.2.6, react-immutable-proptypes@2.1.0, redux-thunk@2.3.0, entities@1.1.1, mousetrap@1.6.0, bluebird@3.5.1, react-helmet@3.3.2, history@4.7.2, react-safe-html@0.4.0, reflexbox@2.2.3, react-redux@4.4.9, react@15.4.1, react-dom@15.4.1, prop-types@15.6.1, react-intl@2.4.0)
├── markup-it@3.6.0 (object-values@1.0.0, detect-newline@2.1.0, split-lines@1.1.0, trim-newlines@1.0.0, trim-right@1.0.1, trim-trailing-lines@1.1.1, type-of@2.0.1, html-entities@1.2.0, uid@0.0.2, rtrim@0.0.3, ltrim@0.0.3, range-utils@1.1.0, htmlparser2@3.9.2, indent-string@2.1.0, htmlclean@2.7.10, yargs@4.8.1, react@15.6.2, react-dom@15.6.2)
├── react@15.6.2 (object-assign@4.1.1, create-react-class@15.6.3, prop-types@15.6.1, loose-envify@1.3.1, fbjs@0.8.16)
├── react-dom@15.6.2 (object-assign@4.1.1, prop-types@15.6.1, loose-envify@1.3.1, fbjs@0.8.16)
├── slate@0.16.28 (is-empty@1.2.0, type-of@2.0.1, esrever@0.2.0, keycode@2.2.0, get-window@1.1.2, debug@2.6.9, cheerio@0.22.0, es6-map@0.1.5, react-portal@3.2.0)
└── npm@3.10.9

GitBook 4.0.0-alpha.6 has been installed
</code>

gitbook 新版

如何看待 GitBook 的改版? – 知乎

“1. CLI 工具链

移除了静态站点生成器,并且不再使用着名的 gitbook CLI 来构建文档输出。”

那岂不是:

不要安装新版了,否则连gitbook的cli都用不了了?

“4. PDF 和其他电子书格式出口

新版本的 GitBook 不再支持导出为 PDF 和其他电子书格式。

5. 离线访问

将来可能会实现离线访问功能。

7. 桌面编辑器

新版本不再有桌面编辑器。我们将团队注意力集中在网络应用和编辑器上,以确保产品的最佳质量。但是如果你的空间被同步到一个 GitHub 仓库,你仍然可以用你喜欢的编辑器编辑仓库。

8. 插件

一些传统的插件,例如 youtube,hint,theme-api 仍然被支持并作为一流功能提供。但大多数传统插件不再受支持。

放弃book提出space的概念,不支持pdf导出,只有企业级用户可以导出,这点除了他想收钱之外我想不出别的原因了,提出book的概念,但是不让导出book,尤其是最重要的pdf功能,这就是个笑话,

所以,放弃升级新版本

不过此处已经安装了新版,先去看看:

gitbook的命令行工具,是否还能用

<code>➜  Import which gitbook
/usr/local/bin/gitbook
➜  Import gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3
</code>

好像还是在的啊

关闭重新打开终端,发现gitbook还在,只是位置变了:

<code>➜  Import which gitbook
/Users/crifan/.nvm/versions/node/v10.4.0/bin/gitbook
➜  Import gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3
</code>

然后去打开gitbook editor看看,好像没变化,还是旧版本的:

那就正好,暂时不去升级新版本了。

有需要,再去升级。

【总结】

此处虽然命令行中升级了gitbook,貌似没有成功。

然后gitbook的cli还是旧版本,editor也是旧版本。

而由于新版本很多问题和限制,所以暂时正好不升级新版,有机会和需要再去升级。

【后记20181211】

参考:

GitbookIO/gitbook-cli: GitBook’s command line interface

去升级:

<code>➜  resources git:(master) ✗ gitbook --version
CLI version: 2.3.2
GitBook version: 3.2.3
➜  resources git:(master) ✗ gitbook update
Installing GitBook 2.6.9
/
</code>

等待了好一会,终于升级完了:

<code>➜  resources git:(master) ✗ gitbook update
Installing GitBook 2.6.9
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:85:
../src/methods.cc:14:12: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  handler-&gt;Call(3, argv);
           ^
../node_modules/nan/nan.h:1654:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local&lt;v8::Value&gt;
  ^
../node_modules/nan/nan.h:102:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
1 warning generated.
  SOLINK_MODULE(target) Release/fse.node
gitbook@2.6.9 ../../../../../../../../../../../var/folders/46/2hjxz38n22n3ypp_5f6_p__00000gn/T/tmp-5812UoKKu3vpC9mM/node_modules/gitbook
├── bash-color@0.0.3
├── escape-string-regexp@1.0.3
├── nunjucks-filter@1.0.0
├── gitbook-plugin-livereload@0.0.1
├── gitbook-plugin-sharing@1.0.1
├── github-slugid@1.0.0
├── gitbook-plugin-fontsettings@1.0.2
├── nunjucks-autoescape@1.0.0
├── jsonschema@1.0.2
├── spawn-cmd@0.0.2
├── q@1.0.1
├── json-schema-defaults@0.1.1
├── graceful-fs@3.0.5
├── semver@5.0.1
├── crc@3.2.1
├── urijs@1.17.0
├── tmp@0.0.24
├── dom-serializer@0.1.0 (domelementtype@1.1.3, entities@1.1.2)
├── merge-defaults@0.2.1 (lodash@2.4.2)
├── npmi@0.1.1 (semver@4.3.6)
├── resolve@0.6.3
├── send@0.2.0 (range-parser@1.0.3, fresh@0.2.4, mime@1.2.11, debug@3.2.6)
├── i18n@0.5.0 (sprintf@0.1.5, mustache@3.0.1, debug@3.2.6)
├── fs-extra@0.16.5 (jsonfile@2.4.0, rimraf@2.6.2)
├── request@2.51.0 (tunnel-agent@0.4.3, aws-sign2@0.5.0, forever-agent@0.5.2, caseless@0.8.0, stringstream@0.0.6, oauth-sign@0.5.0, json-stringify-safe@5.0.1, mime-types@1.0.2, qs@2.3.3, node-uuid@1.4.8, combined-stream@0.0.7, http-signature@0.10.1, tough-cookie@2.5.0, bl@0.9.5, form-data@0.2.0, hawk@1.1.1)
├── nunjucks@2.2.0 (asap@2.0.6, optimist@0.6.1)
├── tiny-lr@0.2.1 (parseurl@1.3.2, livereload-js@2.4.0, qs@5.1.0, debug@2.2.0, faye-websocket@0.10.0, body-parser@1.14.2)
├── fstream-ignore@1.0.2 (inherits@2.0.3, minimatch@2.0.10, fstream@1.0.11)
├── cheerio@0.19.0 (entities@1.1.2, css-select@1.0.0, htmlparser2@3.8.3)
├── gitbook-plugin-search@1.1.0 (lunr@0.5.12)
├── gitbook-parsers@0.8.9 (q@1.5.1, gitbook-restructuredtext@0.2.3, gitbook-markdown@0.5.3, gitbook-asciidoc@0.2.4)
├── gitbook-plugin-highlight@1.0.3 (highlight.js@8.8.0)
├── lodash@3.10.1
├── juice@1.5.0 (commander@2.3.0, slick@1.12.1, batch@0.5.2, cssom@0.3.0, web-resource-inliner@1.1.4)
├── npm@2.4.1
└── chokidar@1.0.6 (path-is-absolute@1.0.1, arrify@1.0.1, is-glob@1.1.3, async-each@0.1.6, is-binary-path@1.0.1, glob-parent@1.3.0, readdirp@1.4.0, anymatch@1.3.2, fsevents@0.3.8)

GitBook has been updated to 2.6.9
➜  resources git:(master) ✗
</code>

再去看看版本:

<code>➜  resources git:(master) ✗ gitbook -V
CLI version: 2.3.2
GitBook version: 3.2.3
</code>

结果还是之前版本2.3.2啊。

去看看远程版本:

<code>➜  resources git:(master) ✗ gitbook ls-remote
Available GitBook Versions:

     4.0.0-alpha.6, 4.0.0-alpha.5, 4.0.0-alpha.4, 4.0.0-alpha.3, 4.0.0-alpha.2, 4.0.0-alpha.1, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.2.0-pre.1, 3.2.0-pre.0, 3.1.1, 3.1.0, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 3.0.0-pre.15, 3.0.0-pre.14, 3.0.0-pre.13, 3.0.0-pre.12, 3.0.0-pre.11, 3.0.0-pre.10, 3.0.0-pre.9, 3.0.0-pre.8, 3.0.0-pre.7, 3.0.0-pre.6, 3.0.0-pre.5, 3.0.0-pre.4, 3.0.0-pre.3, 3.0.0-pre.2, 3.0.0-pre.1, 2.6.9, 2.6.8, 2.6.7, 2.6.6, 2.6.5, 2.6.4, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.5.2, 2.5.1, 2.5.0, 2.5.0-beta.7, 2.5.0-beta.6, 2.5.0-beta.5, 2.5.0-beta.4, 2.5.0-beta.3, 2.5.0-beta.2, 2.5.0-beta.1, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.0, 2.1.0, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 2.0.0-beta.5, 2.0.0-beta.4, 2.0.0-beta.3, 2.0.0-beta.2, 2.0.0-beta.1, 2.0.0-alpha.9, 2.0.0-alpha.8, 2.0.0-alpha.7, 2.0.0-alpha.6, 2.0.0-alpha.5, 2.0.0-alpha.4, 2.0.0-alpha.3, 2.0.0-alpha.2, 2.0.0-alpha.1

Tags:

     latest : 2.6.9
     pre : 4.0.0-alpha.6
</code>

然后ls:

<code>➜  resources git:(master) ✗ gitbook ls
GitBook Versions Installed:

    * 4.0.0-alpha.6
      3.2.3
      2.6.9

Run "gitbook update" to update to the latest version.
</code>

-》现在感觉是:

之前

<code>CLI version: 2.3.2
GitBook version: 3.2.3
</code>

就是:

  • Gitbook 版本已经是:3.2.3

  • 不过CLI命令行工具是:2.3.2

而已。

此处去update后,显示是更新到了2.6.9,但是比之前的3.2.3还低

所以实际上没有update成功。

所以:此处继续用3.2.3,然后也不用再去update了。

转载请注明:在路上 » 【记录】gitbook升级到新版本

发表我的评论
取消评论

表情

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
59 queries in 0.133 seconds, using 18.95MB memory