RFR: JDK-8297802: display of @spec tags should mimic that of @see tags
Jonathan Gibbons
jjg at openjdk.org
Thu Dec 1 00:25:19 UTC 2022
On Wed, 30 Nov 2022 19:49:32 GMT, Pavel Rappo <prappo at openjdk.org> wrote:
>> Please review a simple change to model the list used to display `@spec` tags on the list used to display `@see` tags.
>>
>> In both cases, the list uses an inline list if the items are short and do not contain commas, or a bulleted list if they are long or contain commas.
>>
>> The test is updated for the new output.
>>
>> For now, new CSS styles are introduced for `spec-list` and `spec-list-long`, duplicating `see-list` and `see-list-long`. We might want to merge these into `tag-list` and `tag-list-long`, or some other suitably-named pair.
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java line 387:
>
>> 385: return Text.EMPTY;
>> 386: }
>> 387: // Use a different style if any link label is longer than 30 chars or contains commas.
>
> It's a good opportunity to be DRY; I suggest:
> // Use a different style if any link label is long or contains commas.
Maybe in the next round of cleanup ...
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java line 760:
>
>> 758: links.stream()
>> 759: .filter(Predicate.not(Content::isEmpty))
>> 760: .forEach(item -> specList.add(HtmlTree.LI(item)));
>
> There's a similar not-DRY comment. Perhaps both could be dealt with by extracting the decision on styling into a method?
I'd prefer to avoid minor refactoring like this at this stage; there may be more refactoring in this area in the next release.
-------------
PR: https://git.openjdk.org/jdk/pull/11426
More information about the javadoc-dev
mailing list