dokka icon indicating copy to clipboard operation
dokka copied to clipboard

Allowing external links in @see

Open benlei-gfm opened this issue 6 years ago • 7 comments
trafficstars

Is your feature request related to a problem? Please describe I'm trying to reference an external doc using @see, but can't. It would be nice if @see has support for external urls, or if an annotation can be provided to support this.

Describe the solution you'd like I'd expect:

/**
 * This is an example of my docs.
 *
 * @see [MyLink](http://google.com)
 * @see [MyLink2](http://bing.com)
 * @see [MyLink3](http://yahoo.com)
 * @see com.github.myproject.SeeOtherClass
 */

To generate docs that users can click to visit MyLink.

Describe alternatives you've considered I could manually create the "See Also"... but it's annoying/looks ugly:

/**
 * This is an example of my docs.
 *
 * **See Also**
 *
 * [MyLink](http://google.com)
 *
 * [MyLink2](http://bing.com)
 *
 * [MyLink3](http://yahoo.com)
 *
 * [com.github.myproject.SeeOtherClass]
 */

Additional context N/A

benlei-gfm avatar Oct 25 '19 17:10 benlei-gfm

This is not something that is in KDoc specification, which is a part of the language standard. Nevertheless, something like that can be achieved using plugins api.

Kordyjan avatar Sep 02 '20 09:09 Kordyjan

In case anyone finds this after all this time, this works:

/**
 * See [GitHub](https://github.com)
 */

It doesn't work with the @see, though.

CLOVIS-AI avatar Dec 13 '20 20:12 CLOVIS-AI

In case anyone finds this after all this time, this works:

/**
 * See [GitHub](https://github.com)
 */

It doesn't work with the @see, though.

Tried this with an URL including a path and for some reason the generator always adds ".html" to it without a good reason.

mwittig avatar Oct 13 '21 11:10 mwittig

Common use-case from the standard library:

@see [Kotlin language documentation](link to kotlinlang.org with detailed description of the API and examples, that we cannot afford to put into KDoc)

qwwdfsad avatar Sep 21 '22 10:09 qwwdfsad

With dokka 1.9.10, @see [xxx](https://xxxx) works, but @see [x-x](https://xxxx) doesn't work. See [x-x](https://xxxx) works.

RationalityFrontline avatar Feb 17 '24 13:02 RationalityFrontline

@RationalityFrontline can you clarify what exactly doesn't work? Is it the presence of the - character that breaks the link?

CLOVIS-AI avatar Feb 18 '24 13:02 CLOVIS-AI

@RationalityFrontline can you clarify what exactly doesn't work? Is it the presence of the - character that breaks the link?

yes, it's the '-' character.

RationalityFrontline avatar Feb 18 '24 13:02 RationalityFrontline