Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use gitbook to build wiki

Shulou Source: shulou.com Published: 2022-06-01 20:12:17 10月04日 Update

This article mainly introduces how to use gitbook to build wiki, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

GitBook is a command-line tool (and Node.js library) for building beautiful books using GitHub / Git and Markdown (or AsciiDoc), and GitBook can export your content as a website (customizable and extensible) or as an e-book (PDF,ePub or Mobi).

After editing the md document locally, after the webhooks is triggered through git push to gitlab,gitlab, it is automatically pulled by jenkins and pushed by rsync to the online web machine, and the sh script can be called remotely for an init build.

Web deployment gitbook

To install nodejs, download the nodejs binary installation package directly from the official website https://nodejs.org/en/download/ and set the environment variables.

Mv node-v10.16.0-linux-x64 / bin/mv / bin/node-v10.16.0-linux-x64 / bin/nodevim / etc/profileexport PATH=/usr/bin/node/bin:$PATHsource / etc/profile install gitbooknpm install gitbook-cli-gjenkinsrsync-avz $WORKSPACE/ 10.1.14.17:/data/wwwroot/wiki-- exclude= ".git"-- exclude= "metadata"-- exclude= "mainlib.db" ssh-Tq root@10.1.14.17 configuration nginx

The nginx configuration is as follows:

Server {listen 80; server_name wiki.21yunwei.com; access_log / logs/nginx/wiki/wiki_access.log main; error_log / logs/nginx/wiki/wiki_error.log; root/ data/wwwroot/wiki/; location / {proxy_pass http://gitbook;} location = / nginx-status {stub_status on Access_log off;}

Edit the md file locally and push it to gitlab directly. After triggering webhook, jenkins executes the push of the change and remotely executes sh for init, so that web can directly access the static page.

Thank you for reading this article carefully. I hope the article "how to use gitbook to build wiki" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Articles configurations beautiful books binary values interests content variables at the same time commands tools files documents more friends machines environments e-books e-books Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi NVidia MySQL Shulou Technology macOS