Skip to content

Conversation

@djalmaaraujo
Copy link
Contributor

Related Issue

Continuation of documentation migration from the web repository (#336, #337, #338).

Description

This PR adds documentation files for batch 4 components (8 total):

  • Popover - Displays rich content in a portal, triggered by a button
  • Progress - Displays an indicator showing the completion progress of a task
  • RadioButton - A control that allows users to make a single selection from a list
  • Select - Displays a list of options for the user to pick from
  • Separator - Visually or semantically separates content
  • Sheet - Displays content that complements the main content of the screen
  • ShortcutKey - A component for displaying keyboard shortcuts
  • Sidebar - A composable, themeable and customizable sidebar component

These documentation files are copied from web/app/views/docs/ and placed in lib/ruby_ui/{component}/{component}_docs.rb. They will be distributed to Rails apps via the bin/rails g ruby_ui:install:docs generator.

Test plan

  1. Point gem to local source in Gemfile:

    gem "ruby_ui", path: "~/dev/linkana/ruby_ui"
  2. Remove existing documentation files for affected components (if any):

    rm app/views/docs/popover.rb
    rm app/views/docs/progress.rb
    rm app/views/docs/radio_button.rb
    rm app/views/docs/select.rb
    rm app/views/docs/separator.rb
    rm app/views/docs/sheet.rb
    rm app/views/docs/shortcut_key.rb
    rm app/views/docs/sidebar.rb
  3. Run the docs generator:

    bin/rails g ruby_ui:install:docs
  4. Verify all 8 files are created in app/views/docs/

  5. Run test suite:

    bundle exec rake

Introduce a new generator (`ruby_ui:install:docs`) that copies component
documentation files from the gem to Rails applications. Documentation
files follow the naming convention `{component}_docs.rb` and are copied
to `app/views/docs/` with the `_docs` suffix removed.

Usage:
  bin/rails g ruby_ui:install:docs
  bin/rails g ruby_ui:install:docs --force

Include stub classes for docs dependencies (Views::Base, Docs::Header,
Docs::VisualCodeExample, etc.) so docs files can be loaded without errors.
Rails apps can override these with full implementations.

Includes button component documentation as the first example.
Add docs files for:
- accordion
- alert
- alert_dialog
- aspect_ratio
- avatar
- badge
- breadcrumb
- calendar
- card
Add documentation files for: carousel, chart, checkbox, clipboard,
codeblock, collapsible, combobox, command, context_menu, dialog
Migrate documentation files for dropdown_menu, form, hover_card,
input, link, masked_input, and pagination components.
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner December 10, 2025 21:03
@djalmaaraujo djalmaaraujo changed the base branch from main to docs/batch-3 December 10, 2025 21:09
- Update VisualCodeExample to accept description and src parameters
- Add InlineLink, Text, Alert, AlertTitle, AlertDescription helpers
- Add route helper stubs (docs_*_path methods)
- Add sidebar example constants
Base automatically changed from docs/batch-3 to main December 11, 2025 17:35
Add documentation files for skeleton, switch, table, tabs, textarea,
theme_toggle, tooltip, and typography components.

Also adds missing stub methods for typography docs (Components.Heading,
Components.TypographyList, InlineCode, docs_installation_path).
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.

3 participants