feat: multi-entity documentation support#22
Merged
Conversation
Refactor both plugins to serve and render docs per catalog entity instead of a single global site. Backend: add Hub class with LRU eviction for managing multiple RwSite instances, entity-scoped routes (/site/:ns/:kind/:name/*), and support for both local projectDir and S3 storage modes. Frontend: split monolithic viewer into RwEntityDocsViewer (reads rwdocs.org/ref annotation) and RwStandaloneViewer (reads rw.rootEntity config), add cross-entity section ref resolution via catalog API lookups with client-side caching, and wire scopePath into the RW viewer for scope-relative URL handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
34b8294 to
4eadae5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hubclass (LRU cache ofRwSiteinstances) so the backend can serve docs for multiple Backstage entities from a single S3 bucket/site/:namespace/:kind/:name/*)rwdocs.org/refannotation parsing — format:"<entity>[:<scope>]"where entity is an entity ref or.(self), scope is optional navigation scopingRwEntityDocsViewer(reads annotation from catalog entity) andRwStandaloneViewer(usesrw.rootEntityconfig)rwdocs.org/refannotationtoEntityPathutility (both frontend and backend) to deduplicate entity ref formattingres.localsmiddleware pattern for injectingRwSiteinto route handlersTest plan
rw.rootEntityand verify standalone/docspagerwdocs.org/ref: "."annotation to a component entity and verify docs tabrwdocs.org/ref: "default/component/arch:domains/billing"and verify scoped navigation🤖 Generated with Claude Code