mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Added WAI-ARIA roles to themes (document, banner, navigation, main, contentinfo, note)
https://en.wikipedia.org/wiki/WAI-ARIA http://www.w3.org/TR/wai-aria/roles
This commit is contained in:
parent
dbd544d12b
commit
a08034fbb8
@ -11,7 +11,7 @@
|
||||
{%- extends "basic/layout.html" %}
|
||||
|
||||
{% block header %}
|
||||
<div class="header-wrapper">
|
||||
<div class="header-wrapper" role="banner">
|
||||
<div class="header">
|
||||
{%- if logo %}
|
||||
<p class="logo"><a href="{{ pathto(master_doc) }}">
|
||||
@ -22,7 +22,7 @@
|
||||
<div class="headertitle"><a
|
||||
href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a></div>
|
||||
{%- endblock %}
|
||||
<div class="rel">
|
||||
<div class="rel" role="navigation" aria-label="related navigation">
|
||||
{%- for rellink in rellinks|reverse %}
|
||||
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
|
||||
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
|
||||
@ -47,16 +47,18 @@
|
||||
{{ toctree() }}
|
||||
{%- endblock %}
|
||||
{%- block sidebarsearch %}
|
||||
<h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
|
||||
<form class="search" action="{{ pathto('search') }}" method="get">
|
||||
<input type="text" name="q" />
|
||||
<input type="submit" value="{{ _('Go') }}" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
<p class="searchtip" style="font-size: 90%">
|
||||
{{ _('Enter search terms or a module, class or function name.') }}
|
||||
</p>
|
||||
<div role="search">
|
||||
<h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
|
||||
<form class="search" action="{{ pathto('search') }}" method="get">
|
||||
<input type="text" name="q" />
|
||||
<input type="submit" value="{{ _('Go') }}" />
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
</form>
|
||||
<p class="searchtip" style="font-size: 90%">
|
||||
{{ _('Enter search terms or a module, class or function name.') }}
|
||||
</p>
|
||||
</div>
|
||||
{%- endblock %}
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
@ -68,16 +70,20 @@
|
||||
<div class="footer-wrapper">
|
||||
<div class="footer">
|
||||
<div class="left">
|
||||
{%- for rellink in rellinks|reverse %}
|
||||
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
|
||||
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
|
||||
{%- if not loop.last %}{{ reldelim2 }}{% endif %}
|
||||
{%- endfor %}
|
||||
{%- if show_source and has_source and sourcename %}
|
||||
<br/>
|
||||
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
|
||||
rel="nofollow">{{ _('Show Source') }}</a>
|
||||
{%- endif %}
|
||||
<div role="navigation" aria-label="related navigaton">
|
||||
{%- for rellink in rellinks|reverse %}
|
||||
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
|
||||
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
|
||||
{%- if not loop.last %}{{ reldelim2 }}{% endif %}
|
||||
{%- endfor %}
|
||||
</div>
|
||||
<div role="note" aria-label="source link">
|
||||
{%- if show_source and has_source and sourcename %}
|
||||
<br/>
|
||||
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
|
||||
rel="nofollow">{{ _('Show Source') }}</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
|
@ -25,7 +25,7 @@
|
||||
{%- endif %}
|
||||
|
||||
{%- macro relbar() %}
|
||||
<div class="related">
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>{{ _('Navigation') }}</h3>
|
||||
<ul>
|
||||
{%- for rellink in rellinks %}
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
{%- macro sidebar() %}
|
||||
{%- if render_sidebar %}
|
||||
<div class="sphinxsidebar">
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
{%- block sidebarlogo %}
|
||||
{%- if logo %}
|
||||
@ -152,7 +152,7 @@
|
||||
{%- endblock %}
|
||||
{%- block extrahead %} {% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<body role="document">
|
||||
{%- block header %}{% endblock %}
|
||||
|
||||
{%- block relbar1 %}{{ relbar() }}{% endblock %}
|
||||
@ -166,7 +166,7 @@
|
||||
{%- if render_sidebar %}
|
||||
<div class="bodywrapper">
|
||||
{%- endif %}
|
||||
<div class="body">
|
||||
<div class="body" role="main">
|
||||
{% block body %} {% endblock %}
|
||||
</div>
|
||||
{%- if render_sidebar %}
|
||||
@ -183,7 +183,7 @@
|
||||
{%- block relbar2 %}{{ relbar() }}{% endblock %}
|
||||
|
||||
{%- block footer %}
|
||||
<div class="footer">
|
||||
<div class="footer" role="contentinfo">
|
||||
{%- if show_copyright %}
|
||||
{%- if hasdoc('copyright') %}
|
||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
|
||||
|
@ -8,7 +8,7 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- if pagename != "search" %}
|
||||
<div id="searchbox" style="display: none">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3>{{ _('Quick search') }}</h3>
|
||||
<form class="search" action="{{ pathto('search') }}" method="get">
|
||||
<input type="text" name="q" />
|
||||
|
@ -8,9 +8,11 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
#}
|
||||
{%- if show_source and has_source and sourcename %}
|
||||
<h3>{{ _('This Page') }}</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
|
||||
rel="nofollow">{{ _('Show Source') }}</a></li>
|
||||
</ul>
|
||||
<div role="note" aria-label="source link">
|
||||
<h3>{{ _('This Page') }}</h3>
|
||||
<ul class="this-page-menu">
|
||||
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
|
||||
rel="nofollow">{{ _('Show Source') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{%- endif %}
|
||||
|
@ -32,7 +32,7 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% block content %}
|
||||
<div class="header">
|
||||
<div class="header" role="banner">
|
||||
{%- block haikuheader %}
|
||||
{%- if theme_full_logo != "false" %}
|
||||
<a href="{{ pathto('index') }}">
|
||||
@ -48,7 +48,7 @@
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
</div>
|
||||
<div class="topnav">
|
||||
<div class="topnav" role="navigation" aria-label="top navigation">
|
||||
{{ nav() }}
|
||||
</div>
|
||||
<div class="content">
|
||||
@ -60,7 +60,7 @@
|
||||
{%- endif %}#}
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
<div class="bottomnav">
|
||||
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
|
||||
{{ nav() }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
{% block header %}
|
||||
{%- if logo %}
|
||||
<div class="header">
|
||||
<div class="header" role="banner">
|
||||
<div class="logo">
|
||||
<a href="{{ pathto(master_doc) }}">
|
||||
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
|
||||
|
@ -20,7 +20,7 @@
|
||||
<h1 class="heading"><a href="{{ pathto('index') }}"
|
||||
title="back to the documentation overview"><span>{{ title|striptags|e }}</span></a></h1>
|
||||
</div>
|
||||
<div class="relnav">
|
||||
<div class="relnav" role="navigation" aria-label="related navigation">
|
||||
{%- if prev %}
|
||||
<a href="{{ prev.link|e }}">« {{ prev.title }}</a> |
|
||||
{%- endif %}
|
||||
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
<div id="contentwrapper">
|
||||
{%- if display_toc %}
|
||||
<div id="toc">
|
||||
<div id="toc" role="navigation" aria-label="table of contents navigation">
|
||||
<h3>{{ _('Table Of Contents') }}</h3>
|
||||
{{ toc }}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user