Repository navigation
Conversation
The guide used a 2017 copy of the minified default Asciidoctor stylesheet, changed only for a sans-serif body (WICKET-6372), and it had no syntax highlighting at all: the pom passed <sourceHighlighter>, which asciidoctor-maven-plugin 2.x does not know and silently ignores, so every listing rendered as plain text. The page also loaded Font Awesome from cdnjs for the admonition icons. The guide now keeps the plugin's default stylesheet and adds a small override through docinfo, in the design of the project site: its colour tokens, its self-hosted Alegreya and JetBrains Mono fonts (SIL OFL, licences alongside) and its Rouge colours. Rouge is set through the source-highlighter attribute. A masthead links to the site, the Javadoc of the line and the other versions; the table of contents follows the section being read and opens only that chapter; listings get a language label and a copy button, and wicket:id and the wicket: tags are marked in HTML samples; admonitions become asides; a dark mode follows the system setting. Webfonts and the icon font are off, so the page makes no external requests. The body text moves back to a serif, as on the site, which reverses WICKET-6372. The PDF keeps its font icons and is otherwise unchanged. The design tokens are copied from the site's _sass/ribbon/_base.scss and have to be kept in step with it by hand. LICENSE lists the fonts under the SIL Open Font License next to the fonts of the examples, and .rat-excludes covers their licence texts. The Asciidoctor (MIT) entry and licenses/LICENSE-asciidoctor.txt go, as the copied stylesheet they covered is gone from the source tree. GitHub issue #1844 Generated-by: Claude Code (Claude Opus 5.5)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1845 +/- ##
============================================
+ Coverage 62.70% 62.72% +0.01%
- Complexity 11507 11514 +7
============================================
Files 1254 1254
Lines 48660 48665 +5
Branches 6844 6845 +1
============================================
+ Hits 30512 30523 +11
+ Misses 15468 15467 -1
+ Partials 2680 2675 -5 🚀 New features to boost your workflow:
|
papegaaij
left a comment
There was a problem hiding this comment.
A few smaller accessibility points, optional but worth it now that the guide gets an accessibility chapter:
- There's no skip link past the masthead and the 40-plus links of the TOC, and the generated HTML has no
<main>or labelled<nav>. A "Skip to content" link indocinfo-header.htmlthat shows on focus, plusrole="main"on#contentandrole="navigation"witharia-label="Table of contents"on#tocfromguide.js, would cover it. - All 539 copy buttons are named "Copy". An
aria-labelbuilt from the language the bar already shows ("Copy Java code") makes a screen reader's button list usable. aria-liveon the button itself is announced inconsistently (NVDA often reads it, VoiceOver often doesn't). One visually hiddenrole="status"element on the page that receives "Copied" is the reliable pattern.
| limitations under the License. | ||
| --> | ||
| <header class="mast"> | ||
| <a class="mast-brand" href="https://wicket.apache.org/"><img src="./img/wicket-mark.svg" alt="" width="30" height="30"><span>Apache Wicket</span></a> |
There was a problem hiding this comment.
Below 640px wicket.css hides the "Apache Wicket" span with display: none, which hides it from screen readers too. The image has alt="", so on a phone this link has no accessible name and is announced as just "link" (WCAG 2.4.4, 4.1.2). An aria-label names it at every width and matches the visible text on wide screens (2.5.3):
| <a class="mast-brand" href="https://wicket.apache.org/"><img src="./img/wicket-mark.svg" alt="" width="30" height="30"><span>Apache Wicket</span></a> | |
| <a class="mast-brand" href="https://wicket.apache.org/" aria-label="Apache Wicket"><img src="./img/wicket-mark.svg" alt="" width="30" height="30"><span>Apache Wicket</span></a> |
There was a problem hiding this comment.
Done in 7c743a4: the brand link has aria-label="Apache Wicket".
| .js-toc #toc li > ul { display: none; } | ||
| .js-toc #toc li.is-open > ul { display: block; } |
There was a problem hiding this comment.
A chapter's sections open only by scrolling to it. display: none takes them out of the tab order and away from screen readers, so a keyboard user can't reach "Accessibility → Testing" from the TOC: activating the chapter link moves focus into the content, and Shift+Tab from there doesn't lead back to the TOC. Opening a chapter while focus is inside it fixes that for keyboard users. Tabbing onto a chapter link shows its sections, and the next Tab goes into them:
| .js-toc #toc li > ul { display: none; } | |
| .js-toc #toc li.is-open > ul { display: block; } | |
| .js-toc #toc li > ul { display: none; } | |
| .js-toc #toc li.is-open > ul, .js-toc #toc li:focus-within > ul { display: block; } |
Two related points:
guide.jscould setaria-current="location"next to theis-currentclass (and remove it with the class), so the current entry isn't conveyed by colour alone.- Screen readers in browse mode don't always move focus, so
:focus-withindoesn't fully help them. A disclosure button witharia-expandedper chapter would, at the cost of more script.
There was a problem hiding this comment.
Done in 7c743a4: :focus-within opens the chapter, and guide.js sets aria-current="location" together with is-current. I left out the disclosure buttons for now. With the skip link, the landmarks and :focus-within, keyboard users can reach every section, so I'd rather see whether browse-mode users actually miss them before adding the extra script.
| pre.rouge .se, pre.rouge .sh, pre.rouge .si, pre.rouge .sx, pre.rouge .sr, pre.rouge .ss, pre.rouge .dl { color: var(--code-green); } | ||
| pre.rouge .m, pre.rouge .mb, pre.rouge .mf, pre.rouge .mh, pre.rouge .mi, pre.rouge .mo, pre.rouge .mx, pre.rouge .il { color: var(--code-green); } | ||
| pre.rouge .nt { color: var(--code-tag); font-weight: 400; } | ||
| pre.rouge .na { color: var(--ribbon-deep); } |
There was a problem hiding this comment.
.nl isn't overridden, so CSS property names in the HTML examples (about 23 of them) keep rouge-github's #990000. On the dark code background that is a contrast of about 1.6:1. The token plays the same role as .na:
| pre.rouge .na { color: var(--ribbon-deep); } | |
| pre.rouge .na, pre.rouge .nl { color: var(--ribbon-deep); } |
There was a problem hiding this comment.
Done in 7c743a4: .nl now gets the same colour as .na.
| /* ---------------------------------------------------------------- images and other blocks */ | ||
|
|
||
| .imageblock { margin: 1.5rem 0 2rem; } | ||
| .imageblock img { border-radius: 2px; } |
There was a problem hiding this comment.
Some images have a transparent background with dark lines and text, img/component-lifecycle.png for one; on the dark page its arrows are nearly invisible. A light background for images in dark mode keeps them readable:
| .imageblock img { border-radius: 2px; } | |
| .imageblock img { border-radius: 2px; } | |
| @media (prefers-color-scheme: dark) { .imageblock img { background: #fff; } } |
There was a problem hiding this comment.
Done in 7c743a4: images get a white background in dark mode.
| <linkcss>true</linkcss> | ||
| <source-highlighter>rouge</source-highlighter> | ||
| <rouge-css>class</rouge-css> | ||
| <webfonts>false</webfonts> |
There was a problem hiding this comment.
wicket_line has to be bumped by hand at every major release, and adjusted on every cherry-pick to a maintenance line; that's easy to forget, and the masthead and the Javadoc link would then point at the wrong line. It can come from the project version instead. build-helper-maven-plugin is already managed in the root pom; its parse-version goal, added next to the asciidoctor plugin in the guide profile:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
</plugin>then provides the major version for the attributes here:
| <webfonts>false</webfonts> | |
| <webfonts>false</webfonts> | |
| <wicket_line>${parsedVersion.majorVersion}.x</wicket_line> | |
| <wicket_line_major>${parsedVersion.majorVersion}</wicket_line_major> |
I tried it on this branch with mvn -pl wicket-user-guide -Pguide generate-resources: the masthead shows "12.x" and the Javadoc link points at apidocs/12.x. The two attributes in single.adoc can then go.
There was a problem hiding this comment.
Done in 7c743a4: parse-version runs in the guide profile and sets both attributes. The masthead shows 12.x and the Javadoc link points at apidocs/12.x.
| :wicket_line: 12.x | ||
| :wicket_line_major: 12 |
There was a problem hiding this comment.
With wicket_line and wicket_line_major set from the project version in the pom (see the comment there), these two lines can go:
| :wicket_line: 12.x | |
| :wicket_line_major: 12 |
Review of the restyled guide found these gaps, all fixed here:
- The masthead logo link lost its name on phones, where the "Apache
Wicket" text is hidden. It now carries an aria-label.
- There was no way past the masthead and the long table of contents,
and no landmarks. A skip link now comes first, #content is the main
landmark and the table of contents a labelled navigation landmark.
- A chapter's sections were only shown while scrolling through it, so
keyboard users could not reach them. They also open while focus is
inside the chapter, and the current entry gets aria-current instead
of being marked by colour alone.
- The 539 copy buttons were all named "Copy". They are now named after
their language ("Copy Java code"), and "Copied" is announced through
a single status region rather than aria-live on each button.
- CSS property names in HTML listings kept rouge-github's colour, which
is unreadable on the code background.
- Diagrams with a transparent background were nearly invisible in dark
mode. Images now get a white background there.
The version line in the masthead and the Javadoc link came from
attributes in single.adoc that had to be changed by hand at every
major release and on cherry-picks. They now come from the project
version through build-helper's parse-version goal.
GitHub issue #1844
Generated-by: Claude Code (Claude Opus 5.5)
|
Thanks @papegaaij. 7c743a4 takes all the inline suggestions and the three general points:
I checked the result in Chromium: 539 buttons and six distinct labels, one status region, and |
Restyles the reference guide in the design of wicket.apache.org and restores syntax highlighting, which the guide has not had: the pom passed
<sourceHighlighter>, a parameter asciidoctor-maven-plugin 2.x does not know and ignores, so all of the guide's 500+ listings rendered as plain text. Closes #1844.The copied 2017 default stylesheet is gone. The plugin's own default stylesheet loads first, and
css/wicket.cssoverrides it through docinfo with the site's tokens, its self-hosted Alegreya and JetBrains Mono fonts and its Rouge colours. The page makes no external requests any more (no Google Fonts, no Font Awesome from cdnjs).source-highlighterattribute. Every listing has a language label and a copy button. In HTML samples,wicket:idand thewicket:tags are marked.Before and after
For review
css/wicket.css,js/guide.js, the threedocinfo*.htmlfiles, and thepom.xmlandsingle.adocattribute changes.img/wicket-mark.svg,LICENSEand.rat-excludes.licenses/LICENSE-asciidoctor.txtare removed because the copied stylesheet they covered is gone._sass/ribbon/_base.scssand have to be kept in step by hand.Tested with
mvn clean verify -Pjs-test(green) andmvn -pl wicket-user-guide -Pguide generate-resources. The rendered guide was checked at 1440px and 390px, in light and dark mode, in Chromium.🤖 Generated with Claude Code