【docsify】linux安装部署

1. 安装docsify
// 需先已安装npm 
npm i docsify-cli -g

注:若提示未安装npm

2. 初始化项目
// 默认安装/root目录
docsify init ./docs

如果想安装在自定义目录,如用户目录,并自定义名称为initDoc,可以通过docsify init /usr/local/docs/initDoc

3. 运行docsify
	// 运行默认安装
	docsify serve docs
	// 运行自定义目录
	docsify serve /usr/local/docs/initDoc
4. 开启服务器防火墙和端口(云服务器需要后台配置端口规则)
// 开启防火墙
systemctl start firewalld

// 添加3000端口(docsify默认端口为3000)
firewall-cmd --zone=public --add-port=3000/tcp --permanent

// 重启防火墙
firewall-cmd --reload

// 查看当前所有tcp端口·
netstat -ntlp

// 查看所有1935端口使用情况
netstat -ntulp |grep 6379

安装npm

  1. 下载安装包

    cd ~
    wget https://nodejs.org/dist/v14.15.4/node-v14.15.4-linux-x64.tar.xz
    

    注:若提示未安装wget,需先安装wget

  2. 解压到用户目录

    tar -xf node-v14.15.4-linux-x64.tar.xz
    mv node-v14.15.4-linux-x64 /usr/local/node
    
  3. 建立软连接

    cd /usr/bin
    ln -s /usr/local/node/bin/node node
    ln -s /usr/local/node/bin/npm npm
    
  4. 切换国内淘宝镜像

    npm config set registry https://registry.npm.taobao.org
    // 查看是否安装成功
    npm config get registry
    
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Docsify is a documentation generator that can be used on Linux operating systems. It allows you to easily create beautiful and customizable documentation websites from simple markdown files. To get started with Docsify on Linux, you can follow these steps: 1. Install Node.js: Docsify requires Node.js to be installed on your system. You can download and install Node.js from the official website or use a package manager like apt or yum. 2. Install Docsify: Once you have Node.js installed, open your terminal and run the following command to install Docsify globally: ``` npm install -g docsify-cli ``` 3. Create Documentation: Next, navigate to the directory where you want to create your documentation website. Create a new directory for your documentation and navigate into it. 4. Initialize Docsify: Run the following command to initialize Docsify in the current directory: ``` docsify init ./docs ``` This will create a `docs` folder with some basic configuration files. 5. Start Docsify: To start the local development server and preview your documentation website, run the following command: ``` docsify serve docs ``` This will start the server and provide you with a URL (e.g., http://localhost:3000) where you can access your documentation. 6. Customize and Write Your Documentation: Docsify uses markdown files for content. You can edit the markdown files in the `docs` folder to write your documentation. You can also customize the appearance and behavior of your documentation website by modifying the `index.html` and `README.md` files. That's it! You now have a local Docsify server running on your Linux system, allowing you to create and preview your documentation website.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值