@@ -133,3 +133,56 @@ To preview the changes:
133
133
cd mynewt-documentation/versions/vX_Y_Z/mynewt-documentation
134
134
make clean && make docs && (cd _build/html && python -m SimpleHTTPServer 8080)
135
135
```
136
+
137
+ ## Generating PDF File
138
+
139
+ ### Apply the Workaround
140
+
141
+ Due to a potential issue with Sphinx's PDF builder, there is an additional step
142
+ that needs to be performed on each dependent repository before building the documentation.
143
+ The issue is related to Sphinx's ` .. toctree:: ` directive.
144
+ The output (PDF only) renders some sections in incorrect order when there is content in ` index.rst `
145
+ files used to chain source ` RST ` files together.
146
+
147
+ The workaround is to manually alter the affected files, so that there is no content but the
148
+ toctree directive in those ` index.rst ` files.
149
+
150
+ First, fetch the ` sphinx-workaround ` branch for one of the repositories:
151
+
152
+ ``` bash
153
+ git fetch https://github.com/wpiet/mynewt-documentation sphinx-workaround
154
+ git checkout -b sphinx-workaround FETCH_HEAD
155
+ ```
156
+
157
+ Then, rebase onto the downloaded branch:
158
+
159
+ ``` bash
160
+ git checkout master
161
+ git rebase sphinx-workaround
162
+ ```
163
+
164
+ Repeat the above steps for all dependent repositories, changing the ` git fetch ` command accordingly:
165
+ ``` bash
166
+ git fetch https://github.com/wpiet/mynewt-core sphinx-workaround
167
+ git fetch https://github.com/wpiet/mynewt-nimble sphinx-workaround
168
+ git fetch https://github.com/wpiet/mynewt-newt sphinx-workaround
169
+ git fetch https://github.com/wpiet/mynewt-newtmgr sphinx-workaround
170
+ ```
171
+
172
+ ### Build the Docs
173
+
174
+ In the ` mynewt-site ` directory run:
175
+
176
+ ``` shell
177
+ ./build.py
178
+ ```
179
+
180
+ In the ` mynewt-documentation ` run:
181
+
182
+ ``` shell
183
+ make latexpdf
184
+ ```
185
+
186
+ This will generate the PDF file (for the version set as the ` latest ` in ` mkdocs.yml ` ) in
187
+ the following path:
188
+ ` _build/latex/Mynewt.pdf `
0 commit comments