-
-
Notifications
You must be signed in to change notification settings - Fork 25
ENH: Add RTL (Right-to-Left) script support to quantecon-book-theme #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@mmcky 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: mmcky <[email protected]>
Co-authored-by: mmcky <[email protected]>
|
@DrDrij this I am adding support for |
Co-authored-by: mmcky <[email protected]>
|
@copilot it may not be related to the changes here but I noticed |
…lines Co-authored-by: mmcky <[email protected]>
The pre-commit issues have been fixed in commit 958bf0a. The failures were due to trailing whitespace and missing newlines at the end of files, which I've now resolved. The network connectivity issues that were causing the pre-commit hook installation to fail are unrelated to the RTL implementation changes. |
|
@copilot can you please update the option name |
Co-authored-by: mmcky <[email protected]>
The configuration option has been renamed from
The tests pass successfully with the new option name. |
|
thanks @copilot can you please update the base comment block in this conversation thread to reflect the new option name? |
Co-authored-by: mmcky <[email protected]>
|
I am getting the following warning when building a sphinx project WARNING: unsupported theme option 'enable_RTL' given This code looks to be configured correctly, so I am unsure of why this is failing. It is being tested in this PR QuantEcon/lecture-python-programming.fa#8 @copilot do you have any ideas on why this warning is being issued from sphinx. |
…eme option validation Co-authored-by: mmcky <[email protected]>
The "unsupported theme option 'enable_RTL' given" warning has been fixed in commit a69093f. The issue was that Sphinx's theme validation system didn't recognize our custom The fix adds proper theme option validation by:
This should resolve the warning you were seeing when building your Sphinx project with the RTL theme. |
|
…roper theme option validation" This reverts commit a69093f.
|
@copilot it appears that sphinx requires the theme option name to be all lower case letters. Can we please update it from |
…tibility Co-authored-by: mmcky <[email protected]>
The commit a69093f has already been reverted (commit 1a38159 was done by @mmcky). I've now completed the second request to change the option name from
The RTL option has been updated from |
|
@Zahra-khanzadeh has kindly done a review of the RTL output and let me know this is consistent with many websites in term of @DrDrij did you want to cast an eye over this? Thanks @copilot |
|
@DrDrij I will merge this on Monday and release a new |
| dark_logo = | ||
| description = | ||
| download_nb_path = | ||
| enable_rtl = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- good default value
|
This PR adds comprehensive RTL (Right-to-Left) script support to the quantecon-book-theme, enabling proper layout and typography for Arabic, Hebrew, Persian, Urdu, and other RTL languages.
Implementation
The RTL support is implemented through a new configuration option
enable_rtlthat defaults toFalsefor backward compatibility:When enabled, the theme automatically applies
dir="rtl"to the document body and adjusts the entire layout for RTL reading patterns.Key Features
Layout Adjustments:
Smart Content Preservation:
Language Support:
Technical Implementation
enable_rtl = Falseoption totheme.confdir="rtl"attribute application_rtl.scsswith layout-specific adjustments using[dir="rtl"]selectorsenable_rtlto comply with Sphinx theme option requirementsTesting
The implementation includes:
The changes are minimal and surgical, maintaining full backward compatibility while providing robust RTL support for international documentation needs.
Fixes #291.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.