summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2020-02-11 22:00:56 +0100
committerGitHub <noreply@github.com>2020-02-11 15:00:56 -0600
commitaeade1412f3fb3f4c3449a62cbc12fc3ffac00c6 (patch)
tree11d4c7966a3e8bdb7f6cbe61e2663dffd235103a /docs
parentb49d1d9810a1ac9797c279082fcbe13adb34c649 (diff)
downloadansible-aeade1412f3fb3f4c3449a62cbc12fc3ffac00c6.tar.gz
Docs: improve anchors vs. header bar (#67244) (#67317)
(cherry picked from commit fd43619f1a47be784a016431346531ad7d2dd71c)
Diffstat (limited to 'docs')
-rw-r--r--docs/docsite/_static/ansible.css22
-rw-r--r--docs/templates/plugin.rst.j215
2 files changed, 22 insertions, 15 deletions
diff --git a/docs/docsite/_static/ansible.css b/docs/docsite/_static/ansible.css
index 3183b07095..1d36512447 100644
--- a/docs/docsite/_static/ansible.css
+++ b/docs/docsite/_static/ansible.css
@@ -35,15 +35,6 @@ tr .ansibleOptionLink::after {
content: "";
font-family: FontAwesome;
}
-tr .ansibleOptionLink::before {
- font-family: "FontAwesome";
- display: inline-block;
- font-style: normal;
- font-weight: normal;
- line-height: 1;
- text-decoration: inherit;
- -webkit-font-smoothing: antialiased;
-}
tr .ansibleOptionLink {
visibility: hidden;
display: inline-block;
@@ -52,3 +43,16 @@ tr .ansibleOptionLink {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
+
+@media screen and (min-width:767px){
+ /* Move anchors a bit up so that they aren't hidden by the header bar */
+ section [id] {
+ padding-top: 45px;
+ margin-top: -45px;
+ }
+ /* Without this, for example most links in the page's TOC aren't usable anymore */
+ section a[id] {
+ padding-top: 0;
+ margin-top: 0;
+ }
+} \ No newline at end of file
diff --git a/docs/templates/plugin.rst.j2 b/docs/templates/plugin.rst.j2
index af99932fe9..b829dd42a5 100644
--- a/docs/templates/plugin.rst.j2
+++ b/docs/templates/plugin.rst.j2
@@ -106,15 +106,16 @@ Parameters
<th width="100%">Comments</th>
</tr>
{% for key, value in options|dictsort recursive %}
- <tr id="parameter-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}">
+ <tr>
{# indentation based on nesting level #}
{% for i in range(1, loop.depth) %}
<td class="elbow-placeholder"></td>
{% endfor %}
{# parameter name with required and/or introduced label #}
<td colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@">
+ <div class="ansibleOptionAnchor" id="parameter-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}"></div>
<b>@{ key }@</b>
- <a class="ansibleOptionLink" href="#parameter-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}" title="Permalink to this option">¶</a>
+ <a class="ansibleOptionLink" href="#parameter-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">@{ value.type | documented_type }@</span>
{% if value.get('elements') %} / <span style="color: purple">elements=@{ value.elements | documented_type }@</span>{% endif %}
@@ -283,13 +284,14 @@ Facts returned by this module are added/updated in the ``hostvars`` host facts a
<th width="100%">Description</th>
</tr>
{% for key, value in returnfacts|dictsort recursive %}
- <tr id="return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}">
+ <tr>
{% for i in range(1, loop.depth) %}
<td class="elbow-placeholder"></td>
{% endfor %}
<td colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@" colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@">
+ <div class="ansibleOptionAnchor" id="return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}"></div>
<b>@{ key }@</b>
- <a class="ansibleOptionLink" href="#return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}" title="Permalink to this fact">¶</a>
+ <a class="ansibleOptionLink" href="#return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}" title="Permalink to this fact"></a>
<div style="font-size: small">
<span style="color: purple">@{ value.type | documented_type }@</span>
{% if value.elements %} / <span style="color: purple">elements=@{ value.elements | documented_type }@</span>{% endif %}
@@ -359,13 +361,14 @@ Common return values are documented :ref:`here <common_return_values>`, the foll
<th width="100%">Description</th>
</tr>
{% for key, value in returndocs|dictsort recursive %}
- <tr id="return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}">
+ <tr>
{% for i in range(1, loop.depth) %}
<td class="elbow-placeholder">&nbsp;</td>
{% endfor %}
<td colspan="@{ from_kludge_ns('maxdepth') - loop.depth0 }@">
+ <div class="ansibleOptionAnchor" id="return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}"></div>
<b>@{ key }@</b>
- <a class="ansibleOptionLink" href="#return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}" title="Permalink to this return value">¶</a>
+ <a class="ansibleOptionLink" href="#return-{% for part in value.full_key %}@{ part }@{% if not loop.last %}/{% endif %}{% endfor %}" title="Permalink to this return value"></a>
<div style="font-size: small">
<span style="color: purple">@{ value.type | documented_type }@</span>
{% if value.elements %} / <span style="color: purple">elements=@{ value.elements | documented_type }@</span>{% endif %}