Skip to content

Add CI workflow to build guide books #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 28, 2025
Merged

Conversation

karnkaul
Copy link
Member

No description provided.

@karnkaul karnkaul marked this pull request as ready for review March 28, 2025 17:15
@karnkaul karnkaul requested a review from Mes0903 March 28, 2025 17:15
@karnkaul karnkaul merged commit b5fdf57 into feature/translations Mar 28, 2025
8 checks passed
@karnkaul karnkaul deleted the karnage/book-ci branch March 28, 2025 18:05
karnkaul added a commit that referenced this pull request May 2, 2025
* Preliminary multilingual support (#10)

* Preliminary multilingual support

mdBook does not natively support multilingual documentation. A common
approach is to use a third-party library like mdbook-i18n-helper, which
relies on a Gettext-based workflow to enable multilingual support.

However, I believe such a complex system is unnecessary for our case.
Therefore, this commit follows the approach suggested in the official
mdBook documentation: overriding the 'index.hbs' template to add a
button that redirects users to the corresponding documentation in
another language, thus achieving basic multilingual support.

This commit introduces the following three files under the theme
directory:

- 'index.hbs': Adds a redirect button for switching languages.
- 'lang-toggle.css': Defines the styling for the button and the dropdown
  menu.
- 'lang-toggle.js': Implements the main logic behind the button's
  behavior.

As a result, two separate books need to be built. However, since
mdBook’s 'book.toml' does not support multiple '[book]'' sections in a
single configuration.

This commit introduces a CMake script to build different language
versions of the book and place them in their respective directories.
It can be tested by command 'cmake -P build.cmake'.

Due to mdBook's behavior, the 'src' field in 'book.toml' determines the
root URL. Therefore, if the theme directory is placed above the src
directory, mdBook will copy it relative to the 'src' path during the
build, which will cause the theme folder to become unreachable.

Since English is the primary language of this documentation, the default
behavior supports running 'mdbook' command directly from the guide
directory, such as with 'mdbook serve'. However, this will only generate
the English version of the documentation, other languages will not be
built. To build other language versions using the mdbook command
directly, it must manually adjust their respective book.toml files.

All translations are placed under 'guide/translations'. To add a new
language, it need to follow the same folder structure, update the CMake
script, and register the new language in 'theme/index.hbs'.

[1]: https://github.com/google/mdbook-i18n-helpers

* Stick to 'snake_case' for filenames

* Stick to 'snake_case' for file reference

* Add CI workflow to build guide books (#13)

* Add build book job to CI

* Test book build breakage

* `execute_process()`: treat errors as fatal

* Revert deliberate breakage

* Replace Karn Kaul with Karnage (#14)

* ko-translate (#20)

* ko-translate getting_started

* ko-translate initialization.md

* ko-translate rendering

* ko-translate ImGui

* ko-translate shader_objects

* ko-translate memory

* ko-translate descriptorSets

* revise and summary

* fix

---------

Co-authored-by: Karn Kaul <karnkaul@gmail.com>

* Remove zh-TW

---------

Co-authored-by: Mes <mes900903@gmail.com>
Co-authored-by: MyungKun Chang <58208787+CDDing@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants