-
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 #83 from pattern-lab/plnode1-7
Plnode1 7
- Loading branch information
Showing
11 changed files
with
104 additions
and
27 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* patternlab-node - v0.1.7 - 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; | ||
|
||
}()); |
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