Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use gitbook to build wiki

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report