Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved README sanitization, reload/asset handling, and documentation navigation issues remain.
Review effort: Lite
Findings: 1
Open (3)
What changed in this PR
Updates plugin-docs-cli serve to mirror catalog-website’s multi-page documentation layout and routing.
Changes:
- Adds README Overview rendering with
marked. - Adds documentation navigation, breadcrumbs, responsive styling, and
/docsroutes. - Updates routing, fixtures, tests, and dependencies.
| File | Summary |
|---|---|
packages/plugin-docs-cli/src/validation/rules/filesystem.test.ts |
Updates missing-index test coverage. |
packages/plugin-docs-cli/src/utils/utils.plugin.ts |
Resolves README paths. |
packages/plugin-docs-cli/src/server/views/partials/toc.ejs |
Updates heading navigation. |
packages/plugin-docs-cli/src/server/views/partials/navigation.ejs |
Renders documentation navigation. |
packages/plugin-docs-cli/src/server/views/partials/navigation-item.ejs |
Adds collapsible navigation items. |
packages/plugin-docs-cli/src/server/views/docs-layout.ejs |
Adds tabs, breadcrumbs, and layout structure. |
packages/plugin-docs-cli/src/server/styles/docs.css |
Adds catalog-aligned responsive styling. |
packages/plugin-docs-cli/src/server/server.ts |
Implements README rendering and documentation routes. |
packages/plugin-docs-cli/src/server/server.test.ts |
Expands server behavior coverage. |
packages/plugin-docs-cli/src/server/nav.ts |
Implements navigation and URL helpers. |
packages/plugin-docs-cli/src/scanner.test.ts |
Updates root index expectations. |
packages/plugin-docs-cli/src/commands/serve.command.ts |
Passes README configuration to the server. |
packages/plugin-docs-cli/src/commands/build.command.test.ts |
Updates manifest expectations. |
packages/plugin-docs-cli/src/bin/run.ts |
Resolves README configuration. |
packages/plugin-docs-cli/src/__fixtures__/unsafe-slug-docs/index.md |
Adds landing-page fixture coverage. |
packages/plugin-docs-cli/src/__fixtures__/test-readme/README.md |
Adds README rendering fixture content. |
packages/plugin-docs-cli/src/__fixtures__/test-docs/index.md |
Adds documentation landing fixture content. |
packages/plugin-docs-cli/package.json |
Adds marked. |
package-lock.json |
Locks the new dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…cs-cli-preview-cw-layout # Conflicts: # packages/plugin-docs-cli/src/bin/run.ts # packages/plugin-docs-cli/src/commands/serve.command.ts # packages/plugin-docs-cli/src/server/server.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@grafana/create-plugin
@grafana/eslint-config
@grafana/eslint-plugin-plugins
@grafana/plugin-docs-cli
@grafana/plugin-docs-parser
@grafana/plugin-e2e
@grafana/plugin-meta-extractor
@grafana/plugin-types-bundler
@grafana/react-detect
@grafana/sign-plugin
@grafana/tsconfig
commit: |
leventebalogh
previously approved these changes
Oct 1, 2026
| const RESOLVER_ORIGIN = 'https://resolver.invalid/'; | ||
|
|
||
| /** The docs root path (base for all doc urls). */ | ||
| export function docsBasePath(): string { |
Collaborator
There was a problem hiding this comment.
Should we do export const DOCS_BASE = '/docs' instead?
Collaborator
There was a problem hiding this comment.
Probably would be nice to add some tests for this file.
…cs-cli-preview-cw-layout
This branch has not been deployed
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.



What this PR does / why we need it:
This PR updates the
plugin-docs-cli servepreview to follow how multi-page docs look on grafana.com. The first version of the preview server was built before catalog-website could render multi-page docs. Now it can (see Docstest on grafana-dev), so it's time to align the two.The goal is not a 1:1 copy of catalog-website. That wouldn't make sense, because multi-page docs will render differently in the in-Grafana catalog later on. Instead the preview aligns on layout and on what each page is for. The README renders on the Overview tab,
<docsPath>/index.mdis the Documentation landing page and other pages sit below it. They use the same sidebar nav, on-page headings and breadcrumb as catalog-website. This should reduce confusion for plugin authors.Special notes for your reviewer:
Preview URLs now match catalog-website:
/is the README,/docsisindex.mdand/docs/<slug>is every other page. The README renders withmarked, the same library GCOM uses. It is the only new dependency.