gitbook、docsify、docusaurus

本文对比了GitBook、Docsify和Docusaurus三种文档工具的特点及使用体验。GitBook已停止更新,适合阅读但安装存在问题;Docsify简洁易用,支持实时预览且部署方便;Docusaurus适用于构建产品文档网站,具有丰富的导航选项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Intro

如果要给项目写文档,还能自带部署为前端,如果可以导出pdf、html啥的就更好了,当然能导出epub等电子书格式就更好了

本文内容经i有限,zhi描述了gitbook、docsify、docusaurus,主要是放在了docsify上

下期可能的对象:sphinx

gitbook

GitbookIO /gitbook :20210305 23.4k Star ,3.5k Fork

已经在2018年被抛弃! 抛弃! **抛弃!**原班人马去创业赚钱ing,这里只是做个古董开箱。。

install

sudo npm install gitbook-cli -g

demo

$ gitbook init ./book
Installing GitBook 3.2.3
/usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287
      if (cb) cb.apply(this, arguments)
                 ^

TypeError: cb.apply is not a function
    at /usr/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqCallback.oncomplete (node:fs:201:5)

emmm整了老半天最后不整了。。。此外新的gitbook需要科学上网。。

docsify

docsifyjs /docsify :20210305 16.9k Star ,4.1k Fork

使用感受:优点是很简单,写md就行了,也不需要配置啥主题啥域名(hugo、hexo需要)。

可以看到比较简洁,只有左侧有全局侧边栏(可自动识别文章内部标题),还可以配置各种插件,顶部配置的语言切换导航栏,说实话,棒!!

在这里插入图片描述
在这里插入图片描述
在其部署文档中,其推荐将文档放置在项目的docs目录下,直接使用page服务将/docs部署,NB这样都不用hugo转成静态这一步骤了。

install

node + npm

Node.js

$ sudo pacman -S nodejs  npm

$ node -v
v15.11.0

$ npm -v
7.6.1

docsify

sudo npm i docsify-cli -g

added 220 packages, and audited 221 packages in 5m
13 packages are looking for funding
  run `npm fund` for details
3 moderate severity vulnerabilities
To address all issues, run:
  npm audit fix

Run `npm audit` for details.

init

$ docsify init  /home/kearney/Documents/code/docsify
/home/kearney/Documents/code/docsify already exists.
✔ Are you sure you want to rewrite it? (y/N) true

Initialization succeeded! Please run docsify serve /home/kearney/Documents/code/docsify

[kearney@arch docsify]$ docsify serve

Serving /home/kearney/Documents/code/docsify now.
Listening at http://localhost:3000

自己尝试写了下一个模板,太舒服了

在这里插入图片描述

pdf plugin

导出pdf的功能在插件列表里面看到一个支持的插件 docsify-to-pdf-converter

npm install --save-dev docsify-pdf-converter

这个安装着实让人蒙蔽,全安到我主目录下了。。。

在这里插入图片描述

按照仓库里的readme进行操作,在docs里新建.docsifytopdfrc.jspackage.json,然后修改对应的信息之后 npm run convert

emm,着实吓到我了,首先右上角每一页都有绿标github.。。。。。不过这个可以在文档首页设置取消,可以明显看出是按照sidebar去做快照的。还有个问题就是没有书签目录。。

在这里插入图片描述

在这里插入图片描述

docusaurus

facebook /docusaurus :20210305 22.1k Star ,2.7k Fork
顶部的导航栏有较多选择项。主体部分除了左侧的全局导航栏之外,右侧还有局部导航栏。
翻译一下其README的重要信息 - Docusaurus 是一个轻松构建,部署和维护网站的开源项目。
写博客的话分类和标签功能不如hugo.。主要用来写产品网站。。。

在这里插入图片描述

Refer

docsifyjs /docsify

GitbookIO /gitbook

Deprecation warning(弃用警告)
As the efforts of the GitBook team are focused on the GitBook.com platform, the CLI is no longer under active development.
All content supported by the CLI are mostly supported by our GitBook.com / GitHub integration.
Content hosted on the legacy.gitbook.com will continue working until further notice. For differences with the new vesion, check out our documentation.

facebook /docusaurus :20210305 22.1k Star ,2.7k Fork

jekyll /jekyll :20210305 42.3k Star ,9.2k Fork

Sphinx:为python而生。。flask文档也是用它

Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license.
It was originally created for the Python documentation

经典老玩家了
在这里插入图片描述
docsify-to-pdf-converter

End

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值