qossmic / twig-doc-bundle
包含 twig 组件的 Storybook
v0.0.3
2024-04-22 07:55 UTC
Requires
- php: >=8.2
- nelmio/alice: ^3.13
- symfony/framework-bundle: ^6.4|^7.0
- symfony/twig-bundle: ^6.4|^7.0
- symfony/validator: ^6.4|^7.0
- symfony/yaml: ^6.4|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.51
- phpunit/phpunit: ^10.5
- symfony/browser-kit: ^6.4|^7.0
- symfony/css-selector: ^6.4|^7.0
- symfony/dom-crawler: ^6.4|^7.0
- symfony/ux-twig-component: ^2.16.0
Suggests
- symfony/ux-live-component: Create truly reactive frontend components and document them with this bundle
- symfony/ux-twig-component: Create native UX components with twig and document them with this bundle
This package is auto-updated.
Last update: 2024-09-15 14:47:50 UTC
README
实验性包
重要:这是一个实验性版本,可能会发生重大变化。因此,在发布稳定版本之前,您在更新时可能会遇到破坏性更改。
- 不良模板:由于前端能力的不足,模板非常“基础”
- 但在每个 Symfony 包中,您都可以轻松覆盖它们并创建自己的模板 :-)
- 文档不完整
- 没有翻译(目前)
允许您为 Twig 组件创建概述,无论是 UX-Components、UX-Live-Components 还是简单的片段模板。
组件将按类别和可选子类别分组。
安装
由于包尚未公开发布,您需要在 composer.json 文件中添加一个存储库。
{ "repositories": [ { "type": "git", "url": "https://github.com/qossmic/twig-doc-bundle.git" } ] }
安装包
composer req qossmic/twig-doc-bundle
路由
由于 symfony 从不为包创建路由,您需要自行配置!
创建一个配置文件:config/routes/twig_doc.yaml
twig_doc: resource: '@TwigDocBundle/config/routing/documentation.xml' prefix: /twig/doc # or for localized: prefix: /{_locale}/twig/doc/
自定义设计
要自定义文档的设计,您可以在项目中覆盖包中的任何模板。
参见:如何覆盖包的任何部分