Skip to content

Commit

Permalink
doc: make doc version selector more obvious
Browse files Browse the repository at this point in the history
Move the doc version selector menu higher on the left nav to make it
more visible (from its prior bottom of the nav menu)

Signed-off-by: David B. Kinder <[email protected]>
  • Loading branch information
dbkinder authored and wenlingz committed Apr 9, 2019
1 parent 7745279 commit cca29cf
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
25 changes: 25 additions & 0 deletions doc/_templates/aversions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Project ACRN</span>
v: {{ current_version }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>{{ _('Document Versions') }}</dt>
{% for slug, url in versions %}
<dd><a href="{{ url }}">{{ slug }}</a></dd>
{% endfor %}
</dl>
<dl>
<dt>{{ _('projectacrn.org links') }}</dt>
<dd>
<a href="https://www.projectacrn.org/">Project Home</a>
</dd>
<dd>
<a href="https://github.com/projectacrn/acrn-hypervisor/wiki">Wiki</a>
</dd>
</dl>
</div>
</div>
14 changes: 14 additions & 0 deletions doc/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "!layout.html" %}
{% block document %}
{% if is_release %}
<div class="wy-alert wy-alert-danger">
The <a href="/{{ pagename }}.html">latest development version</a>
of this page may be more current than this released {{ version }} version.
</div>
{% endif %}
{{ super() }}
{% endblock %}
{% block menu %}
{% include "aversions.html" %}
{{ super() }}
{% endblock %}
26 changes: 1 addition & 25 deletions doc/_templates/versions.html
Original file line number Diff line number Diff line change
@@ -1,25 +1 @@
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Project ACRN</span>
v: {{ current_version }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>{{ _('Versions') }}</dt>
{% for slug, url in versions %}
<dd><a href="{{ url }}">{{ slug }}</a></dd>
{% endfor %}
</dl>
<dl>
<dt>{{ _('On projectacrn.org') }}</dt>
<dd>
<a href="https://www.projectacrn.org/">Project Home</a>
</dd>
<dd>
<a href="https://github.com/projectacrn/acrn-hypervisor/wiki">Wiki</a>
</dd>
</dl>
</div>
</div>
{# wipe out the versions.html from the rtd theme #}
5 changes: 1 addition & 4 deletions doc/static/acrn-custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@
font-weight: bold;
}

/* tweak doc version selection
/* tweak doc version selection */
.rst-versions {
position: static;
border-top: none;
padding: 0px;
}
*/

.rst-versions .rst-current-version {
padding: 5px;
Expand Down

0 comments on commit cca29cf

Please sign in to comment.