Skip to content

Commit 9b7d498

Browse files
authored
docs: further accessibility improvements
1 parent 2dcfe68 commit 9b7d498

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

docs/modules/ROOT/pages/index.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ Alan Freitas <[email protected]>
66
:page-tags: mrdocs
77
:navtitle: Home
88

9-
image::MrDocsBanner.png[link=https://www.mrdocs.com]
9+
image::MrDocsBanner.png[]
1010

1111
- Automating {cpp} reference documentation significantly enhances usability by providing a navigable API and ensuring a single, up-to-date source of truth with minimal effort.
1212
- However, documenting {cpp} poses significant challenges due to discrepancies between the codebase and the public API. Doxygen remains a popular tool, yet it is suboptimal for {cpp} as it fails to fully comprehend {cpp} constructs and requires many transformation steps, including the incorporation of many macros within the {cpp} code. These macros maintain well-formed and ill-formed versions of the code, undermining the goal of unifying the source of truth.
1313
- Existing solutions frequently need better maintenance or usability issues, prompting users to revert to Doxygen.
1414
- An ideal solution would inherently understand {cpp} constructs, be actively maintained, and offer diverse options for customizing the output format.
1515
- Mr.Docs embodies these qualities. Supported by full-time developers from the {cpp} Alliance, Mr.Docs inherently comprehends {cpp} constructs without the need for macros and provides various output formats, customizable templates, and plugin support, ensuring it meets the demands of comprehensive and efficient documentation.
1616
17-
image::https://github.com/cppalliance/mrdocs/actions/workflows/ci.yml/badge.svg[]
18-
17+
image::https://github.com/cppalliance/mrdocs/actions/workflows/ci.yml/badge.svg[Continuous Integration: Passing]

docs/ui/src/partials/header-content.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<header class="header">
22
<nav class="nav navbar">
33
<div class="navbar-brand">
4-
<a class="navbar-item" href="{{{or site.url siteRootPath}}}">
4+
<a class="navbar-item" href="{{{or site.url siteRootPath}}}" aria-label="{{ site.title }} Home">
55
{{> logo }}
66
<span class="logo-text">{{site.title}}</span>
77
</a>
88
{{#if env.SITE_SEARCH_PROVIDER}}
9-
<div class="navbar-item search hide-for-print">
9+
<search class="navbar-item search hide-for-print">
1010
<div id="search-field" class="field">
1111
<input id="search-input" type="text" placeholder="Search the docs"{{#if page.home}} autofocus{{/if}}>
1212
</div>
13-
</div>
13+
</search>
1414
{{/if}}
1515
<button class="navbar-burger" aria-controls="topbar-nav" aria-expanded="false" aria-label="Toggle main menu">
1616
<span></span>

docs/ui/src/partials/nav-explore.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
<li class="version
1616
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} is-current{{/if~}}
1717
{{~#if (eq this ../latest)}} is-latest{{/if}}">
18-
<a href="{{{relativize ./url}}}">{{./displayVersion}}</a>
18+
<a href="{{{relativize ./url}}}"
19+
{{~#if (and (eq .. @root.page.component) (eq this @root.page.componentVersion))}} aria-current="page"{{/if~}}
20+
>{{./displayVersion}}</a>
1921
</li>
2022
{{/each}}
2123
</ul>

docs/ui/src/partials/nav-menu.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{#with page.navigation}}
22
<div class="nav-panel-menu is-active" data-panel="menu">
33
<nav class="nav-menu">
4-
<button class="nav-menu-toggle" aria-label="Toggle expand/collapse all" style="display: none"></button>
4+
<button class="nav-menu-toggle" aria-expanded="false" style="display: none"></button>
55
{{#with @root.page.componentVersion}}
66
<h3 class="title"><a href="{{{relativize ./url}}}">{{./title}}</a></h3>
77
{{/with}}

docs/ui/src/partials/toolbar.hbs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
<div class="toolbar" role="navigation">
1+
<nav class="toolbar">
22
{{> nav-toggle}}
3-
{{#with site.homeUrl}}
4-
<a href="{{{relativize this}}}" class="home-link{{#if @root.page.home}} is-current{{/if}}"></a>
5-
{{/with}}
63
{{> breadcrumbs}}
74
{{> page-versions}}
85
{{> edit-this-page}}
9-
</div>
6+
</nav>

docs/website/index.html.hbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<body>
3939
<nav class="nav container-fluid" aria-label="Main navigation">
4040
<div class="nav-section">
41-
<a href="/" class="logo-link" aria-label="MrDocs Home">
41+
<a href="/" class="logo-link" aria-label="{{ site.title }} Home">
4242
{{> logo }}
4343
<span class="logo-text">{{ page.title }}</span>
4444
</a>
@@ -49,7 +49,7 @@
4949
<li><a href="{{ href }}" class="secondary">{{ title }}</a></li>
5050
{{/each}}
5151
<li>
52-
<a href="{{ site.github.url }}" class="contrast" aria-label="{{ site.title}} GitHub repository">
52+
<a href="{{ site.github.url }}" class="contrast" aria-label="{{ site.title }} GitHub repository">
5353
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
5454
viewBox="0 0 496 512" height="16px">
5555
<path fill="currentColor"
@@ -66,8 +66,8 @@
6666
<h1>{{ title }}</h1>
6767
<p>{{ description }}</p>
6868
<div class="header-cta">
69-
<a href="docs/" class="secondary" role="button">Get started</a>
70-
<a href="docs/mrdocs/install.html" class="contrast outline" role="button">Download</a>
69+
<a href="docs/" class="secondary">Get started</a>
70+
<a href="docs/mrdocs/install.html" class="contrast outline">Download</a>
7171
</div>
7272
<div class="banner-snippet">
7373
<small><code>{{ banner.description }}</code></small>
@@ -188,7 +188,7 @@
188188
</footer>
189189
<script>
190190
// Initialize positions to match CSS exactly
191-
document.addEventListener('DOMContentLoaded', function() {
191+
document.addEventListener('DOMContentLoaded', () => {
192192
const root = document.documentElement;
193193
194194
// Set initial positions to exactly match CSS defaults

0 commit comments

Comments
 (0)