Refactor repo parsing, add prose heading anchors and go-pkg component#4
Conversation
Break the monolithic parseRepo into focused helpers:
- splitPath: match provider prefix or base URL, normalise segments
(strips empty parts, `.`, and `..`).
- parsePath: extract structured { provider, repo, directory }.
- makeRepoLabel: shorten deep paths with ellipsis
(e.g. a/b/c/d → a/b/…/d).
- makeRepoURL: table-driven URL composition from provider config.
Provider configuration is now data-driven via a RepoProvider type
and providers record. Currently supports `github:` prefix and
`https://github.com/` base URL forms.
Signed-off-by: Alejandro Mery <amery@apptly.co>
The default Nuxt Content prose components wrap the entire heading text in an anchor link, making it behave like a navigation element. Add a shared ProseHeading base component that renders headings as plain text with a subtle § glyph that appears on hover (and on keyboard focus) for section permalinks. prose-h2 and prose-h3 delegate to it with a fixed `as` prop. The glyph is customisable per heading via MDC attributes. Signed-off-by: Alejandro Mery <amery@apptly.co>
Inline component for linking Go packages, types, and functions to pkg.go.dev with a trailing Go icon. Supports module, directory, symbol, and function references with configurable label display. Resolution logic lives in app/utils/go-pkg.ts — layered helpers (makeGoPkgURL, makeGoPkgLabel, resolveGoPkg) following the same pattern as parse-repo.ts. The component is a thin rendering shell. Signed-off-by: Alejandro Mery <amery@apptly.co>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
awesome-apptly | 30830c3 | Commit Preview URL Branch Preview URL |
Apr 03 2026, 03:53 PM |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR adds Vue components and TypeScript utilities for handling Go package documentation links and prose headings with optional anchors. New components include Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Review Summary by QodoRefactor repo parsing, add prose heading anchors and go-pkg component
WalkthroughsDescription• Refactor parseRepo into layered helpers with data-driven provider config - Path sanitisation (., .., empty segments) - Ellipsis shortening for deep paths (e.g. a/b/c/d → a/b/…/d) - Dual prefix support (github: and https://github.com/) • Add prose heading overrides with hover-visible anchor glyph - Shared ProseHeading base component with keyboard-accessible § glyph - prose-h2 and prose-h3 delegate to base component • Add :go-pkg MDC component for pkg.go.dev links - Supports module, directory, symbol, and function references - Configurable label display with trailing Go icon - Layered helper pattern matching parse-repo.ts structure • Update documentation with new component usage examples Diagramflowchart LR
A["parseRepo refactor"] -->|splitPath| B["Normalised parts"]
B -->|parsePath| C["Provider + repo + dir"]
C -->|makeRepoLabel| D["Shortened label"]
C -->|makeRepoURL| E["Full URL"]
F["GoPkgProps"] -->|resolveGoPkg| G["GoPkgLink"]
G -->|go-pkg.vue| H["Rendered link + icon"]
I["ProseHeadingProps"] -->|ProseHeading| J["Heading + glyph"]
J -->|prose-h2/h3| K["Delegated headings"]
File Changes1. app/utils/parse-repo.ts
|
Code Review by Qodo
1. Unimported ProseHeadingProps
|
Summary
Component and utility improvements for the content layer:
parseRepointo layered helpers with data-drivenprovider config, path sanitisation (
.,.., empty segments),ellipsis shortening for deep paths, and dual prefix support
(
github:andhttps://github.com/).ProseHeadingbase componentwith hover-visible
§anchor glyph (keyboard-accessible viafocus-visible).prose-h2andprose-h3delegate to it.Replaces the default Nuxt Content behaviour of wrapping headings
in anchor links.
:go-pkgMDC component — inline link to pkg.go.dev withtrailing Go icon. Supports module, directory, symbol, and function
references with configurable label display. Resolution logic in
app/utils/go-pkg.tsfollows the same layered helper pattern asparse-repo.ts.Files
app/utils/parse-repo.tssplitPath,parsePath,makeRepoLabel,makeRepoURLapp/utils/index.tsProseHeadingPropsinterfaceapp/components/content/prose-heading.vueapp/components/content/prose-h2.vueapp/components/content/prose-h3.vueapp/utils/go-pkg.tsGoPkgProps,GoPkgLink,resolveGoPkgand helpersapp/components/go-pkg.vueAGENTS.mdGoPkgandProseHeadingTest plan
pnpm precommitpasses (generate, lint, typecheck)§glyph on hover§glyph visible on keyboard focus (Tabnavigation):go-pkg{mod="darvaza.org/resolver"}renders as linked text with Go icon:go-pkg{mod="..." sym="Resolver" short}renders asResolverwith Go icon:go-pkg{mod="..." func="NewResolver" short}renders asNewResolver()with Go icon…ellipsisparseRepoaccepts bothgithub:owner/repoandhttps://github.com/owner/repoSummary by CodeRabbit
New Features
Documentation