Skip to content

docs: fix invalid since-badge placement and clarify guidance#5713

Merged
Artur- merged 3 commits into
mainfrom
since-tags
Jun 25, 2026
Merged

docs: fix invalid since-badge placement and clarify guidance#5713
Artur- merged 3 commits into
mainfrom
since-tags

Conversation

@Artur-

@Artur- Artur- commented Jun 23, 2026

Copy link
Copy Markdown
Member

Fixes since badges that were authored with invalid AsciiDoc and never
rendered. A since badge is an inline role that must be immediately followed by
a formatted text span (e.g. #...#); a span-less badge renders as literal
[since:...] brackets or silently produces nothing.

  • Correct 7 broken usages across 7 articles: a badge trailing a heading
    (== Title [since:...]) and badges alone on their own line, rewritten to the
    span form (== [since:...]#Title#, or wrapping a phrase in body text).
  • Update the CLAUDE.md "Version References" guidance to document the correct
    form so future docs use it.

Note: section-heading badges only become visible together with the dspublisher
fix in vaadin/docs-app#537 -- the build attached the version to the wrong
element (a preceding [classname] macro or the heading anchor) and had no CSS
rule for badges in h2-h6 headings. This PR makes the markup correct; #537
makes it render.

The since badge is an inline AsciiDoc role and must be immediately
followed by a formatted text span (e.g. #...#). Span-less usages render
as literal brackets or silently produce no badge.

- Correct 7 broken usages (trailing on headings, standalone on own line)
- Update CLAUDE.md Version References to document the correct form
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown

Preview Deployment

This PR has been deployed for preview.

URL: https://docs-preview-pr-5713.fly.dev

Changed pages

Added content is highlighted in green; removed content is marked in red on each page.

Built from 318f48b

@peholmst peholmst added the target/v25.2 Automatically cherry-pick to the v25.2 branch label Jun 23, 2026
The badge just needs a following text span (#...#); it works on headings
and in body text. The earlier 'must be first class-bearing element'
caveat was a workaround for a dspublisher bug (the version-badge pass
attaches the version to the first class-bearing element on the line);
that is being fixed at the source in @vaadin/dspublisher instead.
@Artur-
Artur- enabled auto-merge (squash) June 25, 2026 06:39
@Artur-
Artur- merged commit 5eadf88 into main Jun 25, 2026
7 of 8 checks passed
@Artur-
Artur- deleted the since-tags branch June 25, 2026 06:39
Comment thread CLAUDE.md
```asciidoc
// Correct — on a page title or section heading:
= [since:com.vaadin:vaadin@V25.1]#Slider#
== [since:com.vaadin:vaadin@V25.2]#Hierarchical Data#

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recommended way to annotate a section heading is to place the role/class on the heading instead of a span inside it. For example:

[role="since:com.vaadin:vaadin@V25.2"]
== Focus Selected Item [badge-flow]#Flow#

The only exception is the main/top-level heading, which doesn't allow it, so there you need to wrap it in a span.

I won't stop us from unifying everything one way or the other. But it’s not great to keep using both styles for 2nd and 3rd-level sections.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

peholmst pushed a commit that referenced this pull request Jun 26, 2026
…5740)

Fixes `since` badges that were authored with invalid AsciiDoc and never
rendered. A `since` badge is an inline role that must be immediately followed by
a formatted text span (e.g. `#...#`); a span-less badge renders as literal
`[since:...]` brackets or silently produces nothing.

- Correct 7 broken usages across 7 articles: a badge trailing a heading
  (`== Title [since:...]`) and badges alone on their own line, rewritten to the
  span form (`== [since:...]#Title#`, or wrapping a phrase in body text).
- Update the CLAUDE.md "Version References" guidance to document the correct
  form so future docs use it.

Co-authored-by: Artur Signell <artur@vaadin.com>
Artur- added a commit that referenced this pull request Jul 7, 2026
Follow-up to #5713. Per review feedback, section headings (== / ===)
should annotate the since badge with a [role="since:..."] attribute on
the line above the heading rather than wrapping the title in a #...#
span. The span form remains required only on the top-level (=) heading,
where the role attribute is not allowed, and for phrases in body text.

- Convert the two section headings #5713 had rewritten to span form
  (optimizing-tests, building-ui) to the role-attribute form.
- Update the CLAUDE.md Version References guidance to document both
  forms and when each applies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked-v25.2 target/v25.2 Automatically cherry-pick to the v25.2 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants