Skip to main content

PublisherBase

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

Base class for a TechDocs publisher (e.g. Local, Google GCS Bucket, AWS S3, etc.) The publisher handles publishing of the generated static files after the prepare and generate steps of TechDocs. It also provides APIs to communicate with the storage service.

Signature:

export interface PublisherBase 

Methods

MethodDescription
docsRouter()Route middleware to serve static documentation files for an entity.
fetchTechDocsMetadata(entityName)Retrieve TechDocs Metadata about a site e.g. name, contributors, last updated, etc. This API uses the techdocs_metadata.json file that co-exists along with the generated docs.
getReadiness()Check if the publisher is ready. This check tries to perform certain checks to see if the publisher is configured correctly and can be used to publish or read documentations. The different implementations might e.g. use the provided service credentials to access the target or check if a folder/bucket is available.
hasDocsBeenGenerated(entityName)Check if the index.html is present for the Entity at the Storage location.
migrateDocsCase(migrateRequest)?

(Optional) Migrates documentation objects with case sensitive entity triplets to lowercase entity triplets. This was (will be) a change introduced in techdocs-cli version {0.x.y} and techdocs-backend version {0.x.y}.

Implementation of this method is unnecessary in publishers introduced after version {0.x.y} of techdocs-node.

publish(request)Store the generated static files onto a storage service (either local filesystem or external service).