[技巧]新版gitbook导出pdf电子书

前言

关于新版的gitbook,官方已经不支持导出pdf等电子书格式,官方的解读如下:
截止到20191103官方暂未支持导出pdf,未来可能添加该功能

PDF and other ebook formats exports ?
The new version of GitBook no longer supports exporting to PDF and other ebooks format. A lot of rich-content does not translate well from the Web to PDF. GitBook will expose a developer API for people to consume and extend their content. It is not excluded that someone build a PDF export tool using the API, but it will not be officially supported. See the section about offline access if this is the part you cared about.

但是并不意味着就不能用其他方法生成,网上检索和测试了几种方法,这里作一下记录和分享
声明: 以下方法使用系统均为ubuntu 18.04windows请自行探索!!

方法一:

  1. 安装npm
sudo apt install npm
  1. 安装gitbook
sudo npm install gitbook -g
sudo npm install gitbook-cli -g
  1. 安装calibre
sudo apt install calibre
  1. 进入放置SUMMARY.md的目录
  2. 执行生成命令
sudo gitbook pdf

等2分钟就能生成啦,会有以下提示!!注意第2第3步骤,因为网络环境都有失败的可能,最好挂上VPN进行下载安装。

gitbookpdf

方法二:

参考以下网友的链接:gitbook2pdf
输入个人gitbook主页链接,并不能正常生成pdf(空白页面),但是示例链接仿佛没有问题,估计还是gitbook网站改版的问题。

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值