-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from pattern-lab/dev
Merging changes for patternlab 0.8.0
- Loading branch information
Showing
96 changed files
with
382 additions
and
7,553 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
(function () { | ||
"use strict"; | ||
|
||
"use strict"; | ||
|
||
var fs = require('fs-extra'), | ||
path = require('path'); | ||
|
||
var pattern_assembler = function(){ | ||
|
||
function setState(pattern, patternlab){ | ||
if(patternlab.config.patternStates[pattern.patternName]){ | ||
pattern.patternState = patternlab.config.patternStates[pattern.patternName]; | ||
} else{ | ||
pattern.patternState = ""; | ||
} | ||
} | ||
|
||
function addPattern(pattern, patternLab){ | ||
patternLab.data.link[pattern.patternGroup + '-' + pattern.patternName] = '/patterns/' + pattern.patternLink; | ||
patternLab.patterns.push(pattern); | ||
} | ||
|
||
return { | ||
setPatternState: function(pattern, patternlab){ | ||
setState(pattern, patternlab); | ||
}, | ||
addPattern: function(pattern, patternLab){ | ||
addPattern(pattern, patternLab); | ||
} | ||
}; | ||
|
||
}; | ||
|
||
module.exports = pattern_assembler; | ||
|
||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* patternlab-node - v0.8.0 - 2015 | ||
* | ||
* Brian Muenzenmeyer, and the web community. | ||
* Licensed under the MIT license. | ||
* | ||
* Many thanks to Brad Frost and Dave Olsen for inspiration, encouragement, and advice. | ||
* | ||
*/ | ||
|
||
(function () { | ||
"use strict"; | ||
|
||
var fs = require('fs-extra'), | ||
path = require('path'); | ||
|
||
var pattern_exporter = function(){ | ||
|
||
function exportPatterns(patternlab){ | ||
|
||
//read the config export options | ||
var exportKeys = patternlab.config.patternExportKeys; | ||
|
||
//find the chosen patterns to export | ||
for (var i = 0; i < exportKeys.length; i++){ | ||
for (var j = 0; j < patternlab.patterns.length; j++){ | ||
if(exportKeys[i] === patternlab.patterns[j].key){ | ||
//write matches to the desired location | ||
fs.outputFileSync(patternlab.config.patternExportDirectory + patternlab.patterns[j].key + '.html', patternlab.patterns[j].patternPartial); | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
return { | ||
export_patterns: function(patternlab){ | ||
exportPatterns(patternlab); | ||
} | ||
}; | ||
|
||
}; | ||
|
||
module.exports = pattern_exporter; | ||
|
||
}()); |
Oops, something went wrong.