-
Type:
Enhancement
-
Resolution: Duplicate
-
Priority:
P4
-
Affects Version/s: 9
-
Component/s: tools
-
None
-
generic
-
generic
The jdk.javadoc.doclet.Taglet interface lacks a way to retrieve the relative path to the documentation root URL. This means that taglets have to compute the relative path themselves based on the Element, which is a repetitive and error-prone task. What's worse is that Taglets are sometimes used outside the context of their containing Element, for example when citing the first sentence of a description in a top-level summary page. There is currently no way a Taglet can adjust its output to this kind of usage.
There should be an easy way for a Taglet to retrieve the relative path to the documentation root URL. The simplest solution would be to evolve the toString(List, Element) method by adding a new default toString(List, Element, String) method that accepts the documentation root path as third argument, with the default implementation invoking the old method.
Another solution would be to provide a new method in DocletEnvironment to retrieve either the relative path to the current page or the relative path from the current page to the root URL. We could also provide a higher level method to get the relative path to any documented Element.
There should be an easy way for a Taglet to retrieve the relative path to the documentation root URL. The simplest solution would be to evolve the toString(List, Element) method by adding a new default toString(List, Element, String) method that accepts the documentation root path as third argument, with the default implementation invoking the old method.
Another solution would be to provide a new method in DocletEnvironment to retrieve either the relative path to the current page or the relative path from the current page to the root URL. We could also provide a higher level method to get the relative path to any documented Element.
- duplicates
-
JDK-8373922 Enhance Taglet API to support relative URLs
-
- Open
-