Skip to content

Commit 527b5ce

Browse files
committed
Update README
1 parent 4dcce4f commit 527b5ce

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Installation
44

5-
To install the plugin run:
5+
To install and use the plugin run:
66

77
```sh
88
composer require aleksip/plugin-data-transform
@@ -11,10 +11,17 @@ composer require aleksip/plugin-data-transform
1111

1212
## Features
1313

14-
Currently the plugin provides 3 transform functions for the JSON data read by Pattern Lab.
14+
### Pattern-specific data file support for included patterns
1515

16+
Pattern Lab currently only supports global data files and a pattern-specific data file for the main pattern. This plugin adds pattern-specific data file support for included patterns. This feature only works with Twig PatternEngine.
1617

17-
### Include pattern files
18+
19+
### Data transform functions
20+
21+
Currently the plugin provides 3 transform functions for the data read by Pattern Lab. The examples provided are in JSON but Pattern Lab supports YAML too! These functions should work with both Twig and Mustache PatternEngines.
22+
23+
24+
#### Include pattern files
1825

1926
If a value contains the name of a pattern in shorthand partials syntax, the plugin will replace the value with the rendered pattern:
2027

@@ -43,7 +50,7 @@ Advanced syntax with support for passing variables and disabling access to the d
4350
In both examples the value of `key` will replaced with the rendered pattern.
4451

4552

46-
### Join text values
53+
#### Join text values
4754

4855
```json
4956
{
@@ -62,16 +69,16 @@ In both examples the value of `key` will replaced with the rendered pattern.
6269
The value of `key` will be replaced with the joined strings. Note that in the example `molecules-comment.html` is the name of a pattern in shorthand partials syntax. These will be replaced with the rendered pattern before the join.
6370

6471

65-
### Create Drupal `Attribute` objects
72+
#### Create Drupal `Attribute` objects
6673

6774
```json
6875
{
6976
"key": {
7077
"Attribute()": {
71-
"id": [ "edit-submit" ],
72-
"type": [ "submit" ],
73-
"value": [ "Submit" ],
74-
"class": [ "button", "button-primary" ]
78+
"id": ["edit-submit"],
79+
"type": ["submit"],
80+
"value": ["Submit"],
81+
"class": ["button", "button-primary"]
7582
}
7683
}
7784
}
@@ -82,4 +89,4 @@ The value of `key` will be replaced with an [Attribute object](https://www.drupa
8289

8390
## More examples
8491

85-
All functions provided by this plugin are used extensively in [Shila Drupal Theme StarterKit](https://github.com/aleksip/starterkit-shila-drupal-theme).
92+
All features provided by this plugin are used extensively in [Shila Drupal Theme StarterKit](https://github.com/aleksip/starterkit-shila-drupal-theme).

0 commit comments

Comments
 (0)