Skip to content

Commit

Permalink
Adopt gh:cN3rd/mdBook:rtl (rust-lang/mdBook#1641) for RTL support.
Browse files Browse the repository at this point in the history
It fixes rendering issues with prev/next arrows, and it does not need altering
HTML after rendering.
  • Loading branch information
ivilata committed Feb 24, 2022
1 parent 0f4acf5 commit 63addeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions user-manual/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ mdbook build
#find "$outd" -name '*.html' | xargs sed -i '/<link href="[^"]*\bfonts\.googleapis\.com\b/d'

# Fix output for RTL languages (needs <https://github.com/rust-lang/mdBook/pull/1489>).
if grep -qE '^_direction\s*=\s*"?rtl?"' "$conf"; then
book="$(sed -nE 's/^build-dir\s*=\s"([^"]+)".*/\1/p' "$conf")"
find "$book" -name '*.html' -exec sed -i 's/<body /<body dir="rtl" /' '{}' ';'
fi
# No longer needed with <https://github.com/rust-lang/mdBook/pull/1641>.
#if grep -qE '^_direction\s*=\s*"?rtl?"' "$conf"; then
# book="$(sed -nE 's/^build-dir\s*=\s"([^"]+)".*/\1/p' "$conf")"
# find "$book" -name '*.html' -exec sed -i 's/<body /<body dir="rtl" /' '{}' ';'
#fi
2 changes: 1 addition & 1 deletion user-manual/fa.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[book]
authors = ["Ivan Vilata-i-Balaguer", "Dmitri Vitaliev", "Jenny Ryan"]
language = "fa"
_direction = "rtl"
text_direction = "rtl"
multilingual = false
src = "fa.src"
title = "دفترچه‌ی راهنمای کاربر Censorship.no! (سنو)"
Expand Down

0 comments on commit 63addeb

Please sign in to comment.