You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-34Lines changed: 27 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,61 +1,55 @@
1
1
# PatternKit
2
-
Panels-based plugin that wraps a PatternLab library of components.
2
+
Drupal module that wraps a PatternLab library of patterns.
3
3
4
-
This code will parse a pattern library (local or through REST endpoints) to generate a list of "content types" in panels that can be drag/dropped into panel variants.
4
+
This code will parse a pattern library (local or through REST endpoints) to generate a list of blocks that can be drag/dropped into layouts.
5
5
6
6
If enabled, the configuration screen is simply an iframe wrapper of a simplified version of the PatternLab schema builder.
7
7
8
8
When pattern configurations are saved, the template is downloaded locally (to mitigate origin failures and lock in version at time of configuration.)
9
9
10
-
Rendered twigs may contain drupal tokens, which are then processed in context.
10
+
Rendered templates may contain drupal tokens, which are then processed in context.
11
11
12
12
## Installation
13
13
Install the patternkit module as usual, and review the important variables below to determine if you would like to change the defaults.
14
14
15
-
Install the Twig library into /sites/all/libraries/Twig
The patternkit module by itself only provides the glue for other modules to present components. Define one by implementing ```hook_patternkit_library```
15
+
The patternkit module by itself only provides the glue for other modules to present components. Define one by adding a 'patterns' section to your libraries.yml.
$libraries[] = new PatternkitDrupalTwigLib($namespace, $lib_path);
40
-
}
41
-
42
-
return $libraries;
43
-
}
18
+
```YAML
19
+
patternkit_example.pkexample:
20
+
version: VERSION
21
+
css:
22
+
theme:
23
+
lib/patternkit/dist/patternkit.css: {}
24
+
js:
25
+
lib/patternkit/dist/patternkit.min.js: {}
26
+
patterns:
27
+
atoms:
28
+
lib/patternkit/src/atoms: {}
44
29
```
45
30
46
31
There are two different plugins currently available,
47
-
*PatternkitRESTLib
48
-
*PatternkitDrupalTwigLib
32
+
* PatternkitRESTLibrary
33
+
* PatternkitTwigLibrary
49
34
50
35
Use the former for dynamic REST based components, and the latter for locally sourced.
51
36
37
+
You can create your own plugins if you'd like to add support for other library types. Feel free to [create a pull request](https://github.com/cybtachyon/patternkit/pulls) to have it added to the repo!
38
+
52
39
## Important Variables
53
40
* ```patternkit_cache_enabled``` - Whether or not the metadata and render cache are enabled. (Disable during development)
54
41
* ```patternkit_pl_host``` - The scheme://hostname:port/ of the PatternLab library host.
55
42
* ```patternkit_default_module_ttl``` - How long the rendered pattern should be cached.
56
43
* ```patternkit_show_errors``` - Whether or not to display messages on the site.
57
44
* ```patternkit_log_errors``` - Whether or not to log errors to php error log.
58
45
46
+
## Definitions
47
+
Most of the thinking and vernacular used in Patternkit is inspired by conversations that have happened around Design Systems. A great reference for this is [Brad Frost's Atomic Design Book](http://atomicdesign.bradfrost.com/).
48
+
* **Category** The design system category for a pattern, e.g. _Atom_, _Molecule_, _Organism_.
49
+
* **Design System** A modular and manageable approach to creating reusable design patterns for building GUI's. See http://atomicdesign.bradfrost.com/chapter-1/
50
+
* **Pattern** A component, widget, or template that can be rendered to an HTML GUI.
51
+
52
+
59
53
## TODOs
60
54
* https://github.com/drupal-pattern-lab/roadmap/issues/8 Solve the problem of mapping Drupal fields to pattern Variables.
61
55
* Error handling.
@@ -67,9 +61,8 @@ More documentation will be added.
0 commit comments