Skip to content
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

Add book.translations to support translation preprocessors #2029

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Feb 22, 2023

  1. Add book.translations

    When set, `build` runs a renderer for each translations after setting
    `book.language` to a subdirectory.
    
    For example, when it's set `["ko", "ja"]`, `mdbook build -d book` will
    generate the output:
    
    ```
    book/
      (default output)
      ko/
        (ko output)
      ja/
        (ja output)
    ```
    
    This enables translation to be handled by preprocessors. For example, it
    could be PO-file based translation based on `book.language`.
    Jooyung Han committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    376b8f9 View commit details
    Browse the repository at this point in the history
  2. Pass updated config to renderer

    Jooyung Han committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    88289f5 View commit details
    Browse the repository at this point in the history
  3. Pass translations to HTML renderer

    Jooyung Han committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    96eab23 View commit details
    Browse the repository at this point in the history
  4. Pass path_html to HTML renderer

    When linking between translations, we can use `path_html` instead of
    changing .md to .html with `path`.
    Jooyung Han committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    e166a1f View commit details
    Browse the repository at this point in the history
  5. Fixing tests and format

    `cargo test` and `cargo fmt --check` pass.
    Jooyung Han committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    ac295bb View commit details
    Browse the repository at this point in the history