microsoft / tsdoc

A doc comment standard for TypeScript
https://tsdoc.org/
MIT License
4.71k stars 131 forks source link

How do I link to a file? #250

Open muuvmuuv opened 4 years ago

muuvmuuv commented 4 years ago

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

jonnytest1 commented 4 years ago

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

muuvmuuv commented 4 years ago

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

700software commented 2 years ago

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

jonnytest1 commented 2 years ago

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

rodelta commented 2 years ago

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.

jonnytest1 commented 2 years ago

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

mctrafik commented 1 year ago

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

msmfa commented 1 year ago

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

Owen3H commented 1 year ago

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

NatoBoram commented 6 months ago

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 :/

mirek commented 2 months ago

Is there solution for this in 2024? This issue is quite crippling good people who want to write good docs for the rest of us :)

adamscybot commented 1 week ago

Its actually kind of crazy how abandoned/broken the whole ts doc scene is. I don't think its necessarily tsdocs "fault" alone or anything. VSCode works with half of it, half of it not, then there's jsdoc and typedoc and nothing overlaps or works together. This requirement is fairly basic and I reckon surely not enough people write proper docs or there'd be more interest in this problem :D.