Switch the manual theme to Furo #104735

Merged
Aaron Carlisle merged 30 commits from furo-theme into blender-v4.1-release 2024-03-20 21:38:49 +01:00
10 changed files with 148 additions and 404 deletions
Showing only changes of commit be893ef08c - Show all commits

View File

@ -0,0 +1,11 @@
{%- extends "!base.html" -%}
{%- block linktags -%}
{{ super() }}
{%- include "components/linktags.html" -%}
{%- endblock -%}
{%- block theme_scripts -%}
{{ super() }}
{%- include "components/analytics.html" -%}
{%- endblock -%}

View File

@ -0,0 +1,13 @@
{%- if analytics_id %}
<!-- Theme Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id={{ theme_analytics_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{ analytics_id }}', {
'anonymize_ip': 'false',
});
</script>
{%- endif %}

View File

@ -1,21 +1,19 @@
{%- extends "!footer.html" %}
{%- block extrafooter %}
{%- if not pagename in ("search", "404", "genindex", "advanced/command_line/arguments") and hasdoc(pagename) %}
<div class="footer-contribute">
<ul>
<li>{# Add the `display=source` because GITEA's rendering misses Sphinx's features and shows warnings. #}
<a href="https://projects.blender.org/blender/blender-manual/{#
#}src/branch/main/manual/{{ pagename }}{{ page_source_suffix }}?display=source"
class="fa fa-edit"> {{ _('View Source') }}</a>
#}src/branch/main/manual/{{ pagename }}{{ page_source_suffix }}?display=source" class="fa fa-edit"> {{
_('View Source') }}</a>
</li>
<li>
<a href="https://translate.blender.org/zen/blender-manual/{#
#}manual/{{ language }}/?q=location%3Amanual%2F{{ pagename }}"
class="fa fa-edit"> {{ _('View Translation') }}</a>
#}manual/{{ language }}/?q=location%3Amanual%2F{{ pagename }}" class="fa fa-edit"> {{ _('View
Translation') }}</a>
</li>{#
<li>
<a href="https://projects.blender.org/blender/blender-manual/src/branch/main/manual/{{ pagename }}{{ page_source_suffix }}"
class="fa fa-edit"> {{ _('Edit Page') }}</a>
class="fa fa-edit"> {{ _('Edit Page') }}</a>
</li>#}
<li>
<a href="https://projects.blender.org/blender/documentation/issues/new?{#
@ -27,10 +25,9 @@
#}Permanent+Link%5D%28https%3A%2F%2Fdocs.blender.org%2F{#
#}manual%2F{{ language }}%2F{{ version }}%2F{{ pagename }}{{ file_suffix }}%29%0D%0A%0D%0A%2A%2A{#
#}Short+description+of+error%2A%2A%0D%0A%5B{#
#}Please+fill+out+a+short+description+of+the+error+here%5D%0D%0A"
class="fa fa-bug"> {{ _('Report issue on this page') }}</a>
#}Please+fill+out+a+short+description+of+the+error+here%5D%0D%0A" class="fa fa-bug"> {{ _('Report issue
on this page') }}</a>
</li>
</ul>
</div>
{%- endif %}
{% endblock %}
{%- endif %}

View File

@ -1,5 +1,3 @@
{%- extends "!layout.html" %}
{%- block linktags %}
<link rel="alternate" hreflang="en" href="https://docs.blender.org/manual/en/latest/" />
<link rel="alternate" hreflang="ar" href="https://docs.blender.org/manual/ar/latest/" />
<link rel="alternate" hreflang="de" href="https://docs.blender.org/manual/de/latest/" />
@ -20,6 +18,4 @@
<link rel="alternate" hreflang="vi" href="https://docs.blender.org/manual/vi/latest/" />
<link rel="alternate" hreflang="zh-Hans" href="https://docs.blender.org/manual/zh-hans/latest/" />
<link rel="alternate" hreflang="zh-Hant" href="https://docs.blender.org/manual/zh-hant/latest/" />
<link rel="alternate" hreflang="x-default" href="https://docs.blender.org/manual/en/latest/" />
{{ super() }}
{%- endblock %}
<link rel="alternate" hreflang="x-default" href="https://docs.blender.org/manual/en/latest/" />

View File

@ -0,0 +1,6 @@
{%- extends "!page.html" -%}
{%- block footer -%}
{{ super() }}
{%- include "components/footer_contribute.html" -%}
{%- endblock footer -%}

View File

@ -2,28 +2,24 @@
<ul id="versionwrap" role="presentation">
<li role="presentation">
<span id="version-popover" class="version-btn" tabindex="0" role="button" aria-label="versions selector"
aria-haspopup="true" aria-controls="version-vsnlist" aria-disabled="true">
aria-haspopup="true" aria-controls="version-vsnlist" aria-disabled="true">
{{ release }}
</span>
<div class="version-dialog" aria-hidden="true">
<div class="version-arrow" aria-hidden="true"></div>
<div class="version-title">Versions</div>
<ul id="version-vsnlist" class="version-list" role="menu" aria-labelledby="version-popover"
aria-hidden="true">
<ul id="version-vsnlist" class="version-list" role="menu" aria-labelledby="version-popover" aria-hidden="true">
<li role="presentation">Loading...</li>
</ul>
</div>
</li>
<li role="presentation">
<span id="lang-popover" class="version-btn" tabindex="0" role="button" aria-label="language selector"
aria-haspopup="true" aria-controls="version-langlist">
aria-haspopup="true" aria-controls="version-langlist">
{% if language is not none %} {{ language }} {% else %} en {% endif %}
</span>
<div class="version-dialog" aria-hidden="true">
<div class="version-arrow" aria-hidden="true"></div>
<div class="version-title">Languages</div>
<ul id="version-langlist" class="version-list" role="menu" aria-labelledby="lang-popover"
aria-hidden="true">
<ul id="version-langlist" class="version-list" role="menu" aria-labelledby="lang-popover" aria-hidden="true">
<li role="presentation">Loading...</li>
</ul>
</div>
@ -37,9 +33,9 @@
<div class="admonition warning">
<p class="first admonition-title">Note</p>
<p class="last">
You are not using the most up to date version of the documentation.
<a href="#"></a> is the newest version.
You are not using the most up to date version of the documentation.
<a href="#"></a> is the newest version.
</p>
</div>
</template>
</div>
</div>

View File

@ -6,108 +6,38 @@
* https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_css_file
*/
h5 {
margin-bottom: 5px
/* Slightly decrease text to make the text fit on one line */
.sidebar-brand-text {
font-size: 1.4rem;
}
/* Sidebar menu links. */
.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a:hover {
background: #c0c0c0
/* Add more visual weight to defintion terms */
dl dt {
font-weight: bold !important
}
.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a:hover {
background: #b5b5b5
}
/* Fixes to field list, see #104636 */
dl.field-list {
display: grid;
grid-template-columns: fit-content(24px) auto !important;
.wy-menu-vertical li.toctree-l4 {
font-size: 1em
}
.wy-menu-vertical li.current a {
border: 0
}
.wy-side-nav-search>a:hover {
background: none;
opacity: 0.9
}
.wy-side-nav-search>a.icon::before {
content: none
}
.wy-menu-vertical p.caption {
color: #e6e6e6;
}
/* Ensure background of input fields is light color even when a local theme wants it to be dark. */
input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="number"],
input[type="tel"],
input[type="color"] {
background-color: #FCFCFC;
p {
margin-bottom: 0;
}
}
/* Boxed paragraphs. */
.rst-content .refbox .admonition-title {
background-color: #bbb
.admonition.refbox {
border-color: rgb(50, 50, 50);
}
.rst-content .refbox {
background-color: #e3e3e3
.admonition.refbox>.admonition-title {
background-color: rgba(50, 50, 50, 0.1);
border-color: rgb(50, 50, 50);
}
.rst-content .seealso .admonition-title {
background-color: #7a87e6
}
.rst-content .seealso {
background-color: #e7ebfa
}
.rst-content .important .admonition-title {
background-color: #ddca3b
}
.rst-content .important {
background-color: #f6f3a5
}
/* refbox =, seealso ( > ), note ( i ), tip i , hint (+), warn / ! \ */
.refbox .admonition-title::before {
content: "\f00b"
}
.seealso .admonition-title::before {
content: "\f138"
}
.note .admonition-title::before {
content: "\f05a"
}
.tip .admonition-title::before {
content: "\f129";
width: 0.75em;
text-align: center
}
.hint .admonition-title::before {
content: "\f055"
}
.warning .admonition-title::before {
content: "\f071"
.admonition.refbox>.admonition-title::before {
background-color: rgb(50, 50, 50);
}
/* 'refbox' field. */
@ -120,27 +50,8 @@ input[type="color"] {
font-weight: normal
}
/* Ugly 'red' literals. */
.rst-content tt.literal,
.rst-content tt.literal,
.rst-content code.literal {
color: #404040;
border-radius: .4em;
}
/* Literal blocks that use too much padding, make them look like regular literals. */
.rst-content pre.literal-block {
font-size: 75%;
margin: 0;
padding: 2px 4px;
color: #404040;
background: #ffffff;
white-space: normal;
display: inline;
border-radius: .4em;
}
/* Fix definisions with different ids. */
/* Fix definitions with different ids. */
.rst-content dl.simple {
margin-bottom: 0px;
}
@ -162,113 +73,35 @@ input[type="color"] {
padding-top: 12px;
}
/* Without this, paragraphs in bullet points within definition lists have too much vertical padding. */
.rst-content li>p {
margin-bottom: 0px !important;
}
/* TABLE & FIGURE */
/* captions text style */
.rst-content .figure .caption,
.rst-content figure figcaption>p,
.rst-content table.docutils caption,
.rst-content table.field-list caption {
font: italic 90%/18px Lato, proxima-nova, 'Helvetica Neue', Arial, sans-serif;
color: #808080;
}
/* Captions top padding. */
.rst-content .figure .caption,
.rst-content figure figcaption {
margin-top: 4px;
}
.rst-content table.docutils caption {
padding: 0.5em;
}
/* Text word wrap. */
.wy-table-responsive table td,
.wy-table-responsive table th {
white-space: normal;
}
/* Cell's vertical align. */
/* use "valign" class for middle align. */
.rst-content table.docutils:not(.valign) td {
table.docutils:not(.valign) td {
vertical-align: baseline;
}
/* Field list align. */
.rst-content table.field-list td {
padding-top: 8px;
}
/* Table header cells border color. */
.rst-content table.docutils th {
border-color: #e1e4e5;
}
/* Figure in table margin. */
.rst-content td div.figure,
.rst-content td figure {
margin-top: 4px;
margin-bottom: 0;
}
/* Figure legend. */
.legend {
font-size: 90%;
color: #484848;
margin-top: -20px;
}
.rst-content dl .legend {
margin-top: -10px;
}
@media screen and (max-width: 768px) {
.wy-table-responsive table:not(.footnote) {
min-width: 520px;
}
.rst-content table.docutils caption {
text-align: left;
}
img {
width: auto;
}
}
/* End TABLE & FIGURE. */
/* Video center. */
iframe {
display: block;
margin: 0 auto 24px auto;
border: 0;
max-width: 100%;
}
/* Copyright font scale down. */
footer p {
font-size: smaller
}
.footer-contribute {
display: block;
font-size: smaller;
margin-top: -12px
font-size: var(--font-size--small);
}
.bottom-of-page {
padding-bottom: 0;
}
.footer-contribute ul {
margin: 0;
padding: 0;
padding-bottom: 1rem
}
.footer-contribute li {
display: inline;
list-style-type: none;
padding-right: 20px;
padding-right: 1.5rem;
}
/* Quotes for Fig. "link". */
@ -280,17 +113,16 @@ a[href^="#fig-"]::after {
content: "\201d";
}
/* Intermediate headline. */
.rubric {
font-family: "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif
}
/* ".. container::" lead, block text float around image. */
.lead {
clear: both;
width: 100%;
}
a {
text-decoration: none;
}
/* Mark external links. */
a.external {
color: #656AE0;
@ -303,33 +135,11 @@ a.external {
color: #2980B9;
}
/* Draws a box around menuselection role. */
.menuselection {
font-family: "Lato", "proxima-nova", "Helvetica Neue", Arial, sans-serif;
font-size: 90%;
font-weight: normal;
background-color: rgba(255, 255, 255, 0.65);
border: solid #E1E4E5 1px;
padding: 2px 5px;
border-radius: .4em;
}
@media screen and (max-width: 420px) {
.menuselection {
white-space: normal
}
}
.caption .menuselection {
background-color: transparent;
border: none;
}
/* Remove indent on line break. */
.rst-content .line-block {
margin-left: 0px
}
/* Applied on main index:sections. */
.global-index-toc {
@ -339,7 +149,7 @@ a.external {
/* Start section cards. */
.toc-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
grid-gap: 20px;
list-style-type: none;
margin-bottom: 24px;
@ -379,20 +189,19 @@ a.external {
}
.card dl dt {
padding: 18px 15px 0px !important
padding: 0px 15px 0px !important
}
.card dl dd {
padding: 0px 15px 5px 15px;
font-style: normal;
margin: 0px;
color: #808080;
color: var(--color-foreground-secondary);
font-size: 90%;
}
.card {
box-shadow: rgba(0, 0, 0, 0.05) 0px 1px 4px 0px,
rgba(211, 216, 223, 0.33) 0px 15px 20px -1px;
box-shadow: 0 .2rem .5rem rgba(0, 0, 0, .05), 0 0 .0625rem rgba(0, 0, 0, .1);
}
#getting-started .card {
@ -402,107 +211,22 @@ a.external {
/* End section cards. */
/* Start custom toctree. */
.toctree-wrapper .toctree-l1>a {
margin-bottom: 0.15em
}
/* Indent all lines following the first. */
.toctree-wrapper * a {
display: block;
width: 90%;
text-indent: -1em;
margin-left: 1em;
/*invert indent*/
padding-top: 0.25em;
line-height: 1.25em;
}
.toctree-wrapper ul {
width: 90%;
list-style: none;
padding-left: 0;
}
/* Underline provided by nested ul (not li). */
.toctree-wrapper * ul {
border-top: solid var(--color-background-border) 2px;
padding-left: 2em;
border-top: solid #ececec 1px;
}
.toctree-wrapper>ul {
margin-left: 1em
}
.rst-content .toctree-wrapper ul li ul {
margin-bottom: 0.75em;
padding-top: 0.5em;
}
.rst-content .toctree-wrapper ul li a:hover {
color: #25afef
}
.rst-content .toctree-wrapper ul li a:visited:hover {
color: #C961DA
}
.toctree-wrapper .toctree-l1>a {
font-size: 104%
}
.toctree-wrapper .toctree-l2>a {
font-size: 102%
}
.toctree-wrapper .toctree-l3>a {
font-size: 100%
}
.toctree-wrapper .toctree-l1>ul {
border-color: #bfbfbf
}
.toctree-wrapper .toctree-l2>ul {
border-color: #e1e0e0
}
.toctree-wrapper .toctree-l3>ul {
border-color: #ececec
}
/* Remove list styling, css rule hierarchy. */
.rst-content .toctree-wrapper ul li,
.rst-content .toctree-wrapper ul li li,
.rst-content .toctree-wrapper ul li li li {
list-style-type: none;
margin-left: 0px;
}
/* End custom toctree. */
/* Start genindex consistency. */
.genindextable * strong {
font-weight: normal
}
.genindex-jumpbox {
margin-bottom: 1.245em
}
.indextable {
margin-bottom: 1.245em
}
/* End genindex consistency. */
/* Correctly display keyboard shortcuts inside definition lists (theme.css explicitly excludes this case for some reason) */
dt>kbd {
font-weight: normal;
font-size: 80%;
background-color: #fff;
border: 1px solid #a6a6a6;
border-radius: 4px;
box-shadow: 0 2px grey;
padding: 2.4px 6px;
margin: auto 0;
}
/* Fixes to field list, see #104636 */
.field-list {
grid-template-columns: fit-content(24px) auto !important;
}
/* End custom toctree. */

View File

@ -14,36 +14,38 @@
}
#versionwrap {
margin: 0;
display: flex;
padding-top: 2px;
font-size: 90%;
padding-left: 0;
font-size: var(--sidebar-item-font-size);
justify-content: center;
flex-wrap: wrap;
}
#versionwrap>ul {
list-style: none;
}
#versionwrap>li {
display: flex;
width: 50%;
}
.version-btn {
display: inline-block;
background-color: #272525;
width: 140px;
background-color: var(--color-sidebar-background);
width: 100%;
text-align: center;
padding: 3px 10px;
margin: 0px 5px 4px;
vertical-align: middle;
color: #27AE60;
border: solid 1px #444444;
color: var(--color-link);
border: solid 1px var(--color-sidebar-background-border);
border-radius: 3px;
cursor: pointer;
z-index: 400;
transition: border-color 0.4s;
}
.version-btn::after {
content: "\f0d8";
display: inline;
font: normal normal normal 16px/1 FontAwesome;
color: #8d8c8c;
vertical-align: top;
padding-left: 0.5em;
}
.version-btn-open::after {
@ -57,7 +59,7 @@
.version-btn-open {
color: gray;
border: solid 1px gray;
border: solid 1px var(--color-sidebar-background-border);
}
.version-btn.wait {
@ -73,7 +75,7 @@
display: none;
position: absolute;
bottom: 28px;
width: 140px;
width: 50%;
margin: 0 5px;
padding-bottom: 4px;
background-color: #0003;
@ -81,6 +83,7 @@
box-shadow: 0 0 6px #000C;
z-index: 999;
max-height: calc(100vh - 30px);
overflow-x: clip;
overflow-y: auto;
cursor: default;
}
@ -90,15 +93,17 @@
color: black;
text-align: center;
font-size: 102%;
background-color: #27ae60;
border-bottom: solid 1.5px #444;
background-color: var(--color-brand-primary);
border-bottom: solid 1.5px var(--color-sidebar-background-border);
}
.version-list {
padding-left: 0;
margin-top: 0;
margin-bottom: 4px;
text-align: center;
background-color: #000C;
border: solid 1px gray;
border: solid 1px var(--color-sidebar-background-border);
border-radius: 0px 0px 3px 3px;
}
@ -112,12 +117,12 @@
width: 100%;
margin: 0;
padding: 4px 0px;
color: #404040;
color: var(--color-sidebar-link-text);
}
.version-list li {
background-color: #ede9e9;
color: #404040;
background-color: var(--color-sidebar-background);
color: var(--color-sidebar-link-text);
padding: 1px;
}
@ -134,17 +139,4 @@
.version-list li.selected span {
cursor: default;
outline-color: red;
}
.version-arrow {
position: absolute;
width: 8px;
height: 8px;
left: 50%;
bottom: 4px;
margin-left: -4px;
transform: rotate(225deg);
background: #ede9e9;
border: 1px solid gray;
border-width: 1px 0 0 1px;
}
}

View File

@ -118,11 +118,11 @@ gettext_allow_fuzzy_translations = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "default"
html_theme = "basic"
try:
import sphinx_rtd_theme
html_theme = "sphinx_rtd_theme"
del sphinx_rtd_theme
import furo
html_theme = "furo"
del furo
except ModuleNotFoundError:
pass
@ -135,21 +135,30 @@ html_theme_options = {}
# the configuration directory.
html_theme_path = []
if html_theme == "sphinx_rtd_theme":
if html_theme == "furo":
html_theme_options = {
"analytics_id": "UA-1418081-1",
# included in the title
"display_version": False,
"collapse_navigation": True,
"navigation_depth": -1,
"source_edit_link": "https://projects.blender.org/blender/blender-manual/src/branch/main/manual/{filename}",
}
extensions.append('sphinx_rtd_theme')
html_sidebars = {
"**": [
"sidebar/brand.html",
"sidebar/search.html",
"sidebar/scroll-start.html",
"sidebar/navigation.html",
"sidebar/scroll-end.html",
"sidebar/variant-selector.html",
]
}
html_context = {
"analytics_id": "UA-1418081-1",
}
# The "title" for HTML documentation generated with Sphinx's own templates.
# This is appended to the <title> tag of individual pages, and
# used in the navigation bar as the "topmost" element.
html_title = "Blender Manual"
html_title = 'Blender %s Manual' % blender_version
# The base URL which points to the root of the HTML documentation.
# It is used to indicate the location of document using
@ -168,7 +177,7 @@ html_logo = "../build_files/theme/blender-logo.svg"
# the docs, or URL that points an image file for the favicon.
html_favicon = "../build_files/theme/favicon.ico"
if html_theme == "sphinx_rtd_theme":
if html_theme == "furo":
html_css_files = ["css/theme_overrides.css",
"css/version_switch.css"]
html_js_files = ["js/version_switch.js"]

View File

@ -13,7 +13,7 @@ sphinx-intl==2.1.0
# Only needed to match the theme used for the official documentation.
# Without this theme, the default theme will be used.
sphinx_rtd_theme==2.0.0
furo==2024.1.29
# Only for convenience, allows live updating while editing RST files.
# Access by running: