Add RTL support
Purpose
Add RTL (right-to-left) support for all Sphinx themes to improve accessibility for RTL languages like Farsi (Persian), Arabic, and Hebrew.
Key features:
- Add
is_rtltheme option for enabling RTL layout - Implement automatic layout mirroring
- Keep code blocks in the LTR direction
- Maintain theme-specific styling while supporting RTL
Implementation Details
- Added RTL stylesheets to each theme
- Updated theme configuration options
- Added new theme option
is_rtl(defaults tofalse) - Added documentation for RTL support
Questions
- Font Integration
- Is it a good idea to integrate Vazirmatn font for RTL support?
- If yes, what's the best approach:
- Bundle font files with Sphinx?
- Use CDN?
References
- Closes #10385
I'm eager to improve this implementation and would love to continue working on it. Open to suggestions and ready to make any necessary changes to align with Sphinx's standards.
Hi @StanFromIreland, thank you so much for your review.
I fixed the grammar issue, and changed my name to CHANGES.rst.
I added the versionadded block in theming documentation.
I removed the redundant RTL overrides.
Hi, I tried to remove the duplications, hope it helps. I'm looking forward to hearing your thoughts.
Hi all, just following up on this PR 👋
I’ve addressed the feedback (grammar fixes, versionadded, and CSS cleanups) and would love to get this moving.
RTL support would really help the ongoing Python Farsi translation and other RTL languages.
Happy to make any further changes if needed, thanks!