huggingface / huggingface/doc-builder

Support for rendering RTL languages

Open
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
144
Forks
59
Avg merge
2d 5h
Merged PRs (30d)
13

Description

In order to render RTL languages(see [this pull request](https://github.com/huggingface/course/pull/71)) correctly we have to add DIVs and SPANs with 'dir' attributes set to 'rtl' inside the mdx files. This leads to inconsistent formatting in a collaborative translation effort.
I think there should be a new 'direction' argument for doc-builder or the direction of the language should otherwise be automatically determined. That info should then be used in the generation of corresponding HTML tags, DIVs and whatnot. If we do that we can dispense with the extra RTL divs and spans everywhere in RTL-language docs.

Here's an example of Persian documentation. I've also attached the files below.
![Screenshot from 2022-04-05 15-56-01](https://user-images.githubusercontent.com/8168645/161743967-a8d162c6-445d-4e67-bf27-acafb43aec5f.png)

The body of the doc has to be surrounded by an RTL DIV. A separate issue not reflected here is that mixing of English characters into Persian, for example in the case of the name of the function 'pipeline()' leads to the name of the function being rendered as '()pipeline' in RTL mode which has to be fixed with an LTR SPAN. Also other features including lists require separate RTL DIVs of their own even if the entire doc itself is surrounded by an RTL DIV. All of these are styling issues that need to be handled automatically and I have very basic knowledge of.

There is probably more issues I haven't encountered yet and handling all of them manually is not the way to go.

[fa.zip](https://github.com/huggingface/doc-builder/files/8417634/fa.zip)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.