Skip to main content

transformDirLocation

Home > @backstage/plugin-techdocs-node > transformDirLocation

TechDocs references of type dir are relative the source location of the entity. This function transforms relative references to absolute ones, based on the location the entity was ingested from. If the entity was registered by a url location, it returns a url location with a resolved target that points to the targeted subfolder. If the entity was registered by a file location, it returns an absolute dir location.

Signature:

transformDirLocation: (entity: Entity, dirAnnotation: ParsedLocationAnnotation, scmIntegrations: ScmIntegrationRegistry) => {
type: 'dir' | 'url';
target: string;
}