|
1 | | -/* |
2 | | - * patternlab-node - v0.12.0 - 2015 |
3 | | - * |
| 1 | +/* |
| 2 | + * patternlab-node - v0.12.0 - 2015 |
| 3 | + * |
4 | 4 | * Brian Muenzenmeyer, and the web community. |
5 | | - * Licensed under the MIT license. |
6 | | - * |
7 | | - * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. |
| 5 | + * Licensed under the MIT license. |
| 6 | + * |
| 7 | + * Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. |
8 | 8 | * |
9 | 9 | */ |
10 | 10 |
|
|
22 | 22 | return true; |
23 | 23 | } |
24 | 24 |
|
| 25 | + |
25 | 26 | //find and return any {{> template-name }} within pattern |
26 | 27 | function findPartials(pattern){ |
27 | 28 | var matches = pattern.template.match(/{{>([ ])?([\w\-\.\/~]+)(?:\:[A-Za-z0-9-]+)?(?:(| )\(.*)?([ ])?}}/g); |
|
41 | 42 | } |
42 | 43 | } |
43 | 44 |
|
44 | | - function applyStyleModifications(pattern, patternlab){ |
45 | | - //look for styleModifiers within the pattern template |
46 | | - var matches = pattern.template.match(/(:)([a-zA-Z]*)/g); |
47 | | - |
48 | | - //parse matches if they look like modifiers |
49 | | - if(matches){ |
50 | | - console.log(matches); |
51 | | - |
52 | | - for(var i = 0; i < matches.length; i++){ |
53 | | - if(matches[i].length > 1){ |
54 | | - console.log(matches[i]); |
55 | | - } |
56 | | - } |
57 | | - } |
58 | | - |
59 | | - //add to pattern data |
60 | | - |
61 | | - //remove from the template |
62 | | - } |
63 | | - |
64 | 45 | function addPattern(pattern, patternlab){ |
65 | 46 | patternlab.data.link[pattern.patternGroup + '-' + pattern.patternName] = '/patterns/' + pattern.patternLink; |
66 | 47 | patternlab.patterns.push(pattern); |
|
111 | 92 | try { |
112 | 93 | var listJsonFileName = patternlab.config.patterns.source + currentPattern.subdir + '/' + currentPattern.fileName + ".listitems.json"; |
113 | 94 | currentPattern.patternSpecificListJson = fs.readJSONSync(listJsonFileName.substring(2)); |
114 | | - if(patternlab.confi.debug){ |
115 | | - console.log('found pattern-specific listitems.json for ' + currentPattern.key); |
116 | | - } |
| 95 | + console.log('found pattern-specific listitems.json for ' + currentPattern.key); |
117 | 96 | } |
118 | 97 | catch(e) { |
119 | | - } |
| 98 | + } |
120 | 99 |
|
121 | 100 | //add the raw template to memory |
122 | 101 | currentPattern.template = fs.readFileSync(abspath, 'utf8'); |
|
166 | 145 |
|
167 | 146 | } |
168 | 147 |
|
169 | | - //look for pattern styleModifiers |
170 | | - applyStyleModifications(currentPattern, patternlab); |
171 | | - |
172 | 148 | //find pattern lineage |
173 | 149 | lineage_hunter.find_lineage(currentPattern, patternlab); |
174 | 150 |
|
|
0 commit comments