You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(page): normalize the authoring API — positional Header title, prose/example helpers (#27)
## Summary
One consistent convention across the kit: the primary argument is positional,
modifiers are keyword arguments — and the everyday authoring path no longer hits
the Ruby parens-with-blocks SyntaxError.
- `DocsUI::Header` takes the title positionally (`Header("Installation")`),
matching Section/Code. The legacy `title:` kwarg still works (silent compat,
no deprecation); the positional wins if both are given.
- New lowercase, block-friendly page helpers `prose { … }` and `example { |ex| … }`
(alongside the existing `md`), extracted into `DocsUI::PageHelpers` and mixed
into `DocsUI::Page`. A lowercase method takes a block without parens, so the
gotcha structurally cannot occur. The kit forms `DocsUI::Prose()` /
`DocsUI::Example()` stay valid forever.
- The gem's own docs pages adopt the helpers; the dedicated "parens gotcha"
section shrinks to a footnote. README documents the convention.
`PageHelpers` is a module (not methods inline on Page) so the helpers are
unit-testable against a bare Phlex host — `DocsUI::Page` includes
Phlex::Rails::Helpers::Routes and cannot load in the standalone suite.
## Test Coverage
- spec/docs_ui/header_spec.rb: positional title, eyebrow, lead block; legacy
`title:` kwarg renders identically (backwards-compat proof); positional wins
when both given.
- spec/docs_ui/page_helpers_spec.rb: `prose`/`example`/`md` render the expected
Prose wrapper / Example tabs / Markdown against a bare Phlex host exercising the
REAL PageHelpers module.
- spec/docs_ui/markdown_spec.rb: the `md` delegation test now includes the real
PageHelpers module instead of re-implementing `md`.
## Verification
- [x] bundle exec rake (rspec 103 examples, 0 failures; rubocop 42 files clean)
- [x] header.rb + page_helpers.rb: 100% line coverage
- [x] grep gate: no live DocsUI::Prose()/Example() in gem docs (only code{} API references remain)
- [x] backwards compatible: `Header(title:)` covered by spec; existing consumer sites unchanged
Refs #10
0 commit comments