guides icon indicating copy to clipboard operation
guides copied to clipboard

Ability to specify text direction in ReST

Open mabolek opened this issue 1 month ago • 2 comments

Feature request

It would be great to be able to specify text direction in sections of text.

This could for example be achieved with .. role:: rtl (for blocks). Maybe an inline option should also be possible? For example Example in Arabic is :rtl:`مثال`

mabolek avatar Nov 18 '25 14:11 mabolek

Thanks for your request. I do not fully understand what is need in the output. Why would one set the direction of a text? How would this reflect in the output?

jaapio avatar Nov 19 '25 20:11 jaapio

In HTML, it would set the dir attribute of the surrounding tag.

For example, this would make blocks of text in right-to-left languages (like Arabic, Hebrew, Urdu, etc.) are legible. This is comparable to if text in the latin alphabet were written in the wrong direction — simply illegible: !drah si sdrawkcab gnidaeR

PS! For completeness, there should probably be a .. role:: ltr too, for left-to-right in a right-to-left setting.

mabolek avatar Nov 20 '25 08:11 mabolek