tsdoc icon indicating copy to clipboard operation
tsdoc copied to clipboard

How do I link to a file?

Open muuvmuuv opened this issue 5 years ago • 14 comments

I have used some code from an external package which is not exported and I would like to create some link/see reference to it so others will know where this is coming from and if it is maybe exported in the future to remove it.

Is using @see the right way? I could not find anything about js/tsdoc and file urls. But @link in this case does not really get the file url correctly because of the at in angualr and asks for some hash.

Bildschirmfoto 2020-07-28 um 10 11 50 Bildschirmfoto 2020-07-28 um 10 11 45

muuvmuuv avatar Jul 28 '20 08:07 muuvmuuv

maybe you cna try the import("@angular/.../forms.js") syntax

jonnytest1 avatar Aug 20 '20 09:08 jonnytest1

But I do not want to import something just tell the next person that this is copied from there because it is not exported.

muuvmuuv avatar Aug 20 '20 09:08 muuvmuuv

Any solution please post here. It's the most relevant answer to Google search. https://google.com/?q=tsdoc+link+to+file

700software avatar Jan 24 '22 22:01 700software

in vscode u can use :

file://./ to link to any file (after the file:// u need a . for relative files)

aside from that you cna try the markdown syntax [test](link) but ive only gotten that one to work with absolute paths

jonnytest1 avatar Jan 25 '22 17:01 jonnytest1

At this time, it does not seem supported: https://tsdoc.org/pages/tags/link/

I can confirm that the solution from @jonnytest1 works on the command block for vs-code, image

but the tooltip doesn't recognize the format image

It might be useful if a team mostly uses vs-code, although it would be nice to have something native in the spec.

rodelta avatar May 12 '22 20:05 rodelta

ok i did a bit more testing :

you can

 /**
   * @see [text](./file.ts) 
   */

this link appears in the tooltip

however this one doesnt work in the editor in vscode 😅 so maybe adding both might be an option

i also dont know if this is a typescript or vscode thing so i cant say for certain wether this will work in other IDEs

jonnytest1 avatar May 13 '22 10:05 jonnytest1

How is this still an issue? Just tried it and none of the suggestions above work in Windows. :(

mctrafik avatar Sep 20 '22 20:09 mctrafik

@mctrafik Agreed. Would be a nice feature to have or atleast a recommended work around that works

msmfa avatar Sep 29 '22 15:09 msmfa

Any progress? I'm not big on the idea of an import that is otherwise useless.

Owen3H avatar Jun 30 '23 00:06 Owen3H

Shame, I wanted to have a doc that references another type, like {@link import("openai/resources/index.js").ChatCompletionCreateParamsNonStreaming}, but that doesn't seem to work :/

NatoBoram avatar Mar 14 '24 17:03 NatoBoram