docs(dogfood): sync to latest docs-kit + make the 70-component gallery AI-readable - #32
Conversation
…I-readable
Bumped the docs-kit git pin to latest main (the 25 recent dogfood bug fixes) and
ran `rails g docs_kit:install --sync`, then acted on its drift checklist:
- Deleted the hand-written ApplicationController#render_page — DocsKit::Controller
now provides it AND serves the Markdown twin, so removing the override newly
ENABLES the .md twin for every component/guide page.
- Deleted the dead, unreferenced app/helpers/icon_helper.rb.
- Picked up the search + /llms.txt + /llms-full.txt routes --sync added, plus the
scaffolded AGENTS.md, write-docs-page skill, and the docs-kit RuboCop cops.
Lit up the AI surfaces (empty because the sidebar uses a bespoke c.nav lambda,
so nav_registries was unset):
- c.nav_registries = { "Components" => ComponentDoc, "Guides" => Doc }.
- Gave both registries the Registry v2 shape docs-kit's AI surfaces call:
#nav_items + #href, and a #view_class. ComponentDoc#view_class returns a
no-arg subclass of Views::Components::Show with the component pre-bound, so
each of the 70 components exports its Markdown twin into /llms-full.txt and
the search index (a component renders via Show.new(component:), which the
no-arg view_class.new contract now satisfies).
- Added c.tagline (the llms.txt blockquote) and c.code_theme + c.code_theme_dark
for readable code in light AND dark themes.
Result: /llms.txt lists all 70 components grouped by category + the guides (was
just the title); /llms-full.txt is 109 KB (was 14 bytes); search indexes every
component. All 70 component pages + the landing + installation render 200; the
component .md twin works; 8 request specs green; rubocop clean.
Claude-Session: https://claude.ai/code/session_01FPQb6z3YwcKRMbvoJhdxnX
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR integrates the docs-kit gem into the docs Rails application: ApplicationController includes DocsKit::Controller, rubocop inherits docs-kit's config, new routes serve llms.txt/search endpoints, Doc and ComponentDoc models gain nav_items/href/view_class methods, the docs_kit initializer is expanded, IconHelper is removed, and AGENTS.md/SKILL.md documentation is added. Changesdocs-kit integration
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Initializer as docs_kit.rb
participant Doc
participant ComponentDoc
participant NavItem as DocsKit::NavItem
participant Controller as ApplicationController
Initializer->>Doc: Doc.nav_items
Doc->>Doc: filter docs with view_class, group by group
Doc->>NavItem: build NavItem(href, title)
Initializer->>ComponentDoc: ComponentDoc.nav_items
ComponentDoc->>ComponentDoc: filter components with examples, group by category
ComponentDoc->>NavItem: build NavItem(href, title)
Controller->>Controller: include DocsKit::Controller
Controller->>Controller: render_page(view) via included module
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
docs-kit PhlexyUI#45 fixes the topbar search box overflowing ~34px on a 390px phone (it didn't shrink, pushing the theme switcher off-screen). Bump the pin so this site's mobile topbar is fixed too.
What & why
Dogfooding pass on the DaisyUI Ruby docs site. The 70-component gallery already renders well, but the site was pinned to an old docs-kit and its AI surfaces were empty. This bumps docs-kit, cleans up the deferred consumer drift, and makes the whole component gallery machine-readable.
1. Sync to latest docs-kit +
--synccleanupmain(the 25 recent dogfood bug fixes) and ranrails g docs_kit:install --sync, then acted on its drift checklist:ApplicationController#render_page—DocsKit::Controllernow provides it and serves the Markdown twin, so removing the override newly enables the.mdtwin for every component and guide page.app/helpers/icon_helper.rb./llms.txt+/llms-full.txtroutes--syncadded, plusAGENTS.md, the write-docs-page skill, and the docs-kit RuboCop cops.2. Made the component gallery AI-readable
The AI surfaces were empty because the sidebar uses a bespoke
c.navlambda, sonav_registries(which/llms.txt,/llms-full.txt, and search derive from) was never set.c.nav_registries = { "Components" => ComponentDoc, "Guides" => Doc }.#nav_items+#href+#view_class. The interesting bit: a component page rendersViews::Components::Show.new(component:), butLlmsTextcallsview_class.new(no args). SoComponentDoc#view_classreturns a no-arg subclass ofShowwith the component pre-bound — which lets each of the 70 components export its Markdown twin into/llms-full.txtand the search index. Components with no examples are dropped (no dead entries), matching the existing sidebar rule.c.tagline(the/llms.txtblockquote) andc.code_theme+c.code_theme_dark(readable code in light and dark themes).Before → after:
/llms.txtwent from just the title (14 B) to 3.9 KB listing all 70 components grouped by category + the guides;/llms-full.txtwent from 14 B to 109 KB; search now indexes every component.Verification
.mdtwin works (/components/button.md→ 200)./llms.txt,/llms-full.txt, and/docs/searchall populated and 200.(
/docs/theming+/docs/getting-startedare pre-existing unwritten guide stubs — correctly excluded from the nav + AI index, so no dead links. Not touched here.)https://claude.ai/code/session_01FPQb6z3YwcKRMbvoJhdxnX
Summary by CodeRabbit
New Features
Bug Fixes
Chores