From 09d1265cbbd66b76c7edc9070edb95d3e0e769e9 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Thu, 7 Sep 2023 09:50:44 +0200 Subject: [PATCH] Add support for right-to-left languages (#1165) This updates our `mdbook` version to the latest version in Git. I copied the `index.hbs` file from that version and back-ported our changes into it. I checked English and Danish locally and they both look fine. The new version has support for right-to-left languages: https://github.com/rust-lang/mdBook/pull/1641. We have an in-progress Persian translation. Download the `fa.zip` artifact after building the PR to check how it looks. I checked Persian locally and it looks mirrored like I expect (but we will need someone who can read Persian to actually verify this). Fixes #1164. --- .github/workflows/install-mdbook/action.yml | 5 ++++- language-picker.css | 5 +++++ theme/index.hbs | 23 +++++++++++++-------- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/install-mdbook/action.yml b/.github/workflows/install-mdbook/action.yml index 211cc1d9d107..eb31ee3b74ac 100644 --- a/.github/workflows/install-mdbook/action.yml +++ b/.github/workflows/install-mdbook/action.yml @@ -8,7 +8,10 @@ runs: # The --locked flag is important for reproducible builds. It also # avoids breakage due to skews between mdbook and mdbook-svgbob. - name: Install mdbook - run: cargo install mdbook --locked --version 0.4.34 + # See https://github.com/google/comprehensive-rust/issues/1164. + # We will revert to a released version of mdbook as soon as the + # commit referenced here is released. + run: cargo install --git https://github.com/rust-lang/mdbook/ --rev 09f222b mdbook shell: bash - name: Install mdbook-svgbob diff --git a/language-picker.css b/language-picker.css index 1f7d5377e18f..ad1de7116d70 100644 --- a/language-picker.css +++ b/language-picker.css @@ -3,6 +3,11 @@ right: 10px; } +[dir=rtl] #language-list { + left: 10px; + right: auto; +} + #language-list a { color: inherit; } diff --git a/theme/index.hbs b/theme/index.hbs index 611e79029791..f1005ef431d5 100644 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -1,5 +1,5 @@ - + @@ -63,7 +63,7 @@ {{/if}} - +
+ +