(apiDoc: Document, moduleInfo: ModuleInfo)
| 6 | * needs to be kept in sync with the routes from the material.angular.dev CLI project. |
| 7 | */ |
| 8 | export function computeApiDocumentUrl(apiDoc: Document, moduleInfo: ModuleInfo): string { |
| 9 | // Base URL for the given package. This is currently either: |
| 10 | // 1) material.angular.dev/cdk |
| 11 | // 2) material.angular.dev/components |
| 12 | const baseUrl = moduleInfo.packageName === 'cdk' ? 'cdk' : 'components'; |
| 13 | return `${baseUrl}/${moduleInfo.entryPointName}/api#${apiDoc.name}`; |
| 14 | } |