Skip to content

Commit ec440ec

Browse files
committed
Setup local GitHub preview
1 parent f383b48 commit ec440ec

File tree

8 files changed

+89
-0
lines changed

8 files changed

+89
-0
lines changed

.gitbook.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
root: ./docs/
2+
3+
structure:
4+
readme: INTRO.md

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ buildNumber.properties
1919
.DS_Store
2020
.zpm/
2121
.zilla/
22+
_book/

docs/INTRO.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Introduction
2+
3+
Lorem ipsum

docs/README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Docs
2+
3+
## Install `nvm`
4+
5+
First [install nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to support local use of different node versions.
6+
7+
## Use Node v12
8+
9+
```
10+
nvm install 12
11+
nvm use 12
12+
```
13+
14+
## Install GitBook CLI
15+
```
16+
nvm use 12
17+
npm install -g gitbook-cli
18+
```
19+
20+
## Build via GitBook CLI
21+
```
22+
gitbook build .
23+
```
24+
```
25+
info: 7 plugins are installed
26+
info: 6 explicitly listed
27+
info: loading plugin "highlight"... OK
28+
info: loading plugin "search"... OK
29+
info: loading plugin "lunr"... OK
30+
info: loading plugin "sharing"... OK
31+
info: loading plugin "fontsettings"... OK
32+
info: loading plugin "theme-default"... OK
33+
info: found 3 pages
34+
info: found 0 asset files
35+
info: >> generation finished with success in 0.4s !
36+
```
37+
38+
## Preview via GitBook CL
39+
```
40+
gitbook serve .
41+
```I
42+
```
43+
Live reload server started on port: 35729
44+
Press CTRL+C to quit ...
45+
46+
info: 7 plugins are installed
47+
info: loading plugin "livereload"... OK
48+
info: loading plugin "highlight"... OK
49+
info: loading plugin "search"... OK
50+
info: loading plugin "lunr"... OK
51+
info: loading plugin "sharing"... OK
52+
info: loading plugin "fontsettings"... OK
53+
info: loading plugin "theme-default"... OK
54+
info: found 3 pages
55+
info: found 0 asset files
56+
info: >> generation finished with success in 0.4s !
57+
58+
Starting server ...
59+
Serving book on http://localhost:4000
60+
```
61+
62+
Browse to `http://localhost:4000` to preview GitBook generated docs.

docs/SUMMARY.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Summary
2+
3+
## Book
4+
5+
* [Chapter 1](chapter-1/README.md>)
6+
* [Chapter 2](chapter-2/README.md>)
7+

docs/book.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"structure":
3+
{
4+
"readme": "INTRO.md"
5+
}
6+
}

docs/chapter-1/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Chapter 1
2+
3+
Lorem ipsum

docs/chapter-2/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Chapter 2
2+
3+
Lorem ipsum

0 commit comments

Comments
 (0)