diff --git a/source/_static/css/frc-rtl.css b/source/_static/css/frc-rtl.css new file mode 100644 index 0000000000..d67fb91a52 --- /dev/null +++ b/source/_static/css/frc-rtl.css @@ -0,0 +1,75 @@ +@import url('https://fonts.googleapis.com/css2?family=Heebo&display=swap'); + +body, .rst-content .toctree-wrapper > p.caption, h1, h2, h3, h4, h5, h6, legend { + font-family: 'Heebo', sans-serif; +} +body { + direction: rtl; +} +.fa:before { + transform: scale(-1, 1); +} +.rst-content div[class^=highlight] pre, .highlighttable { + direction: ltr; +} +.rst-content code, .rst-content tt { + direction: ltr; + unicode-bidi: bidi-override; +} + +.link-bar-container { + margin-right: 320px; + margin-left: 0; +} +#link-bar li, .wy-nav-top i { + float: right; +} + +.wy-nav-side, .rst-versions { + right: 0; + left: unset; +} +.wy-nav-content-wrap { + margin-right: 320px; + margin-left: 0; +} +@media screen and (max-width: 768px) { + .wy-nav-side, .rst-versions { + right: -300px; + } + .wy-nav-content-wrap { + margin-right: 0; + } + .wy-nav-side.shift, .rst-versions.shift { + right: 0; + left: unset; + } + .wy-nav-content-wrap.shift { + right: 85%; + left: unset; + } +} + +.rst-content .admonition-title:before { + margin-right: 0; + margin-left: 4px; +} +.wy-breadcrumbs li.wy-breadcrumbs-aside { + float: left; +} +.float-right { + float: left; +} +.float-left { + float: right; +} + +.rst-versions .rst-current-version { + text-align: left; +} +.rst-versions .rst-current-version .fa-book, .rst-versions .rst-current-version .icon-book { + float: right; +} +.rst-other-versions { + text-align: right; +} diff --git a/source/conf.py b/source/conf.py index 7ed356ca0a..8e71101e90 100644 --- a/source/conf.py +++ b/source/conf.py @@ -165,6 +165,12 @@ def setup(app): app.add_css_file('css/frc-rtd.css') + + # Right-to-left support + is_rtl = app.config.language in rtl_locale + app.config.hoverxref_tooltip_side = 'left' if is_rtl else 'right' + if is_rtl: + app.add_css_file('css/frc-rtl.css') # -- Options for latex generation -------------------------------------------- @@ -199,3 +205,4 @@ def setup(app): gettext_compact = False locale_dirs = ['locale/'] +rtl_locale = ['he']