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,18 +1,19 @@
<ul class="wy-breadcrumbs"> <div role="navigation" aria-label="breadcrumbs navigation">
<li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li> <ul class="wy-breadcrumbs">
{% for doc in parents %} <li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li> {% for doc in parents %}
{% endfor %} <li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
<li>{{ title }}</li> {% endfor %}
<li class="wy-breadcrumbs-aside"> <li>{{ title }}</li>
{% if display_github %} <li class="wy-breadcrumbs-aside">
<a href="https://github.com/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}.rst" class="icon icon-github"> Edit on GitHub</a> {% if display_github %}
{% elif display_bitbucket %} <a href="https://github.com/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}.rst" class="icon icon-github"> Edit on GitHub</a>
<a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}.rst" class="icon icon-bitbucket"> Edit on Bitbucket</a> {% elif display_bitbucket %}
{% elif show_source and has_source and sourcename %} <a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}.rst" class="icon icon-bitbucket"> Edit on Bitbucket</a>
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a> {% elif show_source and has_source and sourcename %}
{% endif %} <a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a>
</li> {% endif %}
</ul> </li>
<hr/> </ul>
<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,19 +12,21 @@
<hr/> <hr/>
<p> <div role="contentinfo">
{%- if show_copyright %} <p>
{%- if hasdoc('copyright') %} {%- if show_copyright %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} {%- if hasdoc('copyright') %}
{%- else %} {% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %} {%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
{%- endif %}
{%- endif %} {%- endif %}
{%- endif %}
{%- if last_updated %} {%- if last_updated %}
{% 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" %}
{% block body %}{% endblock %} <div role="main">
{% 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">
<input type="text" name="q" placeholder="Search docs" /> <form id ="rtd-search-form" class="wy-form" action="{{ pathto('search') }}" method="get">
<input type="hidden" name="check_keywords" value="yes" /> <input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="area" value="default" /> <input type="hidden" name="check_keywords" value="yes" />
</form> <input type="hidden" name="area" value="default" />
</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 }}