Merge pull request #19279 from jrwpatterson/feat/reference-external-docs

Feat/reference external entityRef for techdocs
This commit is contained in:
Fredrik Adelöw
2023-08-31 13:12:52 +02:00
committed by GitHub
8 changed files with 211 additions and 57 deletions
@@ -100,6 +100,21 @@ alongside the entity's source code, the value of this annotation can point to an
absolute URL, matching the location reference string format outlined above, for
example: `url:https://github.com/backstage/backstage/tree/master`
### backstage.io/techdocs-entity
```yaml
# Example:
metadata:
annotations:
backstage.io/techdocs-entity: component:default/example
```
The value of this annotation informs of an external entity that owns the TechDocs.
This allows you to reference TechDocs from a single source without either duplicating
the TechDocs in the TechDocs page or needing multiple builds of the same docs.
This is for situations where you have complex systems where they share a single repo, and likely a single TechDoc location.
### backstage.io/view-url, backstage.io/edit-url
```yaml
+29
View File
@@ -675,3 +675,32 @@ entity. If the value of this annotation is `'local'`, the TechDocs backend will
and publish the documentation for them. If the value of the `company.com/techdocs-builder`
annotation is anything other than `'local'`, the user is responsible for publishing
documentation to the appropriate location in the TechDocs external storage.
## Reference another components TechDocs
In systems where you might have multiple entities for example a System with a Website and an API, when served from a Monorepo you might want to keep the TechDocs in one location in the repository.
In this case you can add the `backstage.io/techdocs-entity` annotation and point to the owners `entityRef` and use its TechDocs. This allows the Subcomponents to read the parents docs, filling the TechDocs link on the `AboutCard` element and the Techdocs tab
```yaml
apiVersion: backstage.io/v1alpha1
kind: System
metadata:
name: example
namespace: default
title: Example
description: This is the parent entity
annotations:
backstage.io/techdocs-ref: dir:.
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: example-platfrom
title: Example Application Platform
namespace: default
description: This is the child entity
annotations:
backstage.io/techdocs-entity: system:default/example
```