FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add RTL support by sepehr-rs · Pull Request #324 · python/python-docs-theme · GitHub

Repository navigation

Add RTL support - #324

Merged
StanFromIreland merged 25 commits into
python:mainfrom
sepehr-rs:add-rtl
Sep 18, 2026
Merged

StanFromIreland merged 25 commits into
python:mainfrom
sepehr-rs:add-rtl

Conversation

Copy link
Copy Markdown
Contributor

Added RTL support to python-docs-theme. Passing the is_rtl=true flag when building the documentation now generates RTL-friendly pages.
I also added Vazirmatn as the font for RTL scripts (it really improves readability), but I’m not sure how acceptable this is, so I’m happy to change it if the maintainers disagree.
Please let me know if any changes or additions are needed. Thanks in advance!

sepehr-rs marked this pull request as draft August 17, 2026 17:30

read-the-docs-community Bot commented Aug 17, 2026 •
edited
Loading

Copy link
Copy Markdown

Copy link
Copy Markdown
Member

I think it's better to do the font in a follow up, since I have some concerns about licensing and such things.

Copy link
Copy Markdown
Contributor Author

I think it's better to do the font in a follow up, since I have some concerns about licensing and such things.

Although I’m okay with leaving this for a follow-up, Vazirmatn is an open-source project, licensed under the SIL Open Font License. But if you still think this is better handled in a follow-up, I’ll do that. Thanks a lot!

sepehr-rs marked this pull request as ready for review August 18, 2026 04:04

Copy link
Copy Markdown
Member

But if you still think this is better handled in a follow-up

I'd prefer that, personally.

Copy link
Copy Markdown
Member

Can you please update your branch to pull in the translation?

This comment was marked as resolved.

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

Thanks so much for the thorough review! I’ll work through these comments and send a patch soon.

Copy link
Copy Markdown
Contributor Author

Hi @StanFromIreland, I addressed the review comments you left with Claude's help, built the docs locally to verify the changes, and all the issues you pointed out appear to be resolved. I also checked that the LTR version remains unaffected.
Please let me know if anything else needs adjustment. Thanks again for the thorough review!

StanFromIreland commented Aug 19, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

I also checked that the LTR version remains unaffected.

Indeed, testing with the current patch, the only change is the addition of dir="ltr" attribute:

A selection of pages
diff --git a/html/whatsnew/changelog.html b/base/html/whatsnew/changelog.html
index 903b246..c60dcd2 100644
--- a/html/whatsnew/changelog.html
+++ b/base/html/whatsnew/changelog.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 
-<html lang="en" data-content_root="../">
+<html lang="en" dir="ltr" data-content_root="../">
   <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -20,7 +20,7 @@
     
     <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
     <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=234b1a7c" />
-    <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=4365c8fe" />
+    <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=83ab0a67" />
     <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=0fc419ee" />
     
     <script src="../_static/documentation_options.js?v=d86cccaa"></script>
@@ -50462,7 +50462,7 @@ Kilburn.</p></li>
 <a href="https://www.python.org/psf/donations/">Please donate.</a>
 <br>
     <br>
-      Last updated on Aug 19, 2026 (20:32 UTC).
+      Last updated on Aug 19, 2026 (20:30 UTC).
     
       <a href="/bugs.html">Found a bug</a>?
diff --git a/html/library/sqlite3.html b/base/html/library/sqlite3.html
index 6decdde..fc9f358 100644
--- a/html/library/sqlite3.html
+++ b/base/html/library/sqlite3.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 
-<html lang="en" data-content_root="../">
+<html lang="en" dir="ltr" data-content_root="../">
   <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -20,7 +20,7 @@
     
     <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
     <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=234b1a7c" />
-    <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=4365c8fe" />
+    <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=83ab0a67" />
     <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=0fc419ee" />
     
     <script src="../_static/documentation_options.js?v=d86cccaa"></script>
@@ -2979,7 +2979,7 @@ statements.  This is no longer the case.</p>
 <a href="https://www.python.org/psf/donations/">Please donate.</a>
 <br>
     <br>
-      Last updated on Aug 19, 2026 (20:32 UTC).
+      Last updated on Aug 19, 2026 (20:30 UTC).
     
       <a href="/bugs.html">Found a bug</a>?
diff --git a/html/library/datetime.html b/base/html/library/datetime.html
index b32b4a9..0381fa5 100644
--- a/html/library/datetime.html
+++ b/base/html/library/datetime.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 
-<html lang="en" data-content_root="../">
+<html lang="en" dir="ltr" data-content_root="../">
   <head>
     <meta charset="utf-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -20,7 +20,7 @@
     
     <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
     <link rel="stylesheet" type="text/css" href="../_static/classic.css?v=234b1a7c" />
-    <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=4365c8fe" />
+    <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=83ab0a67" />
     <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=0fc419ee" />
     
     <script src="../_static/documentation_options.js?v=d86cccaa"></script>
@@ -3649,7 +3649,7 @@ for a good explanation.</p>
 <a href="https://www.python.org/psf/donations/">Please donate.</a>
 <br>
     <br>
-      Last updated on Aug 19, 2026 (20:32 UTC).
+      Last updated on Aug 19, 2026 (20:30 UTC).
     
       <a href="/bugs.html">Found a bug</a>?

Copy link
Copy Markdown
Member

@cben, maybe you can help review this? From what I gather you're the expert in this area, I'd appreciate your thoughts here.

Copy link
Copy Markdown
Member

@StanFromIreland Ooh I'll be glad to review but have family events & vacations for a week, not sure worth waiting for me but I can review post-merge too.

That would be great!

Comment thread python_docs_theme/static/pydoctheme.css Outdated

Copy link
Copy Markdown
Member

Oh sorry, I meant to push to #325.

StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please update the README for this option.

Comment thread python_docs_theme/static/pydoctheme.css Outdated
Comment thread python_docs_theme/static/pydoctheme.css Outdated
Comment thread python_docs_theme/static/pydoctheme.css Outdated
sepehr-rs and others added 2 commits August 25, 2026 07:39

Copy link
Copy Markdown
Contributor Author

Thanks a lot for the review! I addressed your comments, please let me know if any other changes are needed.

StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

And some additional observations, footnotes and search results are still LTR:

Comment thread python_docs_theme/static/pydoctheme.css Outdated
Comment thread python_docs_theme/static/pydoctheme.css Outdated
Comment thread README.md Outdated
StanFromIreland changed the title Add RTL support to python-docs-theme Add RTL support Aug 26, 2026

Copy link
Copy Markdown
Member

Hey @sepehr-rs, just checking in. Some changes are still pending, and I'd love to land this to unblock the Persian translation. Happy to help if anything is unclear.

Also a little ping for @cben, I'd like to hear what you think. :-)

Copy link
Copy Markdown
Contributor Author

Hi @StanFromIreland, sorry for the delay on this. I recently found a free API and ended up translating the entire Python documentation corpus into Persian (this PR) and what I initially thought would be a 3-day plan turned into a 3-week project 😬.
But it’s now in the final stages of cleanup and review, so I’ll try to get back to this today or tomorrow. Thanks a lot for following up with me, I really appreciate it!

Copy link
Copy Markdown
Contributor Author

Thanks a lot for your review and patience!
I’ve addressed your review comments. Please let me know if any further changes are needed.

StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Overall looks good to me, last few little comments.

Comment thread README.md Outdated
Comment thread python_docs_theme/static/pydoctheme.css Outdated
Comment thread python_docs_theme/static/pydoctheme.css Outdated
sepehr-rs and others added 2 commits September 18, 2026 21:48
sepehr-rs force-pushed the add-rtl branch 2 times, most recently from 61fe270 to 55e8f5a Compare September 18, 2026 18:26

Copy link
Copy Markdown
Contributor Author

Thanks for the additional review! Let me know if anything else needs changing.

Copy link
Copy Markdown
Member

Please don't force push in the future, it makes reviewing more difficult.

StanFromIreland left a comment •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

@hugovk, could you please take a look?

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Exciting!

@StanFromIreland Release when ready!

StanFromIreland merged commit 0ca52a5 into python:main Sep 18, 2026
25 checks passed

Copy link
Copy Markdown
Member

Merged, thank you @sepehr-rs !

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL