Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 9, 2022
1 parent 47054df commit 5ba9e3b
Show file tree
Hide file tree
Showing 10 changed files with 481 additions and 448 deletions.
33 changes: 21 additions & 12 deletions src/sphinx_ansible_theme/built_with.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
{% if show_built_with %}
{%- set sphinx_web = '<a href="https://www.sphinx-doc.org/">Sphinx</a>' %}
{%- set ansible_community_web = '<a href="https://docs.ansible.com/ansible/4/community/">Ansible Community</a>' %}
{#- Translators: the variable "sphinx_web" is a link to the Sphinx project documentation with the text "Sphinx" #}
{%- trans sphinx_web=sphinx_web %}Built with {{ sphinx_web }} using a{% endtrans %}
{#- Translators: "theme" refers to a theme for Sphinx, which alters the appearance of the generated documenation #}
<a href="https://sphinx-ansible-theme.rtfd.io">{% trans %}Sphinx Ansible Theme{% endtrans %}</a>
{% trans %}that is based on the{% endtrans %}
<a href="https://github.com/readthedocs/sphinx_rtd_theme">{% trans %}Read the Docs theme{% endtrans %}</a>
{#- Translators: this is always used as "provided by Read the Docs", and should not imply Read the Docs is an author of the generated documentation. #}
{% trans ansible_community_web=ansible_community_web %}and is maintained by the {{ ansible_community_web }}{% endtrans %}.
{% endif %}
{% if show_built_with %} {%- set sphinx_web = '<a
href="https://www.sphinx-doc.org/"
>Sphinx</a
>' %} {%- set ansible_community_web = '<a
href="https://docs.ansible.com/ansible/4/community/"
>Ansible Community</a
>' %} {#- Translators: the variable "sphinx_web" is a link to the Sphinx project
documentation with the text "Sphinx" #} {%- trans sphinx_web=sphinx_web %}Built
with {{ sphinx_web }} using a{% endtrans %} {#- Translators: "theme" refers to a
theme for Sphinx, which alters the appearance of the generated documenation #}
<a href="https://sphinx-ansible-theme.rtfd.io"
>{% trans %}Sphinx Ansible Theme{% endtrans %}</a
>
{% trans %}that is based on the{% endtrans %}
<a href="https://github.com/readthedocs/sphinx_rtd_theme"
>{% trans %}Read the Docs theme{% endtrans %}</a
>
{#- Translators: this is always used as "provided by Read the Docs", and should
not imply Read the Docs is an author of the generated documentation. #} {% trans
ansible_community_web=ansible_community_web %}and is maintained by the {{
ansible_community_web }}{% endtrans %}. {% endif %}
39 changes: 29 additions & 10 deletions src/sphinx_ansible_theme/extrabody.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

{%- if theme_tag_manager_id %}
<!-- Google Tag Manager -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ theme_tag_manager_id }}" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','{{ theme_tag_manager_id }}');</script>
<noscript
><iframe
src="https://www.googletagmanager.com/ns.html?id={{ theme_tag_manager_id }}"
height="0"
width="0"
style="display: none; visibility: hidden"
></iframe
></noscript>
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "{{ theme_tag_manager_id }}");
</script>
<!-- End Google Tag Manager -->
{%- endif %}

{% if theme_topbar_links and theme_topbar_links is mapping -%}
{%- endif %} {% if theme_topbar_links and theme_topbar_links is mapping -%}
<div class="DocSite-globalNav ansibleNav">
<ul>
{%- for anchor, url in theme_topbar_links.items() %}
Expand All @@ -17,10 +33,13 @@
</div>
{%- endif %}

<a class="DocSite-nav" href="/" style="padding-bottom: 30px;">

<img class="DocSiteNav-logo"
<a class="DocSite-nav" href="/" style="padding-bottom: 30px">
<img
class="DocSiteNav-logo"
src="{{ pathto(ansible_logo_url, 1) }}"
alt="{{ _('Ansible Logo') }}">
<div class="DocSiteNav-title">{{ shorttitle | default('Documentation') }}</div>
alt="{{ _('Ansible Logo') }}"
/>
<div class="DocSiteNav-title">
{{ shorttitle | default('Documentation') }}
</div>
</a>
36 changes: 22 additions & 14 deletions src/sphinx_ansible_theme/extrafooter.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@
{%- if theme_hubspot_id %}
<!-- begin analytics -->
<script>
var _hsq = _hsq || [];
_hsq.push(["setContentType", "standard-page"]);
(function(d,s,i,r) {
if (d.getElementById(i)){return;}
var n = d.createElement(s),e = document.getElementsByTagName(s)[0];
n.id=i;n.src = 'https://js.hs-analytics.net/analytics/'+(Math.ceil(new Date()/r)*r)+'/{{ theme_hubspot_id }}.js';
e.parentNode.insertBefore(n, e);
})(document, "script", "hs-analytics",300000);
var _hsq = _hsq || [];
_hsq.push(["setContentType", "standard-page"]);
(function (d, s, i, r) {
if (d.getElementById(i)) {
return;
}
var n = d.createElement(s),
e = document.getElementsByTagName(s)[0];
n.id = i;
n.src =
"https://js.hs-analytics.net/analytics/" +
Math.ceil(new Date() / r) * r +
"/{{ theme_hubspot_id }}.js";
e.parentNode.insertBefore(n, e);
})(document, "script", "hs-analytics", 300000);
</script>
<!-- end analytics -->
{%- endif %}

{%- if theme_satellite_tracking | tobool %}
{%- endif %} {%- if theme_satellite_tracking | tobool %}
<script>
if (("undefined" !== typeof _satellite) && ("function" === typeof _satellite.pageBottom)) {
_satellite.pageBottom();
}
if (
"undefined" !== typeof _satellite &&
"function" === typeof _satellite.pageBottom
) {
_satellite.pageBottom();
}
</script>
{%- endif %}
48 changes: 31 additions & 17 deletions src/sphinx_ansible_theme/extrahead.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
<!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
{%- if theme_satellite_tracking | tobool %}
<script src="https://www.redhat.com/dtm.js"></script>
{%- endif %}

{% if theme_swift_id %}
{%- endif %} {% if theme_swift_id %}
<!-- <meta class="swiftype" name="published_at" data-type="date" content="2017-12-13" /> -->
<meta class="swiftype" name="version" data-type="string" content="{{ version }}">
{% endif %}

{%- if theme_tag_manager_id %}
<meta
class="swiftype"
name="version"
data-type="string"
content="{{ version }}"
/>
{% endif %} {%- if theme_tag_manager_id %}
<!-- Google Tag Manager Data Layer -->
<script>
dataLayer = [];
dataLayer = [];
</script>
<!-- End Google Tag Manager Data Layer -->
{%- endif %}

{% if theme_swift_id %}
{# Ansible search with Swift - do not remove #}
{%- endif %} {% if theme_swift_id %} {# Ansible search with Swift - do not
remove #}
<script>
(function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
(w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
})(window,document,'script','https://s.swiftypecdn.com/install/v2/st.js','_st');
(function (w, d, t, u, n, s, e) {
w["SwiftypeObject"] = n;
w[n] =
w[n] ||
function () {
(w[n].q = w[n].q || []).push(arguments);
};
s = d.createElement(t);
e = d.getElementsByTagName(t)[0];
s.async = 1;
s.src = u;
e.parentNode.insertBefore(s, e);
})(
window,
document,
"script",
"https://s.swiftypecdn.com/install/v2/st.js",
"_st"
);

_st('install','{{ theme_swift_id }}','2.0.0');
_st("install", "{{ theme_swift_id }}", "2.0.0");
</script>
{% endif %}
9 changes: 6 additions & 3 deletions src/sphinx_ansible_theme/extranav.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
{%- if theme_hubspot_id %}
<!-- changeable widget links to tower - do not change as image controlled by Ansible-->
<div id="sideBanner">
<br/>
<br />
<a href="https://www.ansible.com/docs-left?utm_source=docs">
<img style="border-width:0px;" src="https://cdn2.hubspot.net/hubfs/{{ theme_hubspot_id }}/docs-graphics/ASB-docs-left-rail.png" />
<img
style="border-width: 0px"
src="https://cdn2.hubspot.net/hubfs/{{ theme_hubspot_id }}/docs-graphics/ASB-docs-left-rail.png"
/>
</a>
<br/><br/><br/>
<br /><br /><br />
</div>
{%- endif %}
19 changes: 5 additions & 14 deletions src/sphinx_ansible_theme/footer.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
{#-
Reset `show_sphinx` to prevent the RTD theme from rendering it's
footer and introduce a new var to instead show our own:
#}
{% set show_built_with = show_sphinx %}
{% set show_sphinx = False %}

{%- extends "sphinx_rtd_theme/footer.html" %}

{%- block extrafooter %}
{{ super() }}

{%- include "built_with.html" %}
{%- endblock %}
{#- Reset `show_sphinx` to prevent the RTD theme from rendering it's footer and
introduce a new var to instead show our own: #} {% set show_built_with =
show_sphinx %} {% set show_sphinx = False %} {%- extends
"sphinx_rtd_theme/footer.html" %} {%- block extrafooter %} {{ super() }} {%-
include "built_with.html" %} {%- endblock %}
64 changes: 17 additions & 47 deletions src/sphinx_ansible_theme/layout.html
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
{#-
Declare logo and favicon fallbacks and
also set their Sphinx 4 `_url` counterparts:
#}
{%-
set ansible_logo_url = logo_url
or ('_static/' + (logo or 'images/Ansible-Mark-RGB_White.png'))
%}
{%- set logo_url = '' %}{# Reset to prevent render in the RTD theme #}
{%- set logo = logo_url %}
{%-
set favicon_url = favicon_url
or ('_static/' + (favicon or 'images/Ansible-Mark-RGB_Black.png'))
%}
{%- set favicon = favicon_url | replace('_static/', '', 1) %}
{%- set favicon_url = pathto(favicon_url, 1) if '//' not in favicon_url and not favicon_url.startswith('/') else favicon_url %}

{%- extends "sphinx_rtd_theme/layout.html" %}

{%- block extrahead %}
{%- include "extrahead.html" ignore missing %}
{%- endblock %}

{%- block extrabody %}
{%- include "extrabody.html" ignore missing %}
{%- endblock %}

{%- block document %}
{%- include "banner.html" ignore missing %}

{{ super() }}
{%- endblock %}

{%- block footer %}
{%- include "extrafooter.html" ignore missing %}
{%- endblock %}

{%- block menu %}
{{ super() }}

{%- if theme_show_extranav | tobool %}
{%- block extranav %}{% include "extranav.html" %}{% endblock %}
{%- endif %}
{%- block rtd_ethical_ads %}
{%- include "rtd-ethical-ads.html" %}
{%- endblock %}
{%- endblock %}
{#- Declare logo and favicon fallbacks and also set their Sphinx 4 `_url`
counterparts: #} {%- set ansible_logo_url = logo_url or ('_static/' + (logo or
'images/Ansible-Mark-RGB_White.png')) %} {%- set logo_url = '' %}{# Reset to
prevent render in the RTD theme #} {%- set logo = logo_url %} {%- set
favicon_url = favicon_url or ('_static/' + (favicon or
'images/Ansible-Mark-RGB_Black.png')) %} {%- set favicon = favicon_url |
replace('_static/', '', 1) %} {%- set favicon_url = pathto(favicon_url, 1) if
'//' not in favicon_url and not favicon_url.startswith('/') else favicon_url %}
{%- extends "sphinx_rtd_theme/layout.html" %} {%- block extrahead %} {%- include
"extrahead.html" ignore missing %} {%- endblock %} {%- block extrabody %} {%-
include "extrabody.html" ignore missing %} {%- endblock %} {%- block document %}
{%- include "banner.html" ignore missing %} {{ super() }} {%- endblock %} {%-
block footer %} {%- include "extrafooter.html" ignore missing %} {%- endblock %}
{%- block menu %} {{ super() }} {%- if theme_show_extranav | tobool %} {%- block
extranav %}{% include "extranav.html" %}{% endblock %} {%- endif %} {%- block
rtd_ethical_ads %} {%- include "rtd-ethical-ads.html" %} {%- endblock %} {%-
endblock %}
4 changes: 2 additions & 2 deletions src/sphinx_ansible_theme/rtd-ethical-ads.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{# Add the ethical ads div, when generating documentation on ReadTheDocs #}
{% if READTHEDOCS and theme_show_rtd_ethical_ads | tobool %}
{# Add the ethical ads div, when generating documentation on ReadTheDocs #} {%
if READTHEDOCS and theme_show_rtd_ethical_ads | tobool %}
<div
id="sphinx-ansible-theme-sidebar-ad-placement"
class="flat"
Expand Down
29 changes: 23 additions & 6 deletions src/sphinx_ansible_theme/searchbox.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
{%- if theme_display_version %}
{%- include "version_chooser.html" %}
{%- endif %}
{%- if 'singlehtml' not in builder %}
{%- if theme_display_version %} {%- include "version_chooser.html" %} {%- endif
%} {%- if 'singlehtml' not in builder %}
<div role="search">
<form id="rtd-search-form" class="wy-form"{% if not theme_swift_id %} action="{{ pathto('search') }}"{% endif %} method="get">
<form
id="rtd-search-form"
class="wy-form"
{%
if
not
theme_swift_id
%}
action="{{ pathto('search') }}"
{%
endif
%}
method="get"
>
<label class="sr-only" for="q">Search docs:</label>
<input type="text" class="st-default-search-input" id="q" name="q" placeholder="{{ _('Search docs') }}" />
<input
type="text"
class="st-default-search-input"
id="q"
name="q"
placeholder="{{ _('Search docs') }}"
/>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
Expand Down
Loading

0 comments on commit 5ba9e3b

Please sign in to comment.