Added WAI-ARIA roles (document, navigation, main, note, contentinfo, search)

Navigation: main, top, breadcrumbs, footer

https://en.wikipedia.org/wiki/WAI-ARIA

http://www.w3.org/TR/wai-aria/roles
This commit is contained in:
westurner 2014-01-14 19:54:37 -06:00
parent c4a37ff44c
commit b4ea8d5196
5 changed files with 47 additions and 40 deletions

View File

@ -1,3 +1,4 @@
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
{% for doc in parents %}
@ -15,4 +16,4 @@
</li>
</ul>
<hr/>
</div>

View File

@ -1,6 +1,6 @@
<footer>
{% if next or prev %}
<div class="rst-footer-buttons">
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
{% if next %}
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}"/>Next <span class="icon icon-circle-arrow-right"></span></a>
{% endif %}
@ -12,6 +12,7 @@
<hr/>
<div role="contentinfo">
<p>
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
@ -25,6 +26,7 @@
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
{%- endif %}
</p>
</div>
{% trans %}<a href="https://github.com/snide/sphinx_rtd_theme">Sphinx theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>{% endtrans %}
</footer>

View File

@ -98,7 +98,7 @@
</head>
<body class="wy-body-for-nav">
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
@ -109,7 +109,7 @@
{% include "searchbox.html" %}
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix">
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
{% set toctree = toctree(maxdepth=2, collapse=False, includehidden=True) %}
{% if toctree %}
{{ toctree }}
@ -124,7 +124,7 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
{# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
<nav class="wy-nav-top">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="icon icon-reorder"></i>
<a href="{{ pathto(master_doc) }}">{{ project }}</a>
</nav>
@ -134,7 +134,9 @@
<div class="wy-nav-content">
<div class="rst-content">
{% include "breadcrumbs.html" %}
<div role="main">
{% block body %}{% endblock %}
</div>
{% include "footer.html" %}
</div>
</div>

View File

@ -1,5 +1,7 @@
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="{{ pathto('search') }}" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>

View File

@ -1,6 +1,6 @@
{% if READTHEDOCS %}
{# Add rst-badge after rst-versions for small badge style. #}
<div class="rst-versions" data-toggle="rst-versions">
<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="icon icon-book"> Read the Docs</span>
v: {{ current_version }}