A node-based script for importing patterns, following the Pattern Library model.
THIS IS POC CODE
but...we can still make it work by following these steps for Atlas:
-
Install Atlas using the yeoman generator
-
Add the pattern-importer as a node module:
npm install git+ssh://[email protected]:pattern-library/pattern-importer.git
-
Add the pattern-library as a bower dependency:
bower install [email protected]:pattern-library/pattern-library.git
-
Create a new gulp file
./app/_gulp/pattern-import.js
-
Add the following code to
pattern-import.js
:/** * @fileOverview Uses Gulpjs to grab html patterns * * @author Scott Nath * * @requires NPM:gulp * @requires NPM:js-yaml * @requires /gulp/config.js */ 'use strict'; var gulp = require('gulp'), print = require('gulp-print'), patternImporter = require('pattern-importer'); var pattFiles = ['./app/bower_components/pattern-library/patterns/**/pattern.yml']; gulp.task('pattern-import', function() { console.log('-------------------------------------------------- DEVELOPMENT: GRABBING HTML PATTERNS'); return gulp.src(pattFiles) .pipe(print()) .pipe(patternImporter()); });
-
Import the patterns on the command line with:
gulp pattern-import
-
Find your imported patterns in ./app/_patterns