Skip to content

feat: add docs command for browsing Prismic documentation#85

Merged
angeloashmore merged 6 commits intomainfrom
aa/docs-command
Apr 8, 2026
Merged

feat: add docs command for browsing Prismic documentation#85
angeloashmore merged 6 commits intomainfrom
aa/docs-command

Conversation

@angeloashmore
Copy link
Copy Markdown
Member

@angeloashmore angeloashmore commented Apr 2, 2026

Resolves:

Description

Adds a docs command with list and view subcommands so users can browse Prismic documentation directly from the CLI. docs list fetches a page index (optionally listing anchors within a page), and docs view renders a documentation page as Markdown with optional anchor filtering.

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1


Note

Medium Risk
Adds a new top-level CLI command that performs network requests and parses Markdown anchors, which could introduce new failure modes (HTTP errors, output parsing) but does not touch auth or data mutation paths.

Overview
Adds a new prismic docs top-level command with list and view subcommands to browse Prismic documentation from the CLI.

The command fetches a docs index and per-page anchor index, supports JSON output, and docs view can optionally extract a single section via #anchor using GitHub-compatible slug generation while ignoring headings inside code fences.

Introduces a PRISMIC_DOCS_HOST env override for the docs base URL and adds github-slugger as a dev dependency; registers docs in the main command router and excludes it from segment tracking.

Reviewed by Cursor Bugbot for commit d89c484. Bugbot is set up for automated code reviews on this repo. Configure here.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore marked this pull request as draft April 2, 2026 04:19
@angeloashmore angeloashmore marked this pull request as ready for review April 8, 2026 18:59
angeloashmore and others added 2 commits April 8, 2026 09:00
Lines like `# install deps` inside shell/Python code blocks were being
treated as level-1 headings, prematurely truncating sections requested
via `prismic docs view <path>#<anchor>`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@angeloashmore angeloashmore merged commit 787a9c1 into main Apr 8, 2026
13 checks passed
@angeloashmore angeloashmore deleted the aa/docs-command branch April 8, 2026 22:33
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d89c484. Configure here.

} else if (fence) {
currentFence = fence;
continue;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fence closing check ignores trailing content on line

Medium Severity

The fence-closing check on line 79 only verifies the line starts with the same fence characters via startsWith, but doesn't verify the rest of the line is empty (or whitespace-only). Per CommonMark, closing code fences cannot have info strings — a line like ```python inside a ``` block is content, not a closing fence. The current regex /^(?<fence>\{3,}|~{3,})/matches the fence prefix, andstartsWithsucceeds, so the code incorrectly exits the fenced block. This causes subsequent lines still inside the code block to be scanned for headings, potentially producing wrong anchor matches or corrupting theGithubSlugger` state — likely in documentation about code that nests fenced examples.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d89c484. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant