-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More control over included jsdoc #161
Comments
Oops, absolutely missed this issue - sorry. So there is some control atm, in that you can either have everything or nothing which is available via the option Here's an example of it in use on https://mael.dev/clipanion/ The JSDoc is jammed inside the data-lsp node:
Which I believe is appropriately escaped in order to safely be there, but I'm not 100% it covers all cases as we didn't use it on the TypeScript website (it would be too much info, which is often a bit more distracting from describing TS). We basically pipe the direct response from TypeScript into the data-lsp, which means you can (probably) safely assume the last line is always the type and anything else is jsdoc. I am indeed thinking about twoslash hover formatting #159 but mainly in the form of doing some TS type highlights in very few bytes - in Clipanion's case they use prismjs to colorize the types and maybe the jsdocs, but I think shipping a markdown processor is a bit much for us by default. That said, I think if you already have a runtime JS lib for highlighting, replacing the default JS which shows highlighting is a very reasonable way to get this right now |
Whoops! I totally missed this. I think I can live with this for now, although it would be much nicer to be able to control what goes into the lsp node directly using the API. 😄 |
Generally speaking, my goal is to render the docs differently from the types. The main reason for this is: while the types tend to be the right width for the container and look reasonably good, the docs frequently wrap weirdly. They also probably want to be rendered using markdown.
Here are some ideas that might help. I don't know the complete set of constraints, so I'd be happy with any progress along these lines.
lsp-docs
?), possibly with an opt-in. That would be enough to get the basic job done using CSS.data-lsp
node. This could also be opt-in.If you did (3), it would probably be straight-forward to add an option to automatically format the docs using markdown in the markdown-it and remark plugins.
I can't tell precisely what the requirements are for this sort of thing just by reading the code, so please fire away if there's anything I missed or if there's any more information I can provide about my goals.
The text was updated successfully, but these errors were encountered: