-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add RTL support #13338
Open
Revisto
wants to merge
18
commits into
sphinx-doc:master
Choose a base branch
from
Revisto:rtl-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add RTL support #13338
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2691ea5
Add support for RTL layout in documentation options
Revisto eecd16e
Add RTL support with new CSS for right-to-left basic layout
Revisto 4d57e27
Add RTL support for Agogo theme with new CSS file
Revisto bcc1783
Add RTL support for Epub theme with new CSS file
Revisto 436ccf1
Add RTL support for Nonav theme with new CSS file
Revisto 17a8aa4
Add RTL support for Scrolls theme with new CSS file
Revisto 86c7135
Add RTL support for Traditional theme with new CSS file
Revisto 7d677a1
Add RTL support documentation for themes
Revisto 0435341
Closes #10385: Add RTL support for Sphinx themes
Revisto 08b2cd5
Add Alireza Shabani to AUTHORS.rst as contributor
Revisto 7d37adc
Fix trailing whitespace in theme documentation
Revisto c0aaec6
Fix trailing whitespace in CHANGES.rst
Revisto dc3c2e3
Fix grammar in CHANGES.rst RTL Support
Revisto bf24eef
Update author name in CHANGES.rst
Revisto b5f2e67
Add versionadded directive for is_rtl in theming documentation
Revisto 01ae484
Remove redundant RTL overrides from themes
Revisto 886ba96
Remove unused Vazirmatn font-family from RTL themes
Revisto dbd3ea4
Reduce duplication and trailing whitespace in RTL CSS themes
Revisto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
* Sphinx stylesheet -- agogo theme. | ||
*/ | ||
|
||
@import url("rtl.css"); | ||
|
||
* { | ||
margin: 0px; | ||
padding: 0px; | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
{% if theme_is_rtl|tobool %} | ||
|
||
/* Core RTL overrides for Agogo theme */ | ||
body { | ||
direction: rtl !important; | ||
text-align: right !important; | ||
} | ||
|
||
/* Header adjustments */ | ||
div.header .headertitle { | ||
text-align: right !important; | ||
letter-spacing: 0 !important; | ||
} | ||
|
||
div.header div.rel { | ||
direction: rtl !important; | ||
} | ||
|
||
p.logo { | ||
float: left !important; | ||
} | ||
|
||
/* Content layout */ | ||
div.document { | ||
float: right !important; | ||
} | ||
|
||
div.body { | ||
{%- if theme_rightsidebar|tobool %} | ||
padding-left: 2em !important; | ||
padding-right: 0 !important; | ||
{%- else %} | ||
padding-right: 2em !important; | ||
padding-left: 0 !important; | ||
{% endif %} | ||
} | ||
|
||
/* Sidebar positioning */ | ||
div.sidebar, | ||
aside.sidebar { | ||
{%- if theme_rightsidebar|tobool %} | ||
float: left !important; | ||
{%- else %} | ||
float: right !important; | ||
{% endif %} | ||
} | ||
|
||
/* Lists and margins */ | ||
div.document ul { | ||
margin-right: 1.5em !important; | ||
margin-left: 0 !important; | ||
} | ||
|
||
div.document dd { | ||
margin-right: 1.2em !important; | ||
margin-left: 0 !important; | ||
} | ||
|
||
/* Admonitions */ | ||
div.admonition { | ||
border-right: 0.2em solid black !important; | ||
border-left: none !important; | ||
} | ||
|
||
/* Search elements */ | ||
ul.search { | ||
margin: 10px 20px 0 0 !important; | ||
} | ||
|
||
ul.search li { | ||
padding: 5px 20px 5px 0 !important; | ||
background-position: right 7px !important; | ||
} | ||
|
||
/* Table alignments */ | ||
table.indextable td { | ||
text-align: right !important; | ||
} | ||
|
||
/* Footer adjustments */ | ||
div.footer .right { | ||
text-align: left !important; | ||
} | ||
|
||
div.footer .left { | ||
text-align: right !important; | ||
} | ||
|
||
/* Code blocks - keep LTR */ | ||
div.highlight pre { | ||
direction: ltr !important; | ||
text-align: left !important; | ||
} | ||
|
||
/* Header links */ | ||
a.headerlink { | ||
padding-right: .3em !important; | ||
padding-left: 0 !important; | ||
} | ||
|
||
/* Sidebar list adjustments */ | ||
div.sidebar li.toctree-l1 a, | ||
aside.sidebar li.toctree-l1 a { | ||
padding-right: 3px !important; | ||
padding-left: 0 !important; | ||
} | ||
|
||
div.sidebar li.toctree-l2 a, | ||
aside.sidebar li.toctree-l2 a { | ||
margin-right: 1em !important; | ||
margin-left: 0 !important; | ||
} | ||
|
||
div.sidebar li.toctree-l3 a, | ||
aside.sidebar li.toctree-l3 a { | ||
margin-right: 2em !important; | ||
margin-left: 0 !important; | ||
} | ||
|
||
/* Float adjustments */ | ||
.left { | ||
float: right !important; | ||
} | ||
|
||
.right { | ||
float: left !important; | ||
} | ||
|
||
/* Image alignments */ | ||
img.align-left, .figure.align-left, object.align-left { | ||
float: right !important; | ||
margin-left: 1em !important; | ||
margin-right: 0 !important; | ||
} | ||
|
||
img.align-right, .figure.align-right, object.align-right { | ||
float: left !important; | ||
margin-right: 1em !important; | ||
margin-left: 0 !important; | ||
} | ||
|
||
/* Viewcode extension */ | ||
.viewcode-link, .viewcode-back { | ||
float: left !important; | ||
} | ||
|
||
/* Equation numbers */ | ||
span.eqno { | ||
float: left !important; | ||
} | ||
{% endif %} |
This file contains 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
This file contains 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
A version added block would be a nice addition