doc-builder
doc-builder copied to clipboard
Support for rendering RTL languages
In order to render RTL languages(see this pull request) 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.
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.