File tree Expand file tree Collapse file tree 3 files changed +102
-3
lines changed Expand file tree Collapse file tree 3 files changed +102
-3
lines changed Original file line number Diff line number Diff line change 11# Installing and configuring
22
3- > TODO
3+ The easiest way to install this bundle is using Composer
4+ ``` bash
5+ $ composer require lin3s/pattern-library-builder
6+ ```
7+ Register the Bundle in your AppKernel
8+ ``` php
9+ $bundles = [
10+ ...
11+ new Lin3sPatternLibraryBuilderBundle(),
12+ ...
13+ ];
14+ ```
15+ Configure the basic settings in your ` config.yml ` :
16+ ``` yaml
17+ lin3s_pattern_library_builder :
18+ theme :
19+ title : " My title"
20+ description : " My description"
21+ custom_styles :
22+ color_primary : " #000"
23+ logo : ~
24+ javascripts : []
25+ stylesheets : []
26+ templates_config_files_path : " %kernel.root_dir%/PatternLibrary"
27+ ` ` `
28+ Add routes to access the Design System in your routing file:
29+ ` ` ` yaml
30+ _pattern_library :
31+ resource : " @Lin3sPatternLibraryBuilderBundle/Resources/config/routing.yml"
32+ ` ` `
33+ Create a folder in your AppBundle kernel root named ` PatternLibrary` to store the Pattern Library configuration
34+ and create an index configuration file.
35+ ` ` ` yaml
36+ status: 0
37+ description: '<p>This is the icon card component description.</p>'
38+ renderer:
39+ type: homepage
40+ options:
41+ sections: []
42+ ` ` `
43+
44+ Install assets
45+ ` ` ` bash
46+ $ bin/console assets:install --symlink
47+ ` ` `
48+
49+ Now you can navigate to `http://localhost:8000/design-system` and see the index page.
Original file line number Diff line number Diff line change 11# Your first page
22
3- For this example we are showing
3+ For rendering components in the Pattern Library first you should create a YAML in your ` PatternLibrary ` folder for the
4+ desired item to render. It is recommended to have separated folders inside PatternLibrary folder for separating
5+ different kind of components.
6+
7+ For example:
8+ ``` yaml
9+ status : 2
10+ description : ' <p>This is the button atom description.</p>'
11+ renderer :
12+ type : twig
13+ options :
14+ template : ' atoms/button.html.twig'
15+ preview_parameters :
16+ primary :
17+ content : Hola
18+ link :
19+ content : Hola 2
20+ modifier : orange
21+ href : test
22+ tag : a
23+ ` ` `
24+
25+ Then, reference it in ` index.yml` on the desired section with the corresponding slug based on directory structure:
26+ ` ` ` yaml
27+ status: 0
28+ description: '<p>This is the icon card component description.</p>'
29+ renderer:
30+ type: homepage
31+ options:
32+ sections:
33+ -
34+ title: 'Atoms'
35+ description: 'These are the atoms'
36+ items:
37+ -
38+ slug: 'architecture/atoms/button'
39+ ` ` `
40+
41+ The component to render must exists in the current views folder of your application.
Original file line number Diff line number Diff line change 11# Symfony Configuration reference
22
3- > TODO
3+ These are the parameters accepted by Pattern Library Builder
4+
5+ ``` yaml
6+ lin3s_pattern_library_builder :
7+ theme :
8+ title : " My title"
9+ description : " My description"
10+ custom_styles :
11+ color_primary : " #000"
12+ logo : ~
13+ # Javascript files to be injected to the pattern library
14+ javascripts : []
15+ # CSS files to be injected to the pattern library
16+ stylesheets : []
17+ templates_config_files_path : " %kernel.root_dir%/PatternLibrary"
18+ ` ` `
You can’t perform that action at this time.
0 commit comments