milesj / docusaurus-plugin-typedoc-api

Docusaurus plugin that provides source code API documentation powered by TypeDoc.
71 stars 26 forks source link

feat: Support for reference tag [#153] #154

Closed rash805115 closed 2 months ago

rash805115 commented 3 months ago

This PR adds support to show @reference tag, which is a custom tag, as discussed in #153

You can use this tag as @reference <Name> {@link <Exported class>}

E.g.

/**
This is class A and does blah.

@reference Resources {@link B}
@reference Models {@link C}
*/
class A {
  ...
}

It would look like,

Screenshot 2024-08-03 at 11 38 27 PM

If your IDE complains about using @reference tag, which is a custom tag not supported in TypeDoc, then you will need to extend their schema definition by putting a new tsdoc.json in the root of your directory.

{
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/tsdoc/v0/tsdoc.schema.json",
    "extends": ["typedoc/tsdoc.json"],
    "noStandardTags": false,
    "tagDefinitions": [
        {
            "tagName": "@reference",
            "syntaxKind": "block",
            "allowMultiple": true
        }
    ]
}
rash805115 commented 3 months ago

Hi @milesj Can you take a look when you have a chance?

rash805115 commented 2 months ago

Hello @milesj Can you please review this when you get a chance?

milesj commented 2 months ago

Can you post a screenshot of what this looks like in practice?

rash805115 commented 2 months ago

@milesj The screenshot in PR description is taken from a real example. The new sections Models and Resources are created based on the @reference tag.

rash805115 commented 2 months ago

@milesj One last question, how can we release the changes? Is it automatically triggered?

milesj commented 2 months ago

I have to manually do it. I'll get around to it later today.