genjavadoc icon indicating copy to clipboard operation
genjavadoc copied to clipboard

Links generated by genjavadoc are broken

Open hawkw opened this issue 11 years ago • 5 comments
trafficstars

I recently switched from using JavaDoc {@link ...} syntax in my ScalaDoc comments to using ScalaDoc [[..]] syntax, after learning that genjavadoc transforms ScalaDoc links into JavaDoc links. However, now, when I look at the JavaDoc html pages, the links appear as text rather than as links, and when generating JavaDoc, the JavaDoc tool prints a lot of warning - Tag @link: reference not found: warnings to the console.

I'm assuming that this is because the generated sources don't import the linked classes, is that correct?

I'm using Scala 2.11.2, and I'm running genjavadoc from a Gradle build script - I can post the Gradle build script if you like.

hawkw avatar Aug 08 '14 17:08 hawkw

I find this as well, and also links that include a URL in [[...]]. I think these have to undergo more translation to be valid javadoc, and Java 8 flags them as errors not warnings.

srowen avatar Oct 23 '14 15:10 srowen

a pull request would be awesome ;-)

patriknw avatar Oct 24 '14 07:10 patriknw

This is a current limitation: scaladoc comments are not parsed and interpreted , only minimal substitutions are made. This means that [[...]] syntax can only be used to link to Java classes. All other uses are illegal.

I mark this as an enhancement so that someone can pick it up if interested.

rkuhn avatar Jun 26 '15 08:06 rkuhn

Another thing to be careful with is [[methodName]] links. Those are not understood by genjavadoc. Intellij complains about [[#methodName]] syntax and you might replace them with [[methodName]].

[[#methodName]] and [[Class#methodName]] works fine. The latter is not a warning in Intellij.

patriknw avatar Dec 20 '17 11:12 patriknw

@patriknw we don't support args in methodName yet? I try to write links like [[FileIO.toFile(File, util.Set[OpenOption])]] but it was rendered as <span class="extype" name="FileIO.toPath(Path,">util.Set[OpenOption])</span> which is neither a link nor a good display.

See also https://github.com/akka/akka/pull/28328

tisonkun avatar Dec 15 '19 00:12 tisonkun