@@ -6,39 +6,68 @@ Tarantool documentation source, published at https://www.tarantool.io/doc/.
6
6
7
7
## How to build Tarantool documentation using [ Docker] ( https://www.docker.com )
8
8
9
- ### Build docker image
9
+ ### Prepare for work
10
10
11
- ``` bash
12
- docker build -t tarantool-doc-builder .
13
- ```
11
+ First of all, pull the image for building the docs.
14
12
15
- ### Build Tarantool documentation using * tarantool-doc-builder* image
16
- ## NOTE:
17
- > Run this command only if you don't have untracked files!
18
- check it by ` git status `
19
- Also failures during git submodule update can be fixed by:
20
- ``` bash
21
- git submodule deinit -f .
22
- git submodule update --init
23
- ```
24
-
25
- Init and update submodules:
26
- ``` bash
27
- docker run --rm -it -v $( pwd) :/doc tarantool-doc-builder sh -c " ./update_submodules.sh"
28
- ```
29
- or do it manually:
30
13
``` bash
31
- git submodule init
32
- git submodule update
33
- git pull --recurse-submodules
34
- git submodule update --remote --merge
14
+ docker pull tarantool/doc-builder
35
15
```
36
16
37
- Init make commands:
17
+ Next, initialize a Makefile for your OS:
18
+
38
19
``` bash
39
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " cmake ."
20
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " cmake ."
40
21
```
41
22
23
+ ### Update submodules and generate documentation sources from code
24
+
25
+ A big part of documentation sources comes from several other projects,
26
+ connected as Git submodules.
27
+ To include their latest contents in the docs, run these two steps.
28
+
29
+ 1 . Update the submodules:
30
+
31
+ ``` bash
32
+ docker run --rm -it -v $( pwd) :/doc tarantool/doc-builder sh -c " make pull-modules"
33
+ ```
34
+
35
+ This will initialize Git submodules and update them to the top of the stable
36
+ branch in each repository.
37
+
38
+ You can also do without a Docker container:
39
+
40
+ ` ` ` bash
41
+ git submodule update --init
42
+ git fetch --recurse-submodules
43
+ git submodule update --remote --checkout
44
+ ` ` `
45
+
46
+ ` git submodule update` can sometimes fail, for example,
47
+ when you have changes in submodules' files.
48
+ You can reinitialize submodules to fix the problem.
49
+
50
+ **Caution:** all untracked changes in submodules will be lost!
51
+
52
+ ```bash
53
+ git submodule deinit -f .
54
+ git submodule update --init
55
+ ```
56
+
57
+ 2. Build the submodules content:
58
+
59
+ ```bash
60
+ docker run --rm -it -v $(pwd):/doc tarantool/doc-builder sh -c "make build-modules"
61
+ ```
62
+
63
+ This command will do two things:
64
+
65
+ 1. Generate documentation source files from the source code
66
+ 2. Copy these files to the right places under the `./doc/` directory.
67
+
68
+ If you' re editing submodules locally, repeat this step
69
+ to view the updated results.
70
+
42
71
Now you' re ready to build and preview the documentation locally.
43
72
44
73
### Build and run the documentation on your machine
@@ -49,7 +78,7 @@ Every time you make changes in the source files, it will rebuild the docs
49
78
and refresh the browser page.
50
79
51
80
```bash
52
- docker run --rm -it -p 8000:8000 -v $( pwd) :/doc tarantool- doc-builder sh -c " make autobuild"
81
+ docker run --rm -it -p 8000:8000 -v $(pwd):/doc tarantool/ doc-builder sh -c "make autobuild"
53
82
```
54
83
55
84
First build will take some time.
@@ -60,8 +89,8 @@ and the browser tab with preview will reload automatically.
60
89
You can also build the docs manually with ` make html` ,
61
90
and then serve them using python3 built-in server:
62
91
` ` ` bash
63
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make html"
64
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make html-ru"
92
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make html"
93
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make html-ru"
65
94
python3 -m http.server --directory output/html
66
95
` ` `
67
96
@@ -73,24 +102,23 @@ python -m SimpleHTTPServer
73
102
74
103
then go to [localhost:8000](http://localhost:8000) in your browser.
75
104
76
-
77
105
There are other commands which can run
78
- in the * tarantool- doc-builder* container:
106
+ in the * tarantool/ doc-builder* container:
79
107
80
108
` ` ` bash
81
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make html"
82
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make html-ru"
83
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make singlehtml"
84
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make singlehtml-ru"
85
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make pdf"
86
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make pdf-ru"
87
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make json"
88
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make json-ru"
89
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make epub"
90
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make epub-ru"
91
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make update-pot"
92
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make update-po"
93
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make update-po-force"
109
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make html"
110
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make html-ru"
111
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make singlehtml"
112
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make singlehtml-ru"
113
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make pdf"
114
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make pdf-ru"
115
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make json"
116
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make json-ru"
117
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make epub"
118
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make epub-ru"
119
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make update-pot"
120
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make update-po"
121
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make update-po-force"
94
122
` ` `
95
123
96
124
# # Localization
@@ -119,7 +147,7 @@ Upload translation sources any time when they have changed:
119
147
120
148
```bash
121
149
# first, update the translation sources
122
- docker run --rm -it -v $(pwd):/doc tarantool- doc-builder sh -c "make update-pot"
150
+ docker run --rm -it -v $(pwd):/doc tarantool/ doc-builder sh -c "make update-pot"
123
151
124
152
# next, upload them to Crowdin
125
153
crowdin upload
@@ -138,7 +166,7 @@ Then reformat them to see the real changes.
138
166
139
167
` ` ` bash
140
168
crowdin download
141
- docker run --rm -it -v $( pwd) :/doc tarantool- doc-builder sh -c " make reformat-po"
169
+ docker run --rm -it -v $( pwd) :/doc tarantool/ doc-builder sh -c " make reformat-po"
142
170
` ` `
143
171
# # How to contribute
144
172
0 commit comments