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,4 +1,5 @@
<ul class="wy-breadcrumbs"> <div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li> <li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
{% for doc in parents %} {% for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li> <li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
@ -13,6 +14,6 @@
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a> <a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a>
{% endif %} {% endif %}
</li> </li>
</ul> </ul>
<hr/> <hr/>
</div>

View File

@ -1,6 +1,6 @@
<footer> <footer>
{% if next or prev %} {% if next or prev %}
<div class="rst-footer-buttons"> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
{% if next %} {% 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> <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 %} {% endif %}
@ -12,6 +12,7 @@
<hr/> <hr/>
<div role="contentinfo">
<p> <p>
{%- if show_copyright %} {%- if show_copyright %}
{%- if hasdoc('copyright') %} {%- if hasdoc('copyright') %}
@ -25,6 +26,7 @@
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
{%- endif %} {%- endif %}
</p> </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 %} {% 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> </footer>

View File

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

View File

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

View File

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