Skip to content
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

Improved compilation of JSDOC #272

Open
MagMar94 opened this issue Sep 19, 2023 · 0 comments
Open

Improved compilation of JSDOC #272

MagMar94 opened this issue Sep 19, 2023 · 0 comments

Comments

@MagMar94
Copy link

I really like the JSDOC support, but it's compilation is not optimal when XML tags are used in the C# documentation.

An example with referencing documentation:

public class Menu
{
    /// <summary>
    /// The dessert recommendations grouped by <see cref="Coffee"/>.
    /// </summary>
    public IDictionary<Coffee, string> DessertRecommendations { get; }
}

public enum Coffee
{
    Black = 1,
    Americano = 2
}

This is currently serialized to this:

export interface IMenu {
    /** The dessert recommendations grouped by <see cref="T:Coffee" />. */
    dessertRecommendations: { [key in Coffee]: string  }
}

export enum Coffee {
    ...
}

A better serialization would be something like this:

export interface IMenu {
    /** The dessert recommendations grouped by {@link Coffee}. */
    dessertRecommendations: { [key in Coffee]: string  }
}

export enum Coffee {
    ...
}

If JSDoc annotations is unwanted, a simpler but more readable version would be to just remove the XML tags:

export interface IMenu {
    /** The dessert recommendations grouped by Coffee. */
    dessertRecommendations: { [key in Coffee]: string  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant