Integrated: JDK-8200337: Generalize see and link tags for user-defined anchors
Hannes Wallnöfer
hannesw at openjdk.org
Fri Nov 4 15:00:42 UTC 2022
On Thu, 22 Sep 2022 16:51:56 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
> Please review a a new feature to allow `@link`, `@linkplain` and `@see` tags to link to arbitrary URI fragments in the generated documentation (including in auxiliary `doc-files` documentation).
>
> The changes in module `jdk.compiler` are mostly cleanup changes retained from earlier versions of the patch. The current proposed version uses a very simple change in `ReferenceParser` to avoid parsing the member name section of the reference when a non-member fragment is encountered.
>
> The implementation introduces a new form of reference with a double hash mark (`##`) separator. This is a change from the previous implementation which also auto-recognized URI fragments and documentation paths by looking for `-` characters which are not allowed in member names. This feature was removed upon further consideration because it makes the feature more complex and less recognizable.
>
> Links to auxiliary documentation files follow the same rules. They are recognized by looking for `/` characters in the fragment name. This means that ordinary `id` attribute values must not contain `/`, while auxiliary file paths must contain a `/` character. Both restrictions should be easy to sustain.
>
> One thing that is difficult for this feature is to provide a good link label if no label is supplied in the tag. In contrast to program element names a fragment name does usually not make a good human readable name. The solution is to use the fragment name as default label text. I expect that the feature will usually be used with a user provided label.
This pull request has now been integrated.
Changeset: 5622b095
Author: Hannes Wallnöfer <hannesw at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/5622b0956581ed5057f708ee77cb648705ea7e94
Stats: 586 lines in 17 files changed: 521 ins; 15 del; 50 mod
8200337: Generalize see and link tags for user-defined anchors
Reviewed-by: jjg
-------------
PR: https://git.openjdk.org/jdk/pull/10395
More information about the compiler-dev
mailing list