Skip to content

Improve documentation visuals#81

Merged
koppen merged 22 commits intomainfrom
docs
Feb 6, 2026
Merged

Improve documentation visuals#81
koppen merged 22 commits intomainfrom
docs

Conversation

@koppen
Copy link
Copy Markdown
Member

@koppen koppen commented Feb 6, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request improves documentation visuals for Flowbite component documentation by introducing a standardized "example" preview method pattern, reorganizing docstrings for better visual presentation, and refactoring the documentation rendering system with new helper classes and view components.

Changes:

  • Adds an "example" method to preview files (ButtonPreview, CardPreview, ToastPreview, InputPreview, InputFieldPreview, BreadcrumbPreview, LinkPreview) to provide a default visual example that appears at the top of component documentation
  • Refactors documentation rendering with new Yard::CodeObject model wrapper, FormattingHelper::DocstringRenderer class, and Docs::Headline components (H1-H4)
  • Reorganizes component docstrings to move @see tags after @example tags for improved visual flow

Reviewed changes

Copilot reviewed 28 out of 30 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
demo/test/components/previews/*.rb Adds "example" methods and renames some existing methods for consistency
demo/app/views/docs/components/show.html.erb Major refactoring to separate introduction from body content and render examples prominently
demo/app/models/yard/code_object.rb New model wrapper for YARD code objects with docstring splitting methods
demo/app/models/yard.rb New module for YARD registry access
demo/app/helpers/formatting_helper.rb New helper with DocstringRenderer class replacing the deleted markdown_helper
demo/app/controllers/docs/components_controller.rb Refactored to use new Yard module and add preview finding methods
demo/app/components/docs/headline/*.rb New components for consistent heading rendering
demo/app/components/docs/code_example.rb New component for code example rendering
demo/Gemfile Adds rails_autolink dependency
app/components/flowbite/*.rb Documentation improvements (moved @see tags, removed blank lines)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

koppen added 18 commits February 6, 2026 11:03
Seeing an example of the component is pretty important for the
documentation, so this change looks for a Lookbook preview with a
scenario named "example" and renders it as part of the introduction
section.
This makes it more scannable and allows us to show the scenario label as
a heading for each example.
Show, don't tell. If people want the nitty-gritty API details, they can
scroll to the bottom. The top should focus on usage and examples.
This should make it easier to adjust docstring rendering in the future.
This should make it possible to rely on our docs being rendered roughly
the same way in both rdocs and our own demo app.
We format code comment blocks with max 80 characters per line. This
means that each line ends in a line break which appears in the
docstring, thus is converted to <br> tags by the markdown renderer.

To improve the rendering of such docstrings, we remove these line breaks
after the markdown rendering step.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 30 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This seems to be the proper way to get the class name of a preview
@koppen koppen merged commit f915bde into main Feb 6, 2026
6 checks passed
@koppen koppen deleted the docs branch February 6, 2026 12:01
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.

2 participants