Skip to content

Add blocks#430

Open
sethhorsley wants to merge 3 commits intomainfrom
add-blocks
Open

Add blocks#430
sethhorsley wants to merge 3 commits intomainfrom
add-blocks

Conversation

@sethhorsley
Copy link
Member

This pull request introduces enhancements to the documentation code examples system, enabling dynamic rendering of Ruby blocks as previews and improving flexibility for component and block demonstrations. The changes add support for rendering blocks with custom attributes, update routing and controller logic, and streamline how code examples are displayed.

Enhancements to code example rendering:

  • Added support for rendering Ruby blocks as previews in Docs::VisualCodeExample, including new initialization parameters (ruby_code, type, content, content_attributes) and logic to handle block previews and component previews. [1] [2]
  • Implemented render_block_to_html method in Docs::VisualCodeExample to evaluate and render Ruby code blocks to HTML for standalone previews.

Controller and routing updates:

  • Added blocks and render_block actions to PagesController for dynamic rendering of blocks with attributes, and updated routes to support these actions. [1] [2]
  • Removed old sidebar example routes and replaced them with block-based rendering.

Documentation views refactoring:

  • Updated documentation views (docs/button.rb, docs/sidebar.rb) to use the new Docs::VisualCodeExample initialization parameters, allowing block-based and component-based previews with custom attributes. [1] [2]

@sethhorsley sethhorsley requested a review from cirdes as a code owner March 9, 2026 04:55
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.

1 participant