Skip to content

Conversation

@Kocal
Copy link
Member

@Kocal Kocal commented Oct 31, 2025

Q A
Bug fix? no
New feature? yes
Deprecations? no
Documentation? no
Issues Fix #2950
License MIT

Props and blocks now render like that:
image

I also updated/fixed some examples or components

@Kocal Kocal self-assigned this Oct 31, 2025
@Kocal Kocal force-pushed the 2950-toolkit-props-api-docs-bis branch 3 times, most recently from e6d8290 to ada069d Compare October 31, 2025 22:41
@Kocal Kocal marked this pull request as ready for review October 31, 2025 22:47
@carsonbot carsonbot added Feature New Feature Toolkit Status: Needs Review Needs to be reviewed labels Oct 31, 2025
@Kocal Kocal requested a review from Copilot October 31, 2025 22:53
Copy link

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 PR adds automatic API reference documentation generation for Twig components. The system parses special comment annotations (@prop and @block) in component templates to generate API documentation tables showing available props and blocks.

  • Implements renderApiReference() method that extracts API annotations from Twig templates using regex patterns
  • Integrates API reference section into component documentation pages
  • Adds CommonMark table extension support with responsive styling

Reviewed Changes

Copilot reviewed 77 out of 78 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ux.symfony.com/src/Service/Toolkit/ToolkitService.php Adds renderApiReference() method to parse @prop and @block annotations from Twig files and generate markdown tables
ux.symfony.com/src/Twig/Components/Toolkit/ComponentDoc.php Integrates API reference generation into component documentation content
ux.symfony.com/src/Service/CommonMark/ConverterFactory.php Adds TableExtension and DefaultAttributesExtension to support markdown tables with responsive wrapping
ux.symfony.com/assets/styles/components/_Wysiwyg.scss Adds styling for responsive table containers
ux.symfony.com/composer.json Adds symfony/string dependency
src/Toolkit/kits/shadcn//templates/components/.html.twig Adds @prop and @block annotations to component templates for API documentation
src/Toolkit/kits/shadcn/*/EXAMPLES.md Updates examples to reflect prop name changes and add new examples

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

@@ -1,3 +1,5 @@
{# @prop variant 'default'|'desctructive' The variant, default to `default` #}
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'desctructive' to 'destructive'.

Suggested change
{# @prop variant 'default'|'desctructive' The variant, default to `default` #}
{# @prop variant 'default'|'destructive' The variant, default to `default` #}

Copilot uses AI. Check for mistakes.
```

## With a 1 / 1 aspect ratio
## With 2 / 3 aspect ratio
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Extra space in the heading '2 / 3 aspect ratio' (double space before 'aspect'). Should be single space.

Suggested change
## With 2 / 3 aspect ratio
## With 2 / 3 aspect ratio

Copilot uses AI. Check for mistakes.
@Kocal Kocal force-pushed the 2950-toolkit-props-api-docs-bis branch from ada069d to 133943b Compare November 2, 2025 07:06
@Kocal Kocal merged commit 9bc8da7 into symfony:2.x Nov 2, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature Status: Needs Review Needs to be reviewed Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Toolkit] Add support for documenting props API

2 participants