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
Properly display generics in Markdown #239
Comments
Just to clarify that this use-case is for manually adding references inside doc comments? |
Sorry, should have properly clarified and not rushed before work. The use case is that generic types don't seem to be properly rendered. I don't believe this is related to doc comments. I'll add example code and the current result: /**
* Represents a spline that can take numeric values.
*/
export class NumericSpline extends Spline<number> {
// ...
} Class: NumericSplinecomponents.NumericSpline Represents a spline that can take numeric values. Hierarchy
As you can see, in the hierarchy section, the full name of the variable is not wrapped in the I'm happy to elaborate more, if needed. |
Ah sorry - ok i see what you are saying. I will have a proper look at this and report back. |
I'd be glad to take a peek aswell if you like, I'd be happy to contribute - I just don't really know how the codebase works at the moment. If you'd rather someone else bothers with this, feel free to give me a hint in the right direction! |
Like you suggest this has been implemented like this as its not possible to nest links inside backticks in markdown and trying to avoid html in the output. What do you think about adding each symbol in a backtick rather than the entire string? It means the symbols are consistent although maybe the angle brackets look out of place?
Any other suggestions welcome?
I am happy to pick this up, but yes contributions very welcome. Actually been planning on writing a contributing page but currently in the middle of refactoring to remove handlebars so got a bit sidetracked. |
Encapsulating each symbol in backticks is definitely an improvement - but depending on the CSS used to style the rendered Markdown, the angle brackets may look pretty out of place. I get how one would want to avoid HTML in the output though. I'd say before making that kind of concession most people would take the slightly out-of-place brackets and commas any day.
I'll leave you to do the magic then! Am definitely excited for the contributing page though, but obviously don't rush yourself. |
ok have implemented in typedoc-plugin-markdown@3.10.1. Thanks I think it's an improvement. Let me know if you spot anything. |
Perfect, looks good to me! Thanks for the quick fix! |
I'm so sorry for having so many issues with generics in TypeDoc. 😅
The Markdown renderer seems to have issues properly representing and linking generic types inside the rendered result. At the moment, the class
Spline<Color>
will be rendered asSpline
<Color>. Sadly, it does not seem possible to provide links inside of code snippets, soSpline<[Color](...)>
would not work. The only solution I'd see at the moment for generics is to provide HTML code directly with something alongwhich renders as
Spline<Color>
.Is this something that can feasibly be fixed, or might this even be intended/unfixable behaviour?
The text was updated successfully, but these errors were encountered: