@@ -215,6 +215,68 @@ the hard work, even if it is incomplete.
215
215
216
216
[ CODEOWNERS ] : https://github.com/google/comprehensive-rust/blob/main/.github/CODEOWNERS
217
217
218
+ ## Publication Workflow
219
+
220
+ > This section is for the developers of Comprehensive Rust, but it might give
221
+ > you valuable background information on how the translations are published.
222
+
223
+ When a change is made to the ` main ` branch, the [ ` publish.yml ` ] GitHub CI
224
+ workflow starts.
225
+
226
+ The ` publish ` job in this workflow will:
227
+
228
+ - Install dependencies as described in [ ` CONTRIBUTING ` ] ( CONTRIBUTING.md ) .
229
+
230
+ - Build every translation of the course, including the original English, using
231
+ [ ` build.sh ` ] . The English HTML ends up in ` book/html/ ` , the HTML for the ` xx `
232
+ language ends up in ` book/xx/html/ ` .
233
+
234
+ - Publish the entire ` book/html/ ` directory to
235
+ https://google.github.io/comprehensive-rust/ .
236
+
237
+ [ `build.sh` ] : https://github.com/google/comprehensive-rust/blob/main/.github/workflows/build.sh
238
+
239
+ ### ` build.sh `
240
+
241
+ The ` build.sh ` script is used both when testing code from a PR (with
242
+ [ ` build.yml ` ] ) and when publishing the finished book (with [ ` publish.yml ` ] ).
243
+
244
+ [ `build.yml` ] : https://github.com/google/comprehensive-rust/blob/main/.github/workflows/build.yml
245
+ [ `publish.yml` ] : https://github.com/google/comprehensive-rust/blob/main/.github/workflows/publish.yml
246
+
247
+ The job of the script is to call ` mdbook build ` , but with a few extra steps:
248
+
249
+ - It will enable the PDF output using ` mdbook-pandoc ` . This is disabled by
250
+ default to make it easier for people to run ` mdbook build ` without having to
251
+ configure LaTeX.
252
+
253
+ #### Restoring Translations
254
+
255
+ When building a translation (languages other than English), ` build.sh ` will
256
+ restore all Markdown files to how they looked at the time recorded in the
257
+ POT-Creation-Date header.
258
+
259
+ This means that:
260
+
261
+ - A translation does not degrade when the English text is changed.
262
+ - A translation will not received the latest fixes to the English text.
263
+
264
+ The script restores the Markdown with a simple
265
+
266
+ ``` sh
267
+ $ git restore --source $LAST_COMMIT src/ third_party/
268
+ ```
269
+
270
+ command, where ` $LAST_COMMIT ` is the commit at the time of the POT-Creation-Date
271
+ header.
272
+
273
+ A consequence of this is that we use the latest theme, CSS, JavaScript, etc for
274
+ each translation.
275
+
276
+ After ` build.sh ` was run, the working copy is left in this dirty state. Beware
277
+ of this if you want to build the English version next, as you will have to clean
278
+ up manually.
279
+
218
280
## Status reports
219
281
220
282
Two translation status reports are automatically generated:
0 commit comments